fix(css): skip useGenericFontNames rule inside @supports at-rules#8946
fix(css): skip useGenericFontNames rule inside @supports at-rules#8946murataslan1 wants to merge 2 commits intobiomejs:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 7858350 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 WalkthroughThis change updates the lint rule useGenericFontNames to skip processing declarations inside CSS Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| a { font-family: revert-layer } No newline at end of file | ||
| a { font-family: revert-layer } | ||
| @supports (font-family: Arial) { a { color: red; } } | ||
| @supports (display: grid) { a { font-family: Arial; } } No newline at end of file |
There was a problem hiding this comment.
@supports (display: grid) { a { font-family: Arial; } }
This case should be flagged as invalid
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@murataslan1 1. my comments from my previous review have not been addressed, and 2. there's merge conflicts now |
Merging this PR will improve performance by 10.79%
Performance Changes
Comparing Footnotes
|
Co-authored-by: Cursor <cursoragent@cursor.com>
73a2b53 to
7858350
Compare
|
@dyc3 Follow-up applied on branch |
ematipico
left a comment
There was a problem hiding this comment.
Your pr isn't fixing anything.....
| a { font-family: "Lucida Grande", "Arial", sans-serif; } | ||
| a { font: 1em "Lucida Grande", 'Arial', sans-serif; } | ||
| a { font: 1em "Lucida Grande", 'Arial', "sans-serif", sans-serif; } | ||
| a { font-family: Times, serif; } | ||
| b { font-family: inherit; } | ||
| b { font-family: inherit; } | ||
| b { font-family: initial; } | ||
| b { font-family: unset; } | ||
| b { font-family: serif; } | ||
| b { font-family: sans-serif; } | ||
| b { font-family: Courier, monospace; } | ||
| b { font: 1em/1.5 "Whatever Fanciness", cursive; } | ||
| a { font-family: Helvetica Neue, sans-serif, Apple Color Emoji; } | ||
| @font-face { font-family: Gentium; } | ||
| @FONT-FACE { font-family: Gentium; } | ||
| a { font: inherit; } | ||
| a { font: caption; } | ||
| a { font: icon; } | ||
| a { font: menu; } | ||
| a { font: message-box; } | ||
| a { font: small-caption; } | ||
| a { font: status-bar; } | ||
| a { font-family: var(--font); } | ||
| a { font-family: "Noto Serif", var(--serif); } | ||
| a { font-family: Arial, var(--fallback); } | ||
| a { font: 1em "Noto Serif", var(--serif); } | ||
| a { font: 14px/1.5 Arial, var(--fallback); } | ||
| a { font-family: revert } | ||
| a { font-family: revert-layer } |
There was a problem hiding this comment.
Why did you change all of this? Revert
| a { font-family: Arial; } | ||
| a { font-family: 'Arial', "Lucida Grande", Arial; } | ||
| a { fOnT-fAmIlY: ' Lucida Grande '; } | ||
| a { font-family: Times; } | ||
| a { FONT: italic 300 16px/30px Arial, " Arial"; } | ||
| a { font: normal 14px/32px -apple-system, BlinkMacSystemFont; } | ||
| a { font: 1em Lucida Grande, Arial, "sans-serif" } |
There was a problem hiding this comment.
Revert. Just add new code at the end of the file
Fixes #8845
Problem
The
useGenericFontNameslint rule incorrectly triggered inside@supportsqueries, wherefont-familydeclarations are used to test feature support rather than to declare actual font usage.Example that was incorrectly flagged:
Solution
Added
is_in_supports_at_rule()function to detect if aCssGenericPropertyis inside aCssSupportsAtRule. The rule now skips validation when inside@supportsblocks.Testing
Added test cases in
valid.cssfor both@supportscondition and block scenarios.Made with Cursor