01 pride flag capitol 061221

A version of this story first ran in July. It also appears in CNN’s What Matters newsletter. To get it in your inbox, sign up for free here.

CNN  — 

Let’s start with the positive: Republicans and Democrats are coming together to protect same-sex marriage from the Supreme Court. The Respect for Marriage Act, which safeguards the right to same-sex marriage nationwide, passed the House with bipartisan support earlier this week and now awaits a Senate vote.

The Respect for Marriage Act codifies marriages and came about amid worries among Democrats that the same conservative majority on the Supreme Court that took away the right to abortion will target same-sex marriage in the future.

The version that overcame a filibuster in the Senate passed the Senate Tuesday. A dozen Republican senators from across the country voted with Democrats before Thanksgiving to limit debate and move toward a final vote.

RELATED: Meet the 12 Republicans who voted to consider the Respect for Marriage Act

It next goes to the House for approval before President Joe Biden can sign it into law.

But there is a fair amount of fine print.

First, the bill does not require all states to allow same-sex marriage, even though that is the current reality under the 2015 Obergefell v. Hodges decision. Rather, if the Supreme Court overturned Obergefell and previous state prohibitions on same-sex marriage came back into effect, the Respect for Marriage Act would require states and the federal government to respect marriages conducted in places where it is legal.

There are religious exceptions. Republican supporters have emphasized the elements in this Senate version that protect nonprofit and religious organizations from having to provide support for same-sex marriages.

“I will be supporting the substitute amendment because it will ensure our religious freedoms are upheld and protected, one of the bedrocks of our democracy,” said West Virginia Sen. Shelley Moore Capito in a statement after helping break the filibuster.

It took months of behind-the-scenes effort to bring 10-plus Republicans on board.

This is all academic right now. The bill is only being passed in case the now-solidly conservative Supreme Court, which has taken delight in upending precedent, were to revisit the Obergefell v. Hodges decision that created a national right to marriage for same-sex couples.

Two of the justices who voted in favor of that ruling have been replaced by Republican-appointed conservatives, which means that if the case were heard today, there’s a real likelihood it would be decided differently.

While Justice Samuel Alito seemed to want to wall off the abortion rights precedent upended by the Supreme Court earlier this year, CNN’s Ariane de Vogue has written about how the decision in Dobbs v. Jackson Women’s Health Organization could affect issues like marriage. Read her story.

A complete 180 in Congress

Here’s a brief history of marriage equality playing a role in prior election years:

Today, it’s Republicans and Democrats, along with a Democratic president, working together to protect same-sex marriage from a government institution.

During that time, public support for same-sex marriage grew from about a quarter of the public in the year the Defense of Marriage Act was enacted to 71% in Gallup polling this year.

The issue has played a role in multiple US elections, including, arguably, the one that just took place.

Here’s a brief history of marriage equality playing a role in prior election years:

26 years ago, there was united opposition

In 1996, Republican majorities in the House and Senate sensed a political opening after then-President Bill Clinton failed to allow gay people to openly serve in the military.

They were also trying to get ahead of a Hawaii court decision that could have legalized same-sex marriage in that state. Fearing every state might have to recognize same-sex unions, Republicans pushed the Defense of Marriage Act, known as DOMA.

It declared marriage as between one man and one woman and allowed states to refuse to recognize marriages. It also withheld federal benefits from married same-sex couples. In 2013, a part of DOMA was found to be unconstitutional.

DOMA had broad approval. Democrats like then-Sen. Joe Biden voted for the bill. Current Senate Majority Leader Chuck Schumer, and many other Democrats whose names you’d recognize, were among the 342 who voted for the bill in the House.

Current House Speaker Nancy Pelosi was among the 67 members to vote “no,” along with Rep. Steve Gunderson, who at the time was the House’s only openly gay Republican.

18 years ago, Republicans used opposing gay marriage to their advantage

In 2004, placing anti-gay-marriage amendments on ballots in key states like Ohio was smart politics. It helped George W. Bush win reelection to the White House and the GOP gain seats in the US Senate.

Bush endorsed a constitutional amendment to ban same-sex marriage. The Democratic candidate, John Kerry, also opposed same-sex marriage at the time.

14 years ago, Democrat Barack Obama opposed gay marriage

In 2008, even as more in his party began to publicly support marriage equality, Obama continued his opposition.

He has more recently said and written that he always personally supported same-sex marriage rights. His campaign aide David Axelrod has written that Obama made a calculated decision to oppose gay marriage.

“He grudgingly accepted the counsel of more pragmatic folks like me, and modified his position to support civil unions rather than marriage, which he would term a ‘sacred union,’” Axelrod wrote in a memoir.

10 years ago, Obama made the political calculation to support gay marriage

In 2012, following the lead of then-Vice President Biden, Obama officially evolved on the issue and said he now supported marriage equality. It was a big moment.

A few years later, in 2015, the Supreme Court ruled in favor of same-sex marriage nationwide.

5 years ago, Donald Trump was the first Republican presidential nominee to publicly support marriage equality

“I’m fine with it,” Trump said in 2016 during an interview with “60 Minutes.”

He’d go on to brag about being a champion for gay rights, although many LGBTQ activists would disagree.

Now, completing the transformation

The politicians of the ’90s have largely evolved with the country.

But one of the Supreme Court’s relics from the ’90s, Justice Clarence Thomas, recently questioned the 2015 marriage decision he opposed. As a result, Republicans and Democrats are coming together again, in less than a generation, to undo what they did in 1996, and try to guarantee marriage as a right for all Americans.