-
-
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
New Rule: use-logical #13
Comments
This sounds like a good idea. To follow ESLint naming conventions, I'd call this We'd need to workshop the behavior a bit. It looks like the Stylelint plugin automatically flags every property that has a logical equivalent and then allows you to opt-out using Does it assume LTR so |
There's an alternative Stylelint plugin called For example: h1 {
font-size: 8vi;
margin-block: 2vb;
@container (inline-size > 30em) {
text-align: start;
}
} These have inconsistent support across browsers. For example, It may also be helpful to people if the rule flags physical four-directional shorthand properties like |
Rule details
Enforce the usage of Logical Properties and Values in CSS. Physical dimensions and directions are described left to right and top to bottom, while their logical counterparts are described start to end and inline or block.
What type of rule is this?
Warns about a potential problem
Example code
https://github.com/csstools/stylelint-use-logical
For example, to add spacing before the start of a paragraph, we might use the physical padding-left property.
Were the content Hebrew or Arabic — flowing right to left — then we might use alternating padding-left and padding-right properties.
Selector weight aside, we can instead use the logical padding-inline-start property.
Participation
Additional comments
I'm not sure the quirks of the new css parser and context, but my current stylelint configuration for angular projects includes:
The text was updated successfully, but these errors were encountered: