DecisionUse CSS Logical Properties
Decoupling styles from a language's writing direction makes them easier to maintain across translations.
Table Of Contents
We will use CSS Logical Properties when writing styles that have a directional word or connotation to them. For example, instead of writing
margin-left, we will use
To help enforce this ADR, projects can utilize the
stylelint-use-logical-spec plugin for stylelint, and can use the
--fix flag to autofix errors detected for this ruleset.
Styles will support any writing direction by default, which makes them easier to maintain and reduces content internationalization hurdles.
Styles will be less likely to have issues with specificity conflicts caused by localization overrides.