Add Stylelint#594
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #594 +/- ##
==========================================
Coverage 74.68% 74.68%
Complexity 1754 1754
==========================================
Files 85 85
Lines 7549 7549
==========================================
Hits 5638 5638
Misses 1911 1911
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mirka
left a comment
There was a problem hiding this comment.
Very cool to see the design system tooling being used in another repo ❤️ I'll leave it to someone with more familiarity here to approve, but overall it looks good to me.
| .components-button { | ||
| color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)); | ||
| color: var(--wpds-color-fg-interactive-brand); |
There was a problem hiding this comment.
Just looking at the diff here so not sure what exactly is going on in context, but this jumped out at me because you shouldn't have to overwrite accent colors in @wordpress/components. Possibly safe to remove.
There was a problem hiding this comment.
Yap! Seems fine for separate PR
| files: [ | ||
| '**/*.module.{css,scss}', | ||
| // Route styles are bundled into JS (no RTLCSS flip); enforce logical properties. | ||
| 'routes/**/*.{css,scss}', |
There was a problem hiding this comment.
Not sure what the strategy is in this repo, but I'll mention that even for routes in Gutenberg we are recommending a switch to CSS modules where stylesheets are imported from JS files. (This code comment is making it seem like it's fine to use plain CSS files in routes.)
There was a problem hiding this comment.
Not sure if it's feasible, but this makes me wonder if we should be packaging some of these settings In @wordpress/stylelint-config for easier reuse!
d15d1ae to
d2af307
Compare
What?
var(--wpds-dimension-gap-lg );are converted tovar(--wpds-dimension-gap-lg, 16px);at build-time, rather than requiring us to keep fallbacks in CSS files, which would then eventually get out of sync anyway with real values.wp-buildalready handles this forroutes/*page, but for "classic" builds we need to handle this ourselves.npm run lint:cssto CI workflowWhy?
--wp-admin-theme-coloror-wp-components-color-gray-700How?
Use of AI Tools
Yes
Testing Instructions
Nothing should change visually, apart from slight drifts due to updated design tokens (components→design system); smoke-test the plugin features. Test both the
WP Buildbased settings page as well as the features in the editor, and classic WP Admin pages.npm run lint:cssshould pass.Screenshots or screencast
—
Updated design tokens
Here’s a concise before → after view for the SCSS we moved off raw hex / off
--wp-components-color-*onto WPDS tokens. The “After (built fallback)” column is what PostCSS injects from@wordpress/theme’sdesign-token-fallbacksmap (same as in your compiled CSS when the token is barevar(--wpds-…)).color#5c5f62var(--wpds-color-fg-content-neutral-weak)#707070#707070vs#5c5f62).colorvar(--wp-admin-theme-color, #3858e9)var(--wpds-color-fg-interactive-brand)var(--wp-admin-theme-color, #3858e9)(nested in map)#3858e9default.color#757575var(--wpds-color-fg-content-neutral-weak)#707070#707070is slightly lighter than#757575.background#f0f0f0var(--wpds-color-bg-surface-neutral-weak)#f4f4f4#f4f4f4vs#f0f0f0.color#757575var(--wpds-color-fg-content-neutral-weak)#707070color#00a32avar(--wpds-color-fg-content-success-weak)#008030#008030vs WP green#00a32a).color#dba617var(--wpds-color-fg-content-warning-weak)#926300#926300is browner/darker than#dba617.Changelog Entry