From 1faa779a126c3564e74d6254d596da8dd2b4bf56 Mon Sep 17 00:00:00 2001 From: Tony Ruscoe Date: Fri, 6 May 2022 11:48:31 +0100 Subject: [PATCH] Make the Declaration Order recommendation optional 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. --- htmlcssguide.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htmlcssguide.html b/htmlcssguide.html index 02649148e..96a88c3e1 100644 --- a/htmlcssguide.html +++ b/htmlcssguide.html @@ -735,10 +735,12 @@

CSS Formatting Rules

Declaration Order

-

Alphabetize declarations.

+

Alphabetize declarations (optional).

-

Put declarations in alphabetical order in order to -achieve consistent code in a way that is easy to remember and maintain.

+

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.

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