MARYLAND’S MARIJUANA laws remain a work in progress. Lawmakers in Annapolis have just enacted a measure to decriminalize the possession of small amounts of pot, treating it as an offense on a par with minor traffic infractions. But possession of drug paraphernalia — growing equipment, scales, bongs and “roach clips” — can still land you in jail and draw a stiff fine. The logic in this arrangement may be lacking, but the trend is clear.

Across the country, states are moving to ease punishment for recreational pot use and to make medical marijuana more available. Two states, Colorado and Washington, have legalized the drug and are regulating and taxing it like alcohol. With the legislative landscape in such flux, and public opinion shifting quickly in the direction of leniency, Maryland faced a real challenge in getting its laws right. After some anguished back and forth, it did so, mostly.

The bill that emerged from the General Assembly, which Gov. Martin O’Malley (D) said he will sign, is a major change. Until now, those convicted of possession of small amounts of pot could face jail time, though as a practical matter most have been put on probation, at least for the first offense. Convictions constituted criminal offenses, staining the records of many young adults.

Under the new law, adults age 21 and over will face fines escalating to $500 the first three times they are caught with less than 10 grams of pot. (That’s about a third of an ounce, enough for two or three dozen joints, and worth anywhere from $50 to $100, depending on the drug’s quality.) They will not have to appear in court, and — again like a traffic ticket — the offense will not result in a criminal record. (Offenders under the age of 21 will still have to go before a judge, though they are also unlikely to face prison time.)

The legislation’s passage was a close-run thing. In the House of Delegates, where a similar measure failed last year after passing the state Senate, it was opposed by the head of the Judiciary Committee, Del. Joseph F. Vallario Jr. (D-Prince George’s). But a groundswell of support from African American lawmakers turned the tide in the bill’s favor, and with good reason. Blacks are far more likely to face charges and punishment for possessing marijuana, even though their rate of use of the drug is no higher than that of other groups. That racial disparity in enforcement is a disgrace.

As with gay marriage, Americans’ attitudes toward marijuana have evolved with breathtaking speed. A poll by the Pew Research Center, conducted just over a year ago, found that 52 percent of the public supported legalizing marijuana, a jump of 20 percentage points since 2002. Among younger Americans, about two-thirds favor legalization .

Given that movement, Maryland could have gone the way of Colorado and Washington. Wisely, lawmakers demurred. Allowing retail outlets to sell the drug may turn out to be harmless, though we have our doubts; plenty of evidence suggests that the drug’s use can have harmful health effects and can contribute to traffic accidents and fatalities. Better to watch the results from Colorado and Washington before following them blindly.