There were no partisan elections in California Tuesday, but the state’s Democrats won big.

Democratic wins in the New Jersey and Virginia governors’ races, along with a surge of victories in down-ballot contests across the country, have party leaders gleeful about their chances in the 2018 midterm elections, including seven targeted congressional races in California.

“Americans voted their values by electing Democrats in Virginia, New Jersey and across the country,” Tom Perez, chairman of the Democratic National Committee, said in a statement Tuesday. “Tonight’s success is just the beginning.”

But while having Ralph Northam as Virginia’s new governor-elect might not mean much to Democrats in California, the way he got there does, said Thad Kousser, a political science professor at UC San Diego.

“This is the best election news Democrats have had in at least a year,” he said. “New Jersey and Virginia look a lot like the targeted California congressional districts: purple states and purple districts.”

In California, those targeted districts are all trending Democratic in voter registration, even those that still hold a solid, but thinning, GOP edge. In the 21st Congressional District of Rep. David Valadao, R-Hanford (Kings County), Democrats have 46 percent of the registered voters, compared with 29 percent for Republicans, a sign that Valadao’s personal popularity may be all that is keeping the district in the GOP column.

Rep. Jeff Denham, R-Turlock (Stanislaus County), and Rep. Steve Knight, R-Lancaster (Los Angeles County), each have a district where Democrats outnumber Republicans, making them vulnerable to that type of heavy Democratic turnout seen Tuesday.

In Virginia and elsewhere, Democrats turned out in surprisingly large numbers, shocking not only Republicans but Democratic Party leaders as well.

Mike Madrid, a California GOP consultant, says people he has talked to said Republican Ed Gillespie hit the vote number he expected in Virginia, but Democratic turnout pushed Northam to his 54-to-45 percent victory in what was widely expected to be a tight contest.

“There are three ways for Democrats to take over Republican-held seats,” like those in California, he said. “Republicans have to stay home, Republicans have to defect to Democratic candidates, or there has to be a higher turnout for low-propensity Democratic voters, like young voters, Latinos and blacks.

“Until Tuesday, there was no evidence that was happening,” Madrid said.

With Democrats desperate to break the Republican stranglehold on the national government, they believe the road to taking back the House runs through California, especially through seven GOP-held seats in districts where Democrat Hillary Clinton beat Donald Trump in 2016.

While the Republicans in those districts — two in the Central Valley and five in Southern California — may not be as vulnerable as Democratic leaders would like to believe, Madrid said, Tuesday’s vote should make those GOP candidates nervous.

“There’s a perfect storm gathering,” he said. “If two of those conditions for Democrats to win are apparent, there should be consternation (among Republicans). If there are three, it’s time to panic.”

Tuesday, though, was only one night, and the 2018 midterms are still a year away. And while euphoric Democrats and their supporters are telling one and all that Tuesday’s victories were inevitable given Trump’s unpopularity, as late as Tuesday morning their party leaders were pointing fingers and preparing for what polls suggested could be a devastating loss in Virginia.

“The death of the Republican Party will be widely exaggerated in the next few days,” Kousser said.

Republicans already are dismissing the impact of the Democratic wins.

Trump was quick to step away from the GOP debacle in Virginia, saying in a tweet Tuesday night that “Ed Gillespie worked hard but did not embrace me or what I stand for,” adding that “with the economy doing record numbers, we will continue to win, even bigger than before!”

But exit polls conducted by Edison Media Research in Virginia show Trump was front and center in voters’ minds. Fifty-seven percent of those who voted disapproved of the way Trump is handling his job as president, and 87 percent of them voted for Northam.

While 34 percent of the voters said the main reason they cast their ballot was to express opposition to Trump, only 17 percent said their vote was to boost the president.

Women, who typically make up the majority of voters in California, supported the Democrats, 61 to 38 percent, in the Virginia governor’s race. That’s even wider than the 17-percentage-point margin they gave Clinton over Trump last November.

Those numbers may give congressional Republicans in California a reason to pull away from the president, Kousser said.

Those seven incumbents will probably keep an amicable distance from Trump, “not disown him, but not endorse him and all his plans, either,” he said. “They will want to look like California Republicans, not Trump Republicans.”

It’s already happening. On Tuesday, for example, GOP Rep. Darrell Issa, R-Vista (San Diego County), became the first California Republican congressman to say he won’t vote for the president’s tax bill, now making its way through Congress.

“I think we can do better than this,” said Issa, a veteran congressman who clung to his seat by less than 1 percent of the vote in the 2016 election. “Many, many people in my district are going to see a tax increase.”

Issa is unlikely to be the last targeted congressman to challenge the president on California-friendly issues like immigration, health care and tax policy, Madrid said.

“In politics, someone is invulnerable only until they aren’t,” and Tuesday’s elections provided real evidence that Trump is anything but bulletproof, he said. “You’d have to be asleep not to see that something shifted Tuesday night. There’s value now in opposing the president.”

John Wildermuth is a San Francisco Chronicle staff writer. Email: jwildermuth@sfchronicle.com Twitter: @jfwildermuth