You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
This sounds like a good idea. To follow ESLint naming conventions, I'd call this prefer-logical-properties.
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 except? If so, it looks like you're excluding a lot of properties, and I wonder if there isn't some better default behavior?
Does it assume LTR so padding-left is always flagged to be padding-inset-start? Or is there some detection of LTR vs RTL?
These properties, values and units have inconsistent support across browsers. For example, padding-inline is supported, whereas overflow-inline from the overflow spec has very little support. Perhaps a better default is Baseline's widely available? It's a shifting target, though.
It may also be helpful to people if the rule flags physical four-directional shorthand properties like margin, padding, and border-width, as there is currently no logical equivalent for these shorthands.
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: