After a brief departure from tradition that was tailored for Senator John Fetterman, the Pennsylvania Democrat who pressed to vote and preside in shorts and a hoodie rather than a business suit, the Senate on Wednesday formalized a longstanding — but previously unofficial — requirement that members show up to the chamber in business attire.

The Senate late Wednesday unanimously approved a resolution that for the first time codified the suit-and-tie uniform. The action came a week and a half after Senator Chuck Schumer, Democrat and the majority leader, announced a relaxing of the decades-old dress policy, prompting some senators including Mr. Fetterman to loosen their ties while others clutched their pearls.

The new, enforceable standards, put forth by Senators Joe Manchin III, Democrat of West Virginia, and Mitt Romney, Republican of Utah, assert that “business attire” is required for all members, specifying that men are expected to don a coat, tie and slacks or other long pants.

“Though we’ve never had an official dress code, the events over the past week have made us all feel as though formalizing one is the right path forward,” Mr. Schumer said on Thursday from the Senate floor, where he sported a navy jacket and a buffalo silhouette pattern tie, adhering to the newly official dress code while also supporting his favorite football team.

It was a reversal after a bipartisan backlash over Mr. Schumer’s decision last week to direct the Senate sergeant-at-arms to no longer police outfits for members, a move made to accommodate Mr. Fetterman, the 6-foot-8, tattooed and mustachioed senator who is most frequently seen in the Capitol wearing his signature Carhartt sweatshirts and baggy shorts.

Mr. Manchin and Mr. Romney circulated a draft of the proposed changes earlier this week, aiming to put an end to the dust-up over clothing choice that had preoccupied senators even as they worked to find a way to avoid a government shutdown within days.

“This is not the biggest thing going on in Washington today — it’s not even one of the biggest things going on in Washington today — but nonetheless, it’s a good thing,” said Mr. Romney, a prep school alumnus who spent his adolescent years required to sport a suit and tie and three-quarter coat.

Mr. Manchin, who, as one of the first Democrats in the Senate to express dismay over the dress code change, called the earlier decision “wrong,” said he had worked with Mr. Fetterman to reach a workable solution.

“It’s truly been a team effort,” Mr. Manchin said from the podium in a gray notch lapel suit with striped tie and neatly ruffled pocket square.

“You know, for 234 years, every senator that has had the honor of serving in this distinguished body has assumed that there were some basic written rules of decorum and conduct and civility, one of which was the dress code,” he said.

Since discovering there was no formal policy dictating what senators could and could not wear, Mr. Manchin saw an opportunity to put a measure in place that would likely last a few more centuries.

The new dress code requires a two-thirds vote to make any changes, a 67-vote threshold higher even than the notoriously challenging 60 votes needed to break a filibuster and bring major legislation to a vote.

Seen leaving the Capitol on Thursday in a burgundy hoodie, Mr. Fetterman did not directly respond to questions about the new rule. Instead, his office sent out a photo of the viral meme showing actor Kevin James as the “King of Queens” character Doug Heffernan, shrugging his shoulders and smirking at the camera.