Skip to content

Stylelint: Customise warning for CSS variables used outside components package #70108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2025

Conversation

im3dabasia
Copy link
Contributor

What?

Follow-up/Related: #70057 (comment)

The warning message shown previously was static. This PR aims to make the Stylelint warning related to non-usage of --wp-components-color-* variables dynamic. ( Outside the components/ package )

How?

After the Stylelint configuration was updated to JavaScript via #69590, now custom warnings can be shown for custom rules.

Testing Instructions

  1. Checkout any SCSS file located outside of the components package.
  2. Add a color property with --wp-components-color-accent or any variable starting with --wp-components-color-*
  3. Observe the warnings are dynamic.

Screenshot

Screenshot 2025-05-13 at 3 35 51 PM

Copy link

github-actions bot commented May 13, 2025

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 props-bot label.

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: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>

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

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Tool] stylelint config /packages/stylelint-config labels May 13, 2025
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice enhancement 👍

@t-hamano t-hamano added the props-bot Adding this label triggers the Props Bot workflow for a PR. label May 14, 2025
@github-actions github-actions bot removed the props-bot Adding this label triggers the Props Bot workflow for a PR. label May 14, 2025
@t-hamano t-hamano merged commit e5c93c9 into WordPress:trunk May 14, 2025
70 checks passed
@github-actions github-actions bot added this to the Gutenberg 20.9 milestone May 14, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…ents` package (WordPress#70108)

Co-authored-by: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] stylelint config /packages/stylelint-config [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