RICHMOND — The dreaded comeback of the coronavirus has convinced both major candidates for Virginia governor that victory this fall hinges on one simple but vexing question about masks and vaccinations:

To mandate, or not to mandate?

Democrat Terry McAuliffe favors requiring masks and shots in certain cases as a science-based path out of a public health and economic crisis. Republican Glenn Youngkin opposes any mandates as a matter of individual liberty and parental rights.

As the delta variant has recently powered Virginia’s seven-day average number of new cases to levels not seen since February, according to The Washington Post’s tracker, both candidates have moved those issues to the front of their campaigns — and with good reason, University of Mary Washington political scientist Stephen Farnsworth said.

“I think this election is likely to turn a great deal on what happens with covid,” Farnsworth said.

McAuliffe announced this past week that he’s requiring his campaign staff to be vaccinated. He also called on private health-care providers to require vaccination for their employees and supports outgoing Gov. Ralph Northam’s vaccine-or-testing mandate on state workers.

McAuliffe agrees with Northam (D) that state law requires schools to follow guidance from the federal Centers for Disease Control and Prevention, which calls for students and staff to wear masks inside school buildings, regardless of vaccination status. On Thursday, Northam officially made it a mandate.

Youngkin, meanwhile, has pushed back against any effort to require students to wear masks at schools, saying that decision should be left up to parents. When asked in a radio interview this month if he would follow the lead of Florida Gov. Ron DeSantis (R) and prohibit local school boards officials from requiring masks, he said he would, proclaiming that “there should be no mask mandates in Virginia.”

However, a Youngkin spokesman on Thursday said he would not go quite as far as DeSantis, claiming that as governor, Youngkin would leave the policy decision about masks up to local school districts and “strongly encourage” them to let individual parents decide.

The campaign in a statement also said Northam’s new mandate for masks in schools shows “Richmond liberals . . . will stop at nothing to impose their will and take away parents’ ability to decide what’s best for our kids.”

The statement further warned that the governor’s action was a precursor to “returning to a full shutdown of our economy” — though Northam cast the mandate as a step that would help prevent the need to shut things down by keeping cases low.

Both sides seem confident the issue will play well not only with their respective political bases, but with the suburban swing voters who will be crucial to winning increasingly blue Virginia.

Given that a Republican hasn’t won statewide in Virginia since 2009, though, Youngkin has the more difficult tightrope to walk. That makes some analysts question his stance on masks and vaccines, which mirrors that of Trump Republicans nationwide.

“It strikes me that Youngkin is doing all he can to try to activate the Trump-loyal base of the Republican Party as though that’s going to win a statewide election for him, and I find that puzzling,” said Mark Rozell, dean of the Schar School of Policy and Government at George Mason University.

National polling shows Americans are deeply polarized on the topic of mandates, and the partisan gap is widening. Comparing data from two Quinnipiac University polls conducted months apart, analyst Amy Walter noted in the Cook Political Report that Republicans have become far more opposed to vaccine mandates in businesses and universities while Democrats have become more supportive.

The picture was more nuanced among independents, a majority of whom still oppose vaccine mandates, but less fervently this month than in April, Walter noted. In the August Quinnipiac poll, 45 percent of independents support a vaccine mandate for university students and 51 percent oppose it — a net eight-point swing from April, when 42 percent supported such a mandate and 56 percent opposed.

She also noted that independents this month were considerably more worried about the delta variant than Republicans.

“I think both [campaigns] see a good opportunity to get their bases engaged on this issue,” Walter said in an interview. “At the same time, independent voters, their opinions are much more fluid. And I think part of that is because they do see that the delta variant is very serious.”

But finding the “sweet spot” that appeals to independents will be trickier than stoking up the base, Walter said, given that they see a danger in the delta variant and support mask mandates but are not as supportive as Democrats on vaccine mandates.

That muddled picture may help explain why Youngkin and McAuliffe both see advantages to hammering on mandate politics.

“I think it’s disgraceful Glenn Youngkin would be taking advice and guidance from Ron DeSantis,” McAuliffe said in an interview with The Post. He cited Florida’s current plight as one of the top states for infections and noted its nation-leading spike in children hospitalized with covid-19.

McAuliffe praised Northam’s handling of the pandemic in Virginia.

“I think he’s done a great job,” McAuliffe said. “I have always said we need to follow the CDC guidelines. . . . All the schools need to be open, but let’s do it in a safe way.”

But the former governor, who served from 2014 to 2018, stopped short of calling for broad mask or vaccine mandates across society.

“I encourage everyone to get vaccinated,” he said. “The unvaccinated are causing many of the problems that are existing today. . . . I want to see us have a thriving economy, but that’s not going to happen until we get everybody vaccinated.”

McAuliffe said the unvaccinated have “taken over all our intensive care units. It causes such a strain on our health-care system.” He accused Youngkin of being in a category with DeSantis, former president Donald Trump and Texas Sen. Ted Cruz (R) in playing down the severity of the crisis and the steps needed to address it.

“I am terrified listening to all the experts. . . . They’re very concerned there could be another mutant variant coming along after delta. There could be a covid that vaccines don’t work for,” he said.

Youngkin’s campaign declined to make him available for an interview. The first-time candidate and former Carlyle Group executive has not disputed the efficacy of masks or vaccines, unlike more extreme figures in the Virginia GOP.

State Sen. Amanda Chase (Chesterfield), for instance, has refused to wear a mask on the Senate floor and drew cheers at a rally for a Virginia Beach congressional candidate this month when she declared she would never get vaccinated. (Chase has endorsed Youngkin and introduced him at least one event since he bested her for the GOP gubernatorial nomination in May.)

“I got the vaccine. I thought it was the right thing to do, but that was a decision that I made,” Youngkin said in the Aug. 6 interview on “The John Fredericks Radio Show.” “And as governor, I would strongly recommend people get the vaccine. But it’s an individual decision for people to make. And this is the difference between the kind of governor I will be in Virginia and what Terry McAuliffe’s going to represent, because he’s just going to kowtow to the left, liberal, progressive agenda.”

Fredericks, who oversees a pro-Trump news site called the Virginia Star, praised DeSantis for threatening to withhold funding from Broward County Public Schools for imposing a local mask mandate.

“Would you, as governor of Virginia, do what DeSantis did and say, ‘No mask mandates in Virginia?’ ” Fredericks asked.

“Yeah, I believe there should be no mask mandates in Virginia,” Youngkin replied. “I think these are decisions that should be up to individuals.”

Youngkin tweeted a similar sentiment that same day, although he did not invoke DeSantis: “If parents, teachers, & children want to wear a mask then they can — but there should NOT be a schoolwide mask mandate.”

He sounded a little more indifferent Feb. 6, speaking to the Tidewater Libertarian Party, when he said of the vaccine: “You want it? Take it. If you don’t want it? Don’t take it. But here we have — we have the teachers union saying we can’t open schools. Well, give them the vaccine and get them back in school.”

Youngkin has criticized Virginia universities that have required students to be vaccinated, encouraging those who are opposed to claim exemptions offered by some campuses.

“I’m really frustrated with our universities across Virginia who are requiring the vaccine in order to come back to class,” he said in a speech on education policy June 11. “We should encourage anyone who does not want to get the vaccine for whatever reason . . . to fill out the exception form.”

Farnsworth, of Mary Washington, said Youngkin and McAuliffe are both taking predictable positions for their respective parties. But he cautioned that while voters are undoubtedly weary of pandemic restrictions, there’s a major difference between now and a year ago: the widely available vaccines.

Voters might not like being told what to do, he said, but “as hospitals once again fill with patients, there is a growing rage in this country about people who haven’t been vaccinated.”