Partisans of the Mission District’s famous Zeitgeist beer garden won a victory Thursday when the Planning Commission voted to shave 5 feet off a proposed condominium building that critics said would have blocked some of the precious sunshine that makes the bar’s backyard one of San Francisco’s most popular al fresco drinking spots.

The five-story, 28-unit condo development at 198 Valencia St., currently the site of an automobile oil changing shop, will probably cut the ceiling height in the ground floor retail space from 15 feet to 10 feet to conform to the commission’s decision. The commission also directed the developer to make the building’s rooftop parapet transparent, which will further reduce the shadows it casts.

While chopping 5 feet off of the building decreases the amount of shadow cast on Zeitgeist by just 2 percent over the course of a year, that 2 percent would have shaded about eight large picnic tables during the late afternoon and early evening hours, when the beer garden is at its busiest, according to Zeitgeist.

The bar does 65 percent of its business between 4:30 p.m. and 9 p.m., and sales go down 30 percent when the sun is not shining, according to Laura Burmeister, whose family owns the bar. She said the additional shadows would have “jeopardized the viability of our legacy business.”

“This directly overlapped with our peak sales hours, transforming it from a sunny garden to a non-sunny garden,” she said.

A letter from the 310 members of the San Francisco Bar Owners Alliance, read at the hearing, called Zeitgeist “one of the most important bars in San Francisco, hands down.” About a dozen employees and regulars spoke in favor of the shorter condo building. Several staff members said that the sunshine in the garden was the lifeblood of the establishment.

“When spring comes and the sun is shining that is when I make money and when all of us make our money,” said bartender Charles Hernandez.

Issac Camner, who has worked at the bar for 17 years, said, “Our yard is our livelihood.”

The vote was noteworthy because state environmental laws only require cities to analyze shadows cast on public spaces, like city parks, not private spaces, like beer gardens.

Project architect David Sternberg did not object to the changes, but did say that the transparent parapet would be more expensive and that the reduced ceiling height would make the retail spaces less attractive to tenants. The only person who spoke and voted against the changes was Planning Commissioner Christine Johnson.

“I don’t agree with creating substandard retail spaces in brand new developments,” she said.

But with dozens of newly built retail spaces sitting vacant in housing developments across the city, Commissioner Rich Hillis said the emphasis should be on providing relief to a longtime business, especially if the changes won’t jeopardize the residential project.

“I’d rather help Zeitgeist and existing businesses rather than a theoretical establishment that may be in the new building,” he said.

After the vote Zeitgeist manager Gideon Bush said he was happy with the compromise.

“We do want new neighbors across the street, we do want to see the neighborhood grow,” he said. “We always felt we could find a medium ground, and I think that is what happened today. We are not going to get shaded as much and the developers still get to build their building.”

Zeitgeist, which opened in 1977, was added to the city’s legacy business roster in October.

Land use attorney Sue Hestor, who helped write the 1984 “sunlight ordinance” that restricts buildings from casting shadows on public spaces, applauded the decision.

“The city should be looking for this kind of solution all the time — and they are not,” she said.

J.K. Dineen is a San Francisco Chronicle staff writer. Email: jdineen@sfchronicle.com Twitter: @sfjkdineen