San Francisco has just unanimously voted to ban the sale of polystyrene products - also commonly called styrofoam - by 2017.

Polystyrene is the petroleum-based plastic foam that's used to make coffee cups, packaging peanuts, and a whole range of other disposable items. And though cities have begun cracking down on its use, this is the most extensive ban placed on the material in the US to date.

Although polystyrene is often better known to many people as styrofoam, that's actually just a trademarked brand name that only refers to the polystyrene foam used for thermal insulation and craft applications - not the polystyrene we use on a daily basis.

And to be clear, styrofoam insulation products won't be covered by these new rules, but they will ban the sale of all polystyrene food packaging, packing peanuts, take-away containers, coffee cups, foam dock floatings, mooring buoys, and pool toys as of 1 January 2017.

By 1 July 2017, it'll also be illegal to sell polystyrene fish and meat trays - like the ones you currently see in supermarkets. So it's a legitimate step towards San Francisco's goal of being a waste-free city by 2020.

It's been a long time coming, too. San Francisco first banned polystyrene take-away containers in 2007, due to environmental concerns. The plastic foam one of the most commonly used packing products, and 25 billion polystyrene cups are thrown out each year in the US alone.

Although the material is fairly soft, it's incredibly slow to break down in landfill, which means it'll be sitting there, leaching potentially harmful chemicals into waterways, for millennia to come. And there are also concerns that the material could impact human health by containing hormone-disrupting chemicals.

When polystyrene winds up in the ocean - which often happens to the 86 percent of disposable plastic that isn't recycled - it breaks down too quickly, and becomes microplastic that gets distributed through the water column, where it can be ingested by marine organisms, and concentrate toxins up the food chain.

Since San Francisco's initial 2007 ruling, more than 100 cities, including Washington DC, have similar rules banning polystyrene take-away containers in effect. But this new ordinance, which was unanimously voted in on 28 June, is by far the most extreme legislation in the country so far.

New York temporarily banned polystyrene products last year, but quickly overturned the ruling in favour of a plan to see the products recycled instead, after the ban was called "neither environmentally effective or economically feasible".

But not everyone thinks San Francisco's decision is a good one. The American Chemistry Council, which is a trade group for chemical makers, has spoken out, claiming that polystyrene is actually more environmentally friendly than some biodegradable options, seeing as its light weight produces less carbon emissions during transportation.

"All packaging leaves an environmental footprint," Tim Shestek, the council's senior director, said in a statement, as Mother Jones reports.

"Compostables are not the silver bullet," said Samantha Sommer, a project manager with Clean Water Action California, adding that single-use products in any form need to be banned. Even biodegradables "come from resources; it takes resources to produce, it produces energy and water emissions throughout its life cycle, and then becomes difficult to manage".

But polystyrene is one of the most prevalent and long-lasting of all the materials we use today, and banning it from one major city is still a huge step forward.

And while we're waiting for other cities and countries to do the same, researchers have found worms that eat polystyrene. We're pretty excited about the prospect of cleaning up our planet.