Solar system installer Thomas Bywater adjusts new solar panels on the roof of a house in Sydney, August 19, 2009. REUTERS/Tim Wimborne San Francisco may be known for its fog, but the city wants to turn the sunny days it does get into power for its buildings.

The San Francisco Board of Supervisors on Tuesday unanimously passed legislation that would require new construction that is shorter than 10 floors to install solar panels or solar water heaters on top of both new residential and commercial buildings.

According to California law, all new buildings with 10 floors or less must have at least 15% of their rooftops designated as solar ready — meaning not in the shade. San Francisco now requires those buildings to actually use it for solar panels.

The new rules also make San Francisco the first major US city to mandate solar panels on new construction, although other California towns like Lancaster and Sebastopol have instituted similar laws.

“By increasing our use of solar power, San Francisco is once again leading the nation in the fight against climate change and the reduction of our reliance on fossil fuels,” said Supervisor Scott Wiener, who put forth the legislation, in a statement. “Activating underutilized roof space is a smart and efficient way to promote the use of solar energy and improve our environment."

The new rules don't go into effect until January 1, 2017, after which any construction that falls under the state law to include solar-ready space will have to actually install it.

If a developer isn't happy about adding in solar, Wiener has a backup plan. He's also introducing legislation that would allow people to add a living roof like a garden on top instead of the solar installation.