Repository navigation
Conversation
…ssions Move the logical-css and declaration-property-max-values rules out of the CSS modules override so they apply to all stylesheets, and record existing violations in the bulk suppressions file.
🤖 PR meta 🤖📦 Bundle sizeSize Change: 0 B Total Size: 8.73 MB
|
border-top/bottom-color/style/width and scroll-padding-top/bottom don't depend on writing direction, like the border-top and scroll-margin-top properties already ignored.
This was referenced Nov 30, 2026
Member
Author
|
Looks like we should extend the ignore list a bit, too: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Enables the logical CSS Stylelint rules for every stylesheet in the repository, not only CSS modules and
routes/. Existing violations are recorded as bulk suppressions so lint keeps passing.Alternative to #87685, which enables the rules only for DataViews. Suggested in #87685 (comment) and #37411 (comment).
Why?
Physical properties keep landing in stylesheets that aren't CSS modules. I linted the lines added by every trunk commit that touched a stylesheet in the last 6 months (June–November 2026) with this PR's config:
routes/, which are already covered)It's steady at 9–18 commits a month, spread across
editor,components,block-editor,block-libraryand others, and mostlyleft/right,margin-left/margin-right,padding-left/padding-rightandborder-left. Recent examples: #86855, #86023, #85288.Most of these aren't visible RTL bugs today, since non-module package styles get an
-rtl.cssbuild. But they add to the migration in #37411, and the convention isn't holding without a lint rule. A few of the flagged lines are physical on purpose (for example #83520 pairs margins with a physicalfloat); those would need an inline disable with a reason.How?
tools/stylelint/config.js:logical-css/require-logical-properties,logical-css/require-logical-keywordsanddeclaration-property-max-valuesfrom the CSS modules override to the top-level rules.border-top-*andborder-bottom-*(color,style,width) andscroll-padding-top/scroll-padding-bottom. These sit alongsideborder-top,scroll-margin-topand the other vertical properties that were already ignored, so the rule still covers the horizontal axis only. In the analysis above, they caused 8 of the 145 flags.tools/stylelint/stylelint-suppressions.json: regenerated withnpm run lint:css:update-suppressions. Existing entries for other rules are untouched.Suppressed today, across 245 files:
logical-css/require-logical-propertiesdeclaration-property-max-valueslogical-css/require-logical-keywordsHow suppressions behave: counts are per file and rule. If a file goes over its suppressed count, Stylelint reports every violation of that rule in the file, not only the new one. A change that adds one violation and removes another in the same file keeps the count and isn't flagged. When fixing violations, run
npm run lint:css:update-suppressionsto lower the counts.Testing Instructions
npm run lint:csspasses..foo { margin-left: 1px; }to a non-module stylesheet, for examplepackages/edit-site/src/style.scss, and runnpm run lint:css. It is flagged withlogical-css/require-logical-properties..foo { border-top-color: #000; }instead. It isn't flagged by the logical CSS rules.Use of AI Tools
Drafted with Claude Code; reviewed by me.