In this Nov. 17, 2016, file photo, House Minority Leader Nancy Pelosi of Calif. speaks on Capitol Hill in Washington. Pelosi faces a challenge to her job as frustrated House Democrats meet to select a new slate of leaders. Pelosi is likely to be re-elected easily Nov. 30 despite disenchantment among the Democratic caucus she has led since 2002. Photo: AP Photo/Andrew Harnik

In this Nov. 17, 2016, file photo, House Minority Leader Nancy Pelosi of Calif. speaks on Capitol Hill in Washington. Pelosi faces a challenge to her job as frustrated House Democrats meet to select a new slate of leaders. Pelosi is likely to be re-elected easily Nov. 30 despite disenchantment among the Democratic caucus she has led since 2002. Photo: AP Photo/Andrew Harnik

As a Congresswoman from San Francisco, Nancy Pelosi has been a powerhouse in Democratic politics for three decades. Having served once as Speaker of the House the last time Democrats controlled the House of Representatives, Pelosi is positioned to reclaim that spot if the expected blue wave occurs this fall.

So it’s not surprising that Republicans are raising the specter of Speaker Pelosi to energize their base. She’s become a feature in a third of GOP House commercials. The effort relies upon more than a whiff of homophobia and sexism, as well as a genuine fear of Pelosi’s legislative prowess.

The GOP has been hammering Pelosi for years with a handy phrase: “San Francisco values.” (The phrase itself has been kicking around since 1984.) Exactly what those values are often goes unstated, leaving it to the fevered mind of the GOP voter to fill in the blanks.

But for the older Republican voters, San Francisco values doesn’t mean banning smoking in public places or being the first major U.S. city to have a $15 minimum wage. When they think of San Francisco, they think of LGBTQ people run amok.

The fact that practically every urban center in the U.S. is now friendly to LGBTQ citizens will never erase the idea of San Francisco as the nation’s gay mecca. For Republican voters stuck in the past, that’s especially true. San Francisco is ground zero of the culture war.

Of course, Republican candidates nowadays are generally careful not to use their out-loud voices when they pander to their base. But Pelosi herself has called them out years ago on what they clearly imply.

“In San Francisco we respect the dignity and worth of every person and respect is the order of the day there,” Pelosi said in a statement to the Huffington Post. “So when they sort of use their winks and nods about San Francisco values, they are talking about the fact that we respect our gay, lesbian, bisexual and transgender community.”

Pelosi said that the phrase was used to distract voters from environmental and economic issues. “The Republicans are bankrupt,” she concluded. “They have no ideas about the future, they are agents for the status quo, thank god there are a few of them that vote with us on the issues.”

In the intervening decade, the GOP has tilted even further to the right, with fewer Republicans willing to vote in favor of LGBTQ rights. In a way, that makes it easier for Republicans to double down on the hackneyed “San Francisco values” argument.

Which they are still using. The Republican party in California is relying heavily on that message in key Congressional races in that state.

In a special election for a Georgia Congressional seat earlier last year, Republican Karen Handel ran an ad shot in San Francisco in which varied SF stereotypes declared their love for Democratic opponent Jon Ossoff. Handel won, but just barely in a district that hasn’t sent a Democrat to Congress since the 1970s.

Sexism plays a role in the attacks on Pelosi too.“I think they need to get a new game book,”Rep. Joseph Crowley, head of the House Democratic caucus, said last March. “The attempts to use Nancy Pelosi, it’s failing them at this point. And I think, quite frankly, it’s sexist.”

Certainly, critics like to attack Pelosi in ways that they never would a man. White House spokeswoman Sarah Sanders said that Pelosi, who sat stonefaced through the State of the Union address, “should smile a lot more often.”

Attacks on her looks are so commonplace that Republican Rep. Ileana Ros-Lehtinen was able to use them to roast Pelosi at Washington Press Club Foundation’s annual Congressional Dinner last March.

“Let’s be serious – it’s tough to win legislation in Congress,” Ros-Lehtinen said began. “Many times, the process is as frozen as Nancy Pelosi’s face. I’m kidding, But sometimes her happy and her angry face, they’re pretty similar.”

Other comments are far less subtle. “No woman in the history of politics has used her womb like Nancy Pelosi. … [Pelosi] could breastfeed on the speaker’s podium and receive the plaudits of the mainstream media,” Ben Shapiro, who went on to become an editor at Breitbart News, wrote in 2007.

If this sounds like a replay of the Hillary Clinton attacks, it should. They also include insinuations that Pelosi is losing her mental abilities.

But perhaps the biggest reason making Pelosi a Republican target is that she’s very, very effective. She steered the passage of Obamacare through Congress when there was no margin for error. Brookings Institution scholar Thomas Mann has called her the “strongest and most effective speaker of modern times.” Even as the minority leader, she’s been effective at foiling some Republican plans.

Panic is second nature to Democrats, so some of them are fretting that the attacks on Pelosi will harm them in the fall. More to the point, younger Democrats are upset that the party’s leadership is, to be blunt, old. Pelosi is 78 and shows no signs of stepping aside, preventing other ambitious politicians from moving up, and just as importantly, having the party leadership reflect the future of the party.

Ultimately, from an attack ad perspective, it doesn’t matter who leads the Democrats in the House. Pelosi could be replaced by a box of rocks, and the GOP would find a way to connect the rocks to ISIS and transgender people who use the bathroom. The last Democrat to be Speaker before Pelosi, Tom Foley, was from Spokane and was still subject to a whispering campaign that he was gay.

Republicans are trying to change the subject for the forthcoming elections, in hopes of staving off a rout. But in doing so, they keep returning to the same old culture war issues from decades ago. November will tell whether how effective those scare tactics will prove.