Transform poor CSS into a more beatiful form in Dart
Sorting the properties alphabetically does not yield "the same code". Properties that appear later in a rule override properties that occur earlier in the same rule. Mozilla Developer Network gives an example of a tricky edge case:


  
  A value which is not specified is set to its initial value. That sounds anecdotal, but it really means that it overrides previously set values. Therefore:

background-color: red;
background: url(images/bg.gif) no-repeat top right;

  
  will not set the color of the background to red but to background-color's default, transparent, as the second rule has precedence.
  


If you reverse the properties in that example, you would get a different result.