The idea, nutritionists say, is to put healthy food choices in front of students.

New federal rules about what can be sold as “snacks” — mostly what’s in vending machines or sold by clubs to raise money — will take high-fat, sugar-laden foods off school grounds.

The new national standard was announced this week, and will take effect in the fall of 2014.

Officials say Maine already has tough rules for sales of food on school grounds.

“For the most part, we saw what was coming down the road,” said Ron Adams, director of food services for Portland, the largest school district in Maine. Portland’s rules, adopted two years ago, are among the toughest in the state, he said.

At the time, Portland was among 17 Maine school districts that were recognized for adopting food policies in line with the U.S. Department of Agriculture’s HealthierUS School Challenge.

So far, most students have been fine with the changes, officials said.

“We’ve had some pushback” from students after certain snacks disappeared from vending machines and healthier foods appeared, Adams said. “We put some things in the vending machines and they don’t move and it’s just, well, I guess they don’t like that.”

But Portland is a “foodie town,” he noted, and students frequently reflect the healthier, more adventurous palates of their parents.

“It should be common sense,” said Packard, whose oldest grandchild attends Westbrook Middle School, where vending machines contain Pop-Tarts and Rice Krispies Treats. “If you give them better options, they’re going to make better choices.”

Students will still be able to buy ice cream, but it will be low-fat. There can be cookies, but they will have to have a certain nutritional value.

The state and federal rules do not apply to any food a child brings to school from home. And the rules cover only sales, so they don’t apply to foods brought in for, say, a child’s birthday celebration.

But many school districts have their own rules about that.

Portland has a “50-50″ rule, so any foods that don’t meet the standard are balanced with an equal amount of healthy options. For example, an outdoor fair to end the school year at one Portland elementary school had a dessert table, with plenty of watermelon slices available.

The new federal rules have standards for portion control and caffeine that differ by age group; only students in high school will be allowed to have drinks that contain caffeine.

Maine’s rules are tougher because they apply on school grounds at all times; the federal rules will apply only during the school day, and won’t apply to after-school sports or other activities.

“Maine really started to address this issue several years ago, so it’s really that the federal government is catching up to what we’re already doing in Maine,” Adams said.

Maine’s current standards forbid sales of foods that are considered “of minimal nutritional value.”

A food’s value is determined by calculating the percentage of certain nutrients provided. Prohibited foods would include lollipops, marshmallow candies, licorice and candy-coated popcorn.

School districts may make certain exceptions, so the effect of the new federal rules will vary across the state, depending on how strict the local rules are now. Schools could stipulate, for example, that the rules apply to students, but not the staff, or to the public if an event is held at the school.

Portland says the rules apply to the staff and at school-sponsored events on and off campus.

In Cape Elizabeth, food and drink that doesn’t meet the standards can be sold to the school staff — for example, in a vending machine in the teachers’ lounge — and to members of the public who attend school-sponsored events on school property.

Lewiston, another major school district in the state, prohibits candy sales by any school or school-sponsored group. That means booster clubs can’t sell candy.

It allows sales in staff vending machines and to the public at community events held on school property.

“A lot of the schools have seen this coming,” said Walter Beesley of the state Department of Education, who works with districts on meeting nutrition standards. “But it’s going to be a change for some.”

Each district posts nutrition guidelines on its website, listing the rules on snack sales under what’s called “competitive food” policies.

“I think it’s going to be a good standard for the schools,” Beesley said. “The goal is to have healthier schools.”

Noel K. Gallagher can be contacted at 791-6387 or at: [email protected]