7 ms·
A good reason to alphabetize is that your text editor can alphabetize a group of lines. So it's easy to get a group of properties back into order, as long as "o
by nfnaaron 17y ago
A good reason to alphabetize is that your text editor can alphabetize a group of lines. So it's easy to get a group of properties back into order, as long as "order" is what your tool does.
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.
- Semiapies 17y ago"A good reason to alphabetize is that your text editor can alphabetize a group of lines." 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.
- NikkiA 17y agoWhy do you need your tools to perform the ordering for you? It's really not that hard to group by functionality when you write the CSS, and a little bit of discipline will keep them grouped as you make changes.