Skip to content
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

Fix false positives for ui-* generic system font keywords in font-family-name-quotes #6016

Closed
nlydv opened this issue Apr 16, 2022 · 1 comment · Fixed by #6017
Closed

Fix false positives for ui-* generic system font keywords in font-family-name-quotes #6016

nlydv opened this issue Apr 16, 2022 · 1 comment · Fixed by #6017
Labels
status: wip is being worked on by someone type: bug a problem with a feature or rule

Comments

@nlydv
Copy link
Contributor

nlydv commented Apr 16, 2022

What steps are needed to reproduce the bug?

  1. Set the font-family-name-quotes rule to always-unless-keyword
  2. Add one the following generic keywords in a font-family property:
    • ui-serif
    • ui-sans-serif
    • ui-monospace
    • ui-rounded
  3. Run Stylelint on the file

What Stylelint configuration is needed to reproduce the bug?

{
    "rules": {
        "font-family-name-quotes": "always-unless-keyword"
    }
}

How did you run Stylelint?

CLI with stylelint style.css --config .stylelintrc

Which version of Stylelint are you using?

14.7.0

What did you expect to happen?

Stylelint would recognize ui-monospace et al. as a generic keyword that doesn't require quoting.

What actually happened?

A warning was given stating that it expected quotes around ui-monospace.

Does the bug relate to non-standard syntax?

No (see: https://www.w3.org/TR/css-fonts-4/#ui-serif-def and https://caniuse.com/extended-system-fonts).

Proposal to fix the bug

Add ui-serif, ui-sans-serif, ui-monospace, and ui-rounded to the list of generic font-family keywords such that they be recognized by rules such as font-family-name-quotes and any other relevant rules.

@jeddy3 jeddy3 changed the title Fix false positives for ui-* generic system font keywords Fix false positives for ui-* generic system font keywords in font-family-name-quotes Apr 17, 2022
@jeddy3 jeddy3 added status: ready to implement is ready to be worked on by someone type: bug a problem with a feature or rule labels Apr 17, 2022
@jeddy3
Copy link
Member

jeddy3 commented Apr 17, 2022

@nlydv Thanks for the report, using the template and for linking to the specs.

I've labelled the issue as ready to implement. Please consider contributing if you have time.

There are steps on how to fix a bug in a rule in the Developer guide.

It'll just be case of updating our reference list:

keywordSets.fontFamilyKeywords = uniteSets(keywordSets.basicKeywords, [
'serif',
'sans-serif',
'cursive',
'fantasy',
'monospace',
'system-ui',
]);

@jeddy3 jeddy3 added status: wip is being worked on by someone and removed status: ready to implement is ready to be worked on by someone labels Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wip is being worked on by someone type: bug a problem with a feature or rule
Development

Successfully merging a pull request may close this issue.

2 participants