Skip to content

fix: avoid row-gap following gap with CSS variable #9634

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

Conversation

vursen
Copy link
Contributor

@vursen vursen commented Jul 3, 2025

Description

The PR improves the no-shorthand-with-unresolved-longhand stylelint rule to catch more cases where a shorthand property uses a CSS variable and is followed by one of its longhand properties, e.g:

border: 1px solid var(--color);
border-right: none; /* <---------- ERROR */
gap: var(--gap);
row-gap: 2px; /* <---------- ERROR */

These cases are problematic because the browser cannot correctly serialize them when cssText is accessed on a CSSStyleSheet. As a result, these properties are serialized with invalid, empty values.

Finding from #9594

Type of change

  • Bugfix

@vursen vursen changed the title fix: avoid one more CSS shorthand followed by longhand fix: avoid one more CSS longhand preceded by its shorthand with CSS variable Jul 3, 2025
@vursen vursen changed the title fix: avoid one more CSS longhand preceded by its shorthand with CSS variable fix: avoid one more CSS longhand preceded by its shorthand with CSS var Jul 3, 2025
@vursen vursen changed the title fix: avoid one more CSS longhand preceded by its shorthand with CSS var fix: avoid row-gap following gap with CSS variable Jul 3, 2025
@vursen vursen requested a review from web-padawan July 3, 2025 15:21
Copy link

sonarqubecloud bot commented Jul 4, 2025

@vursen vursen requested a review from web-padawan July 4, 2025 06:21
@vursen vursen merged commit b1f53f6 into main Jul 4, 2025
10 checks passed
@vursen vursen deleted the improve-no-shorthand-with-unresolved-longhand-stylelint branch July 4, 2025 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants