The leftward transformation of Virginia since President Trump was elected crescendoed over the weekend, with the governor signing into law protections for L.G.B.T. residents, gun background checks, no jail time for simple marijuana possession and early voting.

The flurry of new measures enacted by Gov. Ralph S. Northam, a Democrat, came five months after members of his party took control of the Legislature back from Republicans for the first time in more than 20 years. Mr. Northam had been facing a deadline of midnight Saturday for signing bills into law.

In Virginia, Democrats have developed a political advantage in the heavily populated northern suburbs of Washington, where Hispanic and Asian voters make up a growing part of the electorate, as well as in places with a significant African-American population like Norfolk.

Democrats have used that upper hand to remake a state that was once the seat of the Confederacy and known as a conservative bastion, one that the political scientist V.O. Key Jr. described as “political museum piece.” He wrote that, by comparison to Virginia, Mississippi was “a hotbed of democracy.”