Skip to content

fix: correctly identify font-size in font shorthand - #526

Open
Pixel998 wants to merge 1 commit into
mainfrom
fix/relative-font-units-font-shorthand
Open

fix: correctly identify font-size in font shorthand#526
Pixel998 wants to merge 1 commit into
mainfrom
fix/relative-font-units-font-shorthand

Conversation

@Pixel998

@Pixel998 Pixel998 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Prerequisites checklist

AI acknowledgment

  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

What did you do?

/* eslint css/relative-font-units: "error" */

.a {
  font: oblique 10deg 1rem serif;
}

.b {
  font: 1rem math;
}

What did you expect to happen?

Neither declaration should be reported: 10deg is the oblique angle, and math is a generic font family.

What actually happened?

The rule reported 10deg and math instead of identifying 1rem as the size.

What changes did you make? (Give an overview)

Updated the rule to use the lexer’s font grammar match to identify the actual font-size component before checking whether its unit or keyword is allowed.

Related Issues

Is there anything you'd like reviewers to focus on?

@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Aug 8, 2026
@eslint-github-bot eslint-github-bot Bot added the bug Something isn't working label Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant