Many constitutional law experts, former Democratic Gov. Jerry Brown and the California Republican Party are now all officially entitled to say, “I told you so.”

This morning the California Supreme Court unanimously struck down a new state law that would have required presidential candidates to publicly disclose their tax returns before appearing on the primary ballot.

Passed by the supermajority of Democrats in California’s Legislature and signed by new Democratic Gov. Gavin Newsom, the law was the statutory embodiment of California’s place at the front of the anti-Trump “Resistance.” It was a blatant dig at the GOP president — and one that generated plenty of national media attention.

But to some constitutional law scholars, the law was also obviously unconstitutional. Gov. Brown shared those concerns when he vetoed identical legislation in 2017.

Trump declined to release his tax returns during the 2016 presidential campaign, breaking with a precedent set in 1976 by President Jimmy Carter following the Watergate scandal.

“First, it may not be constitutional,” Brown wrote in his veto message at the time. “Second, it sets a ‘slippery slope’ precedent. Today we require tax returns, but what would be next?”

All seven justices of California’s Supreme Court were similarly persuaded.

“The Legislature may well be correct that a presidential candidate’s income tax returns could provide California voters with important information,” wrote Chief Justice Tani Cantil-Sakauye, a Gov. Arnold Schwarzenegger appointee. But, she added, the state constitution makes clear “it is the voters who must decide” whether a presidential candidate’s refusal “to make such information available to the public will have consequences at the ballot box.”

The chief justice is a former Republican who told CalMatters last year that she had left the GOP and switched her voter registration to no party preference — citing her increasing discomfort with the direction of the Republican Party.

The ruling was predicted by many who watched the expedited hearing the court held on the case earlier this month.

At that hearing, Justice Ming Chin, one of four Brown appointees, wondered whether California’s tax return ballot rule might encourage state legislators to saddle would-be candidates with “a laundry list of potential requirements.”

In response to today’s ruling, the Secretary of State’s office announced that they would be dropping their case in federal court as well. Last month, a district court judge put enforcement of the law on hold, writing in his opinion that while he empathized with the “motivations” of lawmakers who passed the bill into law, “the Act’s provisions likely violate the Constitution and the laws of the United States.”

The U.S. Constitution sets forth a very limited list of qualifications for those hoping to be president: a candidate must be a natural-born citizen over the age of 35 who has lived in the United States for at least 14 years. For decades the U.S. Supreme Court has held that states can set “procedural” requirements about where, when and how elections can take place, but have been otherwise averse to adding to that list of requirements.

Past attempts by states to impose term-limit requirements on people running for Congress or to require candidates to list their race on the ballot have been struck down.

The lead plaintiff in the California case, state Republican Party chair Jessica Patterson, celebrated victory this morning. “We are pleased that the courts saw through the Democrats’ petty partisan maneuvers and saw this law for what it is — an unconstitutional attempt to suppress Republican voter turnout,” she said in a statement.

Just to be on the safe side, Republicans had prepared a back-up plan in case they lost the court case — passing an internal rule allowing the party to choose its nominee at a special state party convention in lieu of the state primary election.

Supporters of the law argued that publishing one’s tax returns was just another administrative step, akin to a signature-gathering requirement or paying a filing fee.

“These are extraordinary times and states have a legal and moral duty to do everything in their power to ensure leaders seeking the highest offices meet minimal standards, and to restore public confidence,” Newsom said when he signed the requirement into law. “The disclosure required by this bill will shed light on conflicts of interest, self-dealing, or influence from domestic and foreign business interest. The United States Constitution grants states the authority to determine how their electors are chosen, and California is well within its constitutional right to include this requirement.

And some constitutional experts were on the Democrats’ side, among them Berkeley Law’s Dean Erwin Chemerinsky, who rejected the criticism that the law served to keep Trump off the California ballot.

“It does not keep any candidate from being on the ballot so long as he or she complies with a simple requirement that is meant to provide California voters crucial information,” Chemerinsky said. “This is the state acting to make sure that its voters have information that might be very important to them when they cast their ballots as to who they want to be President of the United States.”

Nonetheless, the ruling in California’s highest court cannot be appealed, meaning the state legal battle pursued by the Republican Party is now over.

California lawmakers have a track record of supporting bills of dubious legality but irresistible progressive political appeal.

As CalMatters reported last month, the Legislature passed a 2015 law forcing anti-abortion “crisis pregnancy centers” to provide their clients with information about free or low-cost abortion services. The law was eventually struck down as a clear violation of the First Amendment and the state was required to fork over $2 million to cover the legal cost of its ideological foes — a boon to the very anti-abortion forces the state was seeking to hamper.

State taxpayers have also had to foot the bill for defending California against challenges to other laws on dubious legal ground, including one that sought to prevent websites like IMDB.com from publishing the ages of actors.