The San Francisco Board of Supervisors this week unanimously passed legislation to require all new commercial or residential buildings with 10 or fewer stories to have solar panels.

The Better Roofs ordinance was penned by Supervisor Scott Wiener, who said the measure was needed to fight climate change and reduce reliance on fossil fuels.

Creative Commons Lic. Photovoltaic (foreground) and Solar water heating (rear) panels located on rooftops in Berkeley, Calif. The low tilt of the photovoltaic panels is optimized for summer; the high tilt of the water heating panels is optimized for winter.

"Activating underutilized roof space is a smart and efficient way to promote the use of solar energy and improve our environment," Wiener said in a statement about the vote. "We need to continue to pursue aggressive renewable energy policies to ensure a sustainable future for our city and our region."

A federal study released earlier this month revealed that installing solar panels on every roof in the U.S. would supply 39% of the nation's total power used.

While the U.S. Energy Information Administration doesn't normally track legislation, a spokesperson for the agency said he was unaware of any other states with laws requiring solar on rooftops. Additionally, the Database of State Incentives for Renewable Energy, a compilation of mostly state-level and significant local-level rules and regulations, had no record of laws requiring all commercial and residential buildings to have solar. That makes San Francisco the first city in the nation to implement such an ordinance.

San Francisco's new law, however, does follow a state law: California's Title 24 Energy Standards, which requires 15% of roof area on new small and mid-sized buildings to be "solar ready." That requires the roof to be unshaded by the proposed building itself, and free of obtrusions. The state law also applies to all new residential and commercial buildings of 10 floors or less.

"This legislation will expand our efforts to cover San Francisco rooftops with solar panels and tackle climate change, while also creating good jobs for our community," said Josh Arce, former President of the San Francisco Commission on the Environment and community liaison for Laborers Local 261, a labor organization that trains solar job seekers.