Doughnuts are out, whole-wheat muffins in, and Virginia’s General Assembly is fed up: It wants to bring back the old sugary school bake sale.

Federal guidelines that took effect this school year have banished sales of nutritionally dubious treats to students during school hours. Anything sold while school is in session must meet the same nutritional guidelines as school lunch and breakfast.

That might be good for the fight against childhood obesity, but it has taken a big bite out of bake-sale proceeds at schools such as Brooke Point High School in Stafford County, where reduced-sugar, whole-grain muffins aren’t exactly selling like the glazed honey buns they replaced on the snack menu.

“Previously, we were allowed to sell whatever we wanted,” said Anne Jacobsen, a parent volunteer. “Since we’ve gone to the ‘smart snacks,’ sales have dropped by more than half. The kids just don’t want it.”

Never fans of new federal regulations, Virginia’s Republican-controlled legislature is trying to come to the rescue with a bill that has cleared both chambers granting schools exceptions to the rules.

The measure flew through the House without controversy, but in the Senate, it inspired one of this year’s more animated debates, pitting those concerned about childhood obesity against lawmakers wary of government overreach.

Senate Minority Leader Richard L. Saslaw (D-Fairfax) warned colleagues not to vote for the bill “unless you believe America’s just not fat enough.”

Sen. Charles W. “Bill” Carrico Sr. (R-Grayson), on the other hand, said he managed to survive the cinnamon rolls his mother, Alba Carrico, used to bake in the cafeteria of Marion Middle School in Smyth County in far Southwest Virginia.

“Every time someone talks about school lunches, I think of these cinnamon rolls my mom used to make that were to die for, and she’s still making them for me today,” Carrico, 53, said in an interview after the debate. “Now it would be the kiss of death to eat a cinnamon roll. . . . I’ll bet you if I brought those pans of cinnamon rolls into the Senate, I wouldn’t take the pans out full again.”

Washington is not entirely the party pooper on this one.

Regulations adopted for this school year under the Healthy, Hunger-Free Kids Act of 2010 allow for exceptions. But the Virginia Board of Education has opted not to make any exceptions, as House Speaker William J. Howell (R-Stafford) learned after hearing from Jacobsen, who is one of his constituents.

“I guess federal legislation came down that said, ‘You can’t do these kinds of things,’ ” Howell said. “They did provide for waivers for this ban. I called the state Board of Education and they said, ‘We’re not doing any waiver.’ ”

So Howell asked Del. Richard P. “Dickie” Bell (R-Staunton) to introduce a bill that would direct the board to make some exceptions. Howell and Bell said the bill seeks to strike a balance between school nutrition and the occasional treat that also serves a fundraising purpose.

“Everyone’s in favor of the kids eating healthy,” Bell said. But he said the new rules “pretty much did away with the bake sale-type fundraising that many kids relied on to pay for their band uniforms and field trips for students. Everybody found that money to be useful.”

The measure sailed through the House, 94 to 3. The Senate amended it before passing it by a far narrower vote of 20 to 17. The bill remains in limbo until the chambers can agree on how many days the sinful snacks would be sold.

The version that passed the House would allow each school up to 12 food-sale fundraisers a year, each of which could last up to five consecutive days. That would add up to a maximum of 60 school days — one third of the 180-day school calendar.

The Senate amended that bill to make the standards looser. It would allow 30 fund-raisers of unlimited duration. The differences are expected to be worked out in a conference committee.

Assuming the bill emerges, it goes to the desk of Gov. Terry McAuliffe (D). His wife, Dorothy McAuliffe, has followed the lead of first lady Michelle Obama, devoting much of her time as first lady to the cause of childhood nutrition in general and school meals in particular.

McAuliffe spokesman Brian Coy said the governor has been working with the General Assembly on the bill. He declined to say whether McAuliffe would sign either of the versions that are in play.

“The governor and the first lady are committed to making sure Virginia children get access to healthy and nutritious food so they can reach their full potential at school,” Coy said.

While Republicans were largely for the bill, the debate did not fall neatly along partisan lines. Sen. Jill Holtzman Vogel (R-Fauquier) spoke against it, noting how much her own children gravitate toward unhealthful foods when given the chance. And with Democrats mostly against the measure, Sen. J. Chapman Petersen (D-Fairfax) said he supported it because bake sales should be left to the discretion of local school boards.

Sen. Adam P. Ebbin (D-Alexandria) might find Alba Carrico’s cinnamon rolls tempting, but he thinks that’s a good reason to keep them out of reach of children.

“I probably shouldn’t speak as someone who eats doughnuts,” he said, “but I think it undermines the general philosophy of providing kids with healthy foods if there’s all kinds of exceptions to what’s in a school on a regular basis. . . . And I hope there would be other ways to make money besides making kids unhealthy.”