The commonest CSS declaration group method I come throughout is none by any means.
Nearly none, anyway. I are likely to group them by no matter dumps out of my mind as I’m writing them, which normally finally ends up with considerably logical teams, like field mannequin stuff grouped collectively and coloration stuff grouped collectively. It simply… hasn’t mattered to me. However that’s strongly influenced by sometimes engaged on small groups or alone. Eric recommends the alphabetical method as a result of:
[…] it imposes a baseline sense of construction throughout a crew. This ask is normally sufficient, particularly if it means cleansing up what’s come earlier than.
And his (most likely greater) level is that the imparted construction helps legitimize CSS in a world the place CSS abilities are undervalued. Not going to argue towards that, however I’d argue that hand-alphabetizing CSS on an current challenge could be very possible not a great use of time. Worse, it’d break stuff if executed blindly, which is why Prettier punted on it. For those who and your crew agree this can be a good concept, I’d discover a method to get this into an on-save perform in your code editor and make it a pre-commit hook. Alphabetizing is a job for computer systems to do and the output may be verified as you might be authoring.
At Marketing Solution Australia we strive to deliverer elegant responsive websites for your business integrated with our personal SEO Optimization package to bring your pages on the first page of Google.