-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce a specific ordering of attributes #2
Comments
Where does this order come from? Csscomb has some presets: https://github.com/csscomb/csscomb.js/tree/master/config |
...or don't do this. It has little benefit (selector lists are usually not that long so keeping them ordered doesn't make them more readable), and will just waste developer time fixing more "errors". |
If the fixing can be automated, I don't see it as a problem. The benefits are not that big for well written CSS because this does not really affect inside-a-block readability, but for less than well written CSS it is helpful, because it makes comparing separate blocks easier. |
We've had some conversation about that already on the CSS Coding Conventions talk page including a proposal from my years of working with CSS. |
If the fixing can be automated it is less objectionable - although I maintain it is exceptional for a class to have more than rules that can be scanned easily, so it still seems more trouble that is it worth. |
csscomb can automate it, but I have no experience on stylelint. |
I agree, that not-automated ordering might seem like a burden or even out of scope. Maybe it would be preferable as a build step after developer has ended work. |
Users may also want to group non adjacent rules for clarity, consider: |
(Upstream has deprecated this from core and moved into a plugin.) |
With 'stylelint-order' a maintained and powerful stylelint plugin existst. |
Per discussion this might be useful an optional plugin (e.g. |
csscomb is not maintained since 2019 Alternatives (besides stylelint-order): |
Thanks @danisztls. Note that we've already added and are actively using stylelint-order to Codex since my last comment here. |
The text was updated successfully, but these errors were encountered: