Repository navigation
DataViews: Enforce logical CSS properties with Stylelint - #87685
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: +18 B (0%) Total Size: 8.73 MB 📦 View Changed
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. As a user I want to be able to add multiple close buttons so that users can close the overlay from different positions in
|
|
This seems fine and I wouldn't block it, but in my comment at #37411 (comment) I wondered if we shouldn't just go further and enable the |
|
We can merge this already to make DataViews clean for these rules, since the PR also includes fixes. I made a PR for the bulk suppressions: |
ciampo
left a comment
There was a problem hiding this comment.
LGTM 🚀
A couple of things for #87686, assuming this one lands first:
- Its suppressions file still has entries for the six DataViews violations fixed here. Stylelint won't fail on them, but could you rerun
npm run lint:css:update-suppressionsafter rebasing so they get pruned? - Once the logical rules move to the top level, the
packages/dataviews/**/*.scssentries added here will only keep the CSS-modules rules (property-no-unknownwithcomposes,:global, and the Baselinefunction-no-unknown). Could #87686 either drop them or keep them on purpose?
a441018 to
7916a65
Compare
Add packages/dataviews/**/*.scss to the logical-css Stylelint override so physical properties don't creep back in after #87663, and fix the remaining violations.
7916a65 to
91c7de9
Compare
What?
Follow-up to #87663. Adds
packages/dataviews/**/*.scssto the Stylelint override that requires logical CSS properties, and fixes the remaining violations it found.Why?
#87663 moved DataViews to logical properties. Without the lint rule, physical properties can sneak back in unnoticed.
How?
tools/stylelint/config.js: addpackages/dataviews/**/*.scssto the logical-CSS override and to the SCSS-only override (soscss/function-no-unknownis used instead offunction-no-unknown).margin: 0 0 X 0→margin: 0 0 Xin five group headers (grid, list, activity, picker-grid, picker-activity). Same computed value; the 3-value form doesn't name left/right, so it satisfiesdeclaration-property-max-values.scroll-padding-bottom→scroll-padding-block-endon the DataViews wrapper. Same result in horizontal writing modes.No inline
stylelint-disablecomments or suppressions were needed.Testing Instructions
npm run lint:csspasses.margin-left: 0;to any DataViews.scssfile and check thatnpm run lint:cssflags it.Use of AI Tools
Drafted with Claude Code; reviewed by me.