Starfleet uniform code
The Starfleet uniform code was the group of Starfleet regulations governing the proper manner of wearing Starfleet uniforms. ()

The uniform code of the 23rd century Federation Starfleet permitted some personalization of the uniform. Lieutenant Uhura and Dr. Ann Mulhall wore earrings. Scotty wore a kilt and sporran as part of his dress uniform in the 2260s. Native American personnel were permitted to wear traditional jewelry with their duty uniforms in the 2270s. (; )

In the 24th century, Worf was permitted to wear his baldric as part of his duty uniform, but Ro Laren was initially forbidden to wear her Bajoran earring as part of hers. () Although Ro was eventually permitted to wear her earring, Bajoran crewmembers on board some other starships were not allowed to do so initially, although at least one Bajoran on the Enterprise-E wore the earring. In addition, elaborate headbands and jewelry were in violation of the dress code, though simple headwear, such as simple headbands and Ferengi headdresses were permitted. (; ; , et al.) 

When Captain Edward Jellico temporarily took command of the  in 2369, he requested that Counselor Deanna Troi wear a standard uniform, as he preferred a more formal atmosphere on the bridge. ()

Beckett Mariner regularly wore her uniform with the sleeves rolled up, which was generally frowned upon by fellow ensigns and members of the senior staff aboard the . ()  In response to Bradward Boimler's comment of Mariner acting "criminally insubordinate", she rolled her sleeves down in part to try to earn a promotion. ()

Background Information
Customization of the uniform was apparently permitted "at the captain's discretion", since no one ever objected to Worf's sash, and Picard eventually permitted Ro her earring, and later a simple command red headband.

In Star Trek Online, to facilitate player character customization, Starfleet is established to have relaxed its dress code so that any uniform was allowed so long as it bore the appropriate department color. Thus, players can wear not only uniforms from the past, but also from alternate universes and timelines.

External links
 
 
 
Law