California voters made Golden State history on Tuesday with the passing of Prop 12, the nation’s most progressive legislation for farm animals to date.

Also known as the Prevent Cruelty California Act, Prop 12 will require all egg-laying hens in the state to have at least one square foot of cage-free floor space, access to scratching posts, nests, and perches. Male calves raised for veal would require 43 square feet of usable floor space. And breeding pigs will now require 24 feet of floor space.

Producers have until 2021 to make the changes to their supply chain.

The legislation also requires any out-of-state vendors selling meat or eggs to adhere to the rules as well.

The legislation divided the animal rights community, with animal rights group PETA calling it little more than window dressing to the atrocities of the state’s factory farming industry. But a number of organizations supported the measure, including Mercy for Animals and the Humane Society of the United States, as a step toward more legislation and an entry point to deeper dialogues about animals in the food supply.

“Farm animals should not be crammed into a cage barely larger than their own body,” Josh Balk, vice president of farm animal protection of the Humane Society, told Capital Public Radio.

“Frankly, producers know the writing is on the wall,” Balk said, noting that the industry is already moving toward more ethical standards as consumers seek out more ethical industry behavior. Consumers, says Balk, “do not want animals to be confined in cages.”