California took a major step Wednesday toward becoming the first state to require solar panels on nearly all new homes, the latest sign of how renewable energy is gaining ground in the U.S.

The California Energy Commission voted 5-0 to approve a mandate that residential buildings up to three stories high, including single-family homes and condos, be built with solar installations starting in 2020.

The commission estimates that the move, along with other energy-efficiency requirements, would add $9,500 to the average cost of building a home in California. The state is already one of the most expensive housing markets in the country, with a median price of nearly $565,000 for a single-family home, according to the California Association of Realtors.

Still, the change appears to have broad support from home builders as well as California leaders and solar advocates.

Nationally, solar power makes up less than 2% of U.S. electricity output, according to the U.S. Energy Information Administration. But it is rising because of large solar farms as well as rooftop solar arrays on homes and businesses.