Skip to content

Commit

Permalink
Make the Declaration Order recommendation optional
Browse files Browse the repository at this point in the history
This recommendation was relaxed in the internal style guide a few months ago. The suggestion is still to continue using alphabetical order unless teams have access to the appropriate tooling which can support consistently automating and enforcing different sorting rules which may be more logical to read.
  • Loading branch information
tonyruscoe authored May 6, 2022
1 parent cada798 commit 1faa779
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions htmlcssguide.html
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,12 @@ <h3 id="CSS_Formatting_Rules" class="numbered">CSS Formatting Rules</h3>

<h4 id="Declaration_Order" class="numbered">Declaration Order</h4>

<p>Alphabetize declarations.</p>
<p>Alphabetize declarations (optional).</p>

<p>Put declarations in alphabetical order in order to
achieve consistent code in a way that is easy to remember and maintain.</p>
<p>Sort declarations consistently within a project. In the absence of tooling to
automate and enforce a consistent sort order, consider putting declarations in
alphabetical order in order to achieve consistent code in a way that is easy to
learn, remember, and manually maintain.</p>

<p>Ignore vendor-specific prefixes for sorting purposes. However, multiple
vendor-specific prefixes for a certain CSS property should be kept sorted (e.g.
Expand Down

0 comments on commit 1faa779

Please sign in to comment.