Kyle Graden was still in college when Salesforce chief executive Marc Benioff led a coalition of companies on a public crusade against a 2014 anti-LGBT Arizona law — and won.

It was a revelation to Graden, a transgender person from Indiana who identifies as pansexual and gender-nonconforming and prefers to be called “they” rather than “he” or “she.”

Graden had never before considered the possibility of not just feeling safe at work but of feeling welcome and understood. Watching Benioff stand up to Arizona changed that.

More than ever before, corporations like Salesforce are taking strong stances on social issues that 20 years ago would have been out of the question for national name brands. The effort, spearheaded by Bay Area businesses and tech firms, has picked up speed in recent months thanks to recently passed laws in Mississippi and North Carolina — widely considered to be hostile toward lesbian, gay, bisexual and transgender people — which have set off an avalanche of media attention and public condemnation.

More laws in works

Today, Graden works for Salesforce in product marketing and is president of Outforce, the company’s employee resource group for lesbian, gay, bisexual and transgender workers and their allies. And every time Benioff speaks out against anti-LGBT legislation or rallies other business leaders to do the same, Graden feels a pang of pride.

“I know my company supports me, my colleagues support me, and I don’t have to hide who I am anymore,” said Graden, 23. “That’s a big deal for me. I had to hide for a long time.”

Tech giants like Salesforce who have committed to fighting anti-LGBT legislation, experts said, may soon end up taking on nearly half the country. Similar laws are being considered in 19 other states.

Experts say it’s unlikely they’ll back away from the fight, though. Leaning on states to block these measures isn’t just an affirmation of the companies’ values — it also makes good business sense.

“Companies are realizing that to create consumer demand they need to be a part of our collective community and address the issues that their customers are dealing with,” said Derrick Feldmann, author and researcher for the Millennial Impact project. “They’re also seeing an increase in employees who say to their employers, ‘Hey, these issues are important to me.’”

In the past, taking stands on social issues and effecting change was something done by local businesses that were ingrained in their communities. They might donate to local nonprofits as a quiet show of support, or make it clear they welcomed certain groups as customers. Experts who track the behavior of businesses say the attitudes of national corporations changed about 2008, during the recession — in what they describe as a tipping point.

“That was a period of time when many people began to feel like we’d gotten off balance as a country with the power of big business,” said Lisa Manley, executive vice president at cause marketing agency Cone Communications. “People began to feel like these businesses have a voice and ought to use that voice for something beyond the marketplace.”

Standing for higher causes

Another big factor was social media. Twitter, which launched in 2006, gave consumers a way to organize and air grievances. By 2008 it had become clear, Manley said, customers expected companies to do more than deliver a product and turn a profit.

Millennials, generally defined as those who born between 1980 and 2000, want their employers and the businesses they patronize to stand for something greater.

Several issues, experts said, have risen to the top of American corporate consciousness: the environment, social justice and LGBT rights.

LGBT groups have long relied on corporate partners, but in 2008 — the same year that Proposition 8 temporarily banned same-sex marriages in California — something changed.

Companies began wading into the fight for LGBT rights in unprecedented numbers, according to the Human Rights Campaign. This support reached critical mass in 2014 as the U.S. Supreme Court considered — and ultimately legalized — same-sex marriage.

“This is not a new conversation for businesses to be having, and once they’re there ... it becomes expected and natural for a business to stand by that as time passes,” said Beck Bailey, deputy director of employee engagement in the Human Rights Campaign’s workplace equality program.

As the treatment of LGBT people re-emerges as a national flash point with state legislators proposing laws that take aim at same-sex couples and transgender restroom use, among other issues, companies are ready to go.

Mississippi and North Carolina have been thrust under the national spotlight since Georgia Gov. Nathan Deal vetoed a similar piece of legislation last month that would have allowed organizations and individuals the right to deny employment, services or use of facilities to others based on religious belief or practices.

Deal’s decision came after days of threats from companies such as Salesforce and Netflix, which said if Georgia enacted the legislation they would move their operations and workers out of the state. There was also the threat that the National Football League would not bring a Super Bowl to Atlanta.

“When people look at the tech industry, they see innovators and leaders, and when it comes to issues like this, the spotlight is definitely on us,” said Gino Ramos, 34, an operations manager in Salesforce’s corporate affairs division and founder of the Outforce group. “Being from the Bay Area, you understand that people aren’t all the same and it’s important to make sure that equality for all really is the law of the land.”

Relocating operations

This month PayPal made headlines when it told North Carolina it would relocate more than 400 jobs and cancel a multimillion-dollar global operations center over the new law, which made it illegal for cities in the state to extend nondiscrimination protections to encompass LGBT people and voided a Charlotte ordinance that would have allowed transgender people to use public restrooms based on their gender identity rather than their biological sex.

Last week, an unnamed tech company that was considering moving 1,000 jobs to Wake County, N.C., also scrapped the deal, according to the Greater Raleigh Chamber of Commerce. The week before, hundreds of executives from the Certified B ethical corporations group canceled its annual event that was expected to contribute $1 million to North Carolina’s economy. More than 100 business leaders and chief executives signed onto an open letter drafted by the Human Rights Campaign urging North Carolina to repeal the statute.

More than 80 have signed a similar notice to Mississippi Gov. Phil Bryant, who approved legislation this month that allows public employees, schools, hospitals, shelters, faith-based organizations and businesses to refuse service to LGBT people and families. The Mississippi bill also allows these organizations to refuse to acknowledge the gender identities of transgender people.

The issue, Manley said, is multifold for businesses: They want to appear progressive and forward-thinking to an increasingly youthful customer base and also demonstrate to their employees that they’ve got their backs.

In notoriously competitive industries like tech, this can make the difference between losing and retaining talented workers who won’t tolerate discrimination or work in states where they feel targeted, experts said.

When PayPal CEO Dan Schulman announced that his company would no longer be opening its center in North Carolina, he called it “the right thing to do for our employees, our customers and our communities.”

States taking notice

Knowing that companies are willing to put their money where their mouth is has already had an impact beyond the states where companies have concentrated their efforts.

In March, South Dakota Gov. Dennis Daugaard vetoed HB1008, a law that would have forced all children in the state to use the restroom that corresponded with the sex they were assigned at birth. Tennessee pulled a similar bill last week in order to further study how the issue plays out in other states before it decides to proceed.

In Wyoming, which for two years running has failed to pass bills that would have protected people who refuse to accept same-sex marriage, a legislator recently cited fears that passing such a bill would harm the state’s tourism industry.

Last year, Salesforce led more than a dozen business conferences to pull out of Indiana in the wake of the state’s newly passed religious freedom law that would have allowed businesses to discriminate against LGBT customers and employees. Weeks later, Indiana amended its law to clarify that the law would not sanction discrimination.

A study released this year found that Indianapolis lost at least $60 million in business because of the boycotts.

“If you’re contributing negatively to this community, that’s a nonstarter for me — I’m more apt to bring my business to a person or a place or a company that is out there proactively trying to help the LGBT community,” Graden said. “Visibility today is so important because when you’re young and you live in a place where you don’t have advocates or role models, it means so much to see companies and powerful business leaders stand up and say you matter.”

Marissa Lang is a San Francisco Chronicle staff writer. Email: mlang@sfchronicle.com Twitter: @Marissa_Jae