Skip to content

Stylelint: Ignore more vertical-only properties in the logical CSS rule - #87689

Merged
simison merged 1 commit into
trunkfrom
update/stylelint-logical-css-vertical-ignores
Dec 2, 2026
Merged

simison merged 1 commit into
trunkfrom
update/stylelint-logical-css-vertical-ignores

Conversation

@simison

@simison simison commented Nov 30, 2026

Copy link
Copy Markdown
Member

What?

Adds vertical-only longhands to the ignore list of logical-css/require-logical-properties:

  • border-top-color, border-top-style, border-top-width
  • border-bottom-color, border-bottom-style, border-bottom-width
  • scroll-padding-top, scroll-padding-bottom

Why?

The rule already ignores vertical properties that don't depend on writing direction, such as border-top, margin-top and scroll-margin-top, so it only covers the horizontal axis. These longhands were missing, so the rule flagged them even though they behave the same in LTR and RTL.

While analysing 6 months of trunk commits for #87686, these properties caused 8 of the 145 flags (in 7 commits), and none of them were RTL issues. With #87686 enabling the rule everywhere, they would cause even more noise.

How?

Extends the ignore list in tools/stylelint/config.js. Horizontal properties (border-left-color, scroll-padding-left…) and corner radii (border-top-left-radius…) are still flagged.

Testing Instructions

  1. npm run lint:css passes. No inline disables become unneeded (reportNeedlessDisables is on).
  2. In a CSS module, for example packages/ui/src/button/style.module.css, add .foo { border-top-color: #000; scroll-padding-bottom: 1px; margin-left: 1px; } and run npm run lint:css. Only margin-left is flagged by logical-css/require-logical-properties.

Use of AI Tools

Drafted with Claude Code; reviewed by me.

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.
@simison simison added the [Type] Code Quality Issues or PRs that relate to code quality label Nov 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

🤖 PR meta 🤖

Preview in WordPress Playground Preview in Storybook

🎉 Props

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: simison <simison@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

Updated as activity occurs, without notifying anyone named here. Add the props-bot label to refresh.

📦 Bundle size

Size Change: 0 B

Total Size: 8.73 MB

b648b5b Run

@simison
simison merged commit 42bb2dd into trunk Dec 2, 2026
91 checks passed
@simison
simison deleted the update/stylelint-logical-css-vertical-ignores branch December 2, 2026 10:33
@github-actions github-actions Bot added this to the Gutenberg 24.6 milestone Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Code Quality Issues or PRs that relate to code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants