The incoming Donald Trump administration poses many potential challenges to progressive state governments. So the state of California wanted to be prepared. It has hired Eric Holder, President Barack Obama’s former attorney general, to represent its interests against Trump. This decision offers hope that liberal state governments can be a crucial ally in legal fights against the new Republican administration, just as conservative states frequently created legal problems for Obama. The hitch is that the effectiveness of this approach will be constrained by Senate Majority Leader Mitch McConnell’s successful blockade of the federal courts at the end of the Obama administration.

During the Obama years, attorneys general in red states played a major role in mounting legal challenges to his agenda. Many states were involved in the seemingly endless volley of legal challenges against the Affordable Care Act, for example. States were equally aggressive about challenging the Obama administration’s environmental regulations. Just last week, Georgia Attorney General Chris Carr announced he was joining the roughly two dozen state governments challenging the Clean Power Plan, describing it as “unlawful federal overreach.”

Not all of these challenges were ultimately successful—miraculously, core tenets of Obamacare survived. But some have been or will be. More than 20 state governments challenged the Obama administration’s package of critical executive actions on immigration, succeeding in getting it stopped when an eight-member Supreme Court deadlocked on a lower court ruling preventing it from going into effect. Twenty-one states sued to block the Obama administration’s new rules on overtime pay, which were also blocked by a federal judge. This will make it easier for Trump and his fiercely anti–minimum wage nominee for secretary of labor to reverse them.

It is crucial for blue states to try to play a similar role in the age of Trump. The new president is, to put it mildly, not likely to take constitutional restraints seriously, and it’s abundantly clear that he will not be meaningfully checked by a Republican Congress. State governments will be one of the most important lines of defense against the Trump administration.

This isn’t to say, however, that blue states will face an easy ride. One advantage that conservative states had in challenging Obama is that Republicans had the median vote at the Supreme Court, and, for much of the Obama administration, controlled some crucial federal circuit courts as well. Supreme Court Justice Anthony Kennedy is not an orthodox Republican Party-liner, but he’s still more likely to be convinced by conservative legal challenges than liberal ones.

This judicial context underscores the importance of a story that was not mentioned enough during the presidential campaign: McConnell’s unprecedented success in keeping Antonin Scalia’s vacated Supreme Court seat open for Trump, even though Scalia died nearly a full year before Obama was set to leave office. Obama’s nominee, Merrick Garland, is hardly a liberal dream appointment, but had the norms of most of American history prevailed and Garland been confirmed as the median vote on the Court, the judiciary would be a much more substantial check on potential constitutional overreach by Trump. Trump replacing Scalia won’t immediately transform the Court—Kennedy, in that case, would remain the median—but if Trump can replace Kennedy, Ruth Bader Ginsburg, or Stephen Breyer, the Court would be more Trump’s active collaborator than skeptical check.

It’s not just the Supreme Court, either. McConnell also shut down circuit court appointments after taking over as Senate majority leader in 2015, and partially as a result, Trump will inherit more than 100 federal judicial vacancies that he is likely to fill aggressively with reliable conservatives. So while federal appellate courts now, at long last, have a liberal tilt, this is likely to change quickly. Those challenging Trump may find it difficult to find a sympathetic judicial audience.

Does this mean that challenges are therefore futile? Absolutely not. Challenges to Trump by blue states still present real opportunities.

First of all, judges aren’t legislators. While judicial votes in politically salient cases are fairly predictable, they’re not perfectly so. Several very conservative judgesincluding, most consequentially, Chief Justice John Roberts of the Supreme Courtultimately rejected the argument that the Affordable Care Act was unconstitutional in its entirety. And this can cut the other way. It’s possible that Trump might overreach in ways that even otherwise conservative judges find intolerable. Anthony Kennedy, one of the last genteel moderate Republicans left standing, might not be strongly inclined to uphold Trump’s envelope-pushing.

In addition, legal challenges might have political effects even if they aren’t ultimately successful. The political effects of the challenges to the ACA cannot be precisely determined. But it seems likely that the constant drumbeat of high-profile legal challenges to Obama’s signature domestic initiative was a contributing factor in making “Obamacare” unpopular, even though—as Republicans are finding out to their political chagrin—most of its individual provisions are popular. Legal challenges by states like California can contribute to the justified perception that Trump, an instantly unpopular president who decisively lost the popular vote despite the FBI and very possibly Russia intervening against his opponent, is not a legitimate occupant of the White House even if he’s legally entitled to it.

The overriding goal of the Democratic Party in the next four years must be to make Trump as unpopular as possible. The less popular he is, the more likely that his legislative initiatives fail and the harder it will be for Republicans at all levels to win elections. Legal challenges can contribute to this effort. And there’s the additional potential for a virtuous circle here. The greater the perception of Trump’s illegitimacy, the more likely the courts are to give a fair hearing to challenges against him.