-
Notifications
You must be signed in to change notification settings - Fork 3
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
Make use of logical properties consistently #1576
Comments
I was recently updating my stylelint config and considered adding https://github.com/Jordan-Hall/stylelint-use-logical-spec In the end I opted not to because it felt like a big change. But I agree that we should definitely handle this via linting when the time comes. |
We've had some internal discussion around whether or not it makes sense to embrace logical properties in this way or not. To summarize:
Our options are:
I have a simple branch running locally that adds the afore-linked Stylelint plugin and enforces the rules on everything but |
I heard consensus for our team to pursue "option 2" above, so removing the |
Overview
Waaaaaay back in #651, we had a lot of internal discussion about logical properties, ultimately deciding to base our utilities on them. But since then, only our utilities and our Container object use logical properties: We appear to overwhelmingly be using traditional, directional property names like
margin-left
over equivalents likemargin-inline-start
.At the time, some of our misgivings may have been a factor of confusing support. Chrome versions ≤ 86 and Safari versions ≤ 14.0 did not accurately support shorthand properties like
margin-inline
orpadding-block
. Thankfully, these issues have been resolved in more recent versions.Another factor may be that we focused too little on this change in CSS compared to utility classes. Our spacing and padding utility classes have proven useful, with ~ 45 occurrences in our documentation and prototypes, but that's nothing compared to the 100+ occurrences of
margin
in our stylesheets.Perhaps this is also a difficult change to make without some automated hand-holding. There are a few competing stylelint plugins for this, the most popular appearing a bit stale. This alternative seems a bit better maintained: https://www.npmjs.com/package/stylelint-use-logical-spec
To-dos
Thanks @spaceninja for pointing this out during a PR review
The text was updated successfully, but these errors were encountered: