Set up your CSS declarations alphabetically

No Comments

Eric, once more not mincin’ no phrases with weblog publish titles. That is me:

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.

Direct Hyperlink to ArticlePermalink

The publish Set up your CSS declarations alphabetically appeared first on CSS-Methods. You’ll be able to assist CSS-Methods by being an MVP Supporter.

    About Marketing Solution Australia

    We are a digital marketing company with a focus on helping our customers achieve great results across several key areas.

    Request a free quote

    We offer professional SEO services that help websites increase their organic search score drastically in order to compete for the highest rankings even when it comes to highly competitive keywords.

    Subscribe to our newsletter!

    More from our blog

    See all posts

    Leave a Comment