fix(css): skip useGenericFontNames rule in @supports feature declarations#8979
fix(css): skip useGenericFontNames rule in @supports feature declarations#8979kaigritun wants to merge 2 commits intobiomejs:mainfrom
Conversation
…ions When a font property is used in an @supports condition, it's testing for browser support rather than actually setting a font. This should not trigger the 'Generic font family missing' error. Closes biomejs#8845
🦋 Changeset detectedLatest commit: 511a53c 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 |
WalkthroughThis change extends the 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)
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 |
|
Added changeset as requested. |
|
Fixed by #8848 |
Summary
When a font property is used inside an
@supportscondition (e.g.,@supports (font: -apple-system-body) {}), it's testing for browser support rather than actually setting a font. This should not trigger the 'Generic font family missing' error.Before
Would trigger:
lint/a11y/useGenericFontNames: Generic font family missing.After
No longer triggers the error for properties inside
@supportsfeature declarations.Changes
is_in_supports_feature_declaration()helper function to check if a property is inside an@supportsconditionCSS_SUPPORTS_FEATURE_DECLARATIONnodes@supportswithfontandfont-familypropertiesTest Plan
valid.css:@supports (font: -apple-system-body) { }@supports (font-family: -apple-system) { }Closes #8845