19 points · by hoopitr · 17y ago · 9 comments
Similar to "our code formatting standards are whatever <local code beautifier> does," and then move on.
If you can get your tools to order according to function, then great.
That seems like putting the cart quite precisely in front of the horse. What text editors can easily do is not nearly as important as what's useful.
I don't think it's clear that strict adherence to an ordering of several properties per selector is useful - at least as much as bracket-handling and such - and if one has enough properties per selector that it takes noticeable time to find a particular property once you've located a selector, that's very likely a problem with one's CSS.
Now admittedly, I use less, which makes CSS pretty concise, but if there are tens of properties for any selector, something needs refactoring.
margin-top: ...
border-top: ...
padding-top: ...
height: ...
padding-bottom: ...
border-bottom: ...
margin-bottom: ...
margin-left: ...
border-left: ...
padding-left: ...
width: ...
padding-right: ...
border-right: ...
margin-right: ...
The components are listed in outside-in order, with each axis separate. I find this easy to visualize and tweak.Most other properties, however, I do just list together alphabetically.