Skip to content

Fix font-family-no-missing-generic-family-keyword false positives for math, emoji and fangsong - #8395

Merged
jeddy3 merged 4 commits into
stylelint:mainfrom
ViachaslauIhnatsiuk:font-family-no-missing-generic-family-keyword
Feb 15, 2025
Merged

jeddy3 merged 4 commits into
stylelint:mainfrom
ViachaslauIhnatsiuk:font-family-no-missing-generic-family-keyword

Conversation

@ViachaslauIhnatsiuk

Copy link
Copy Markdown
Contributor

Which issue, if any, is this issue related to?

Closes #8390

Is there anything in the PR that needs further explanation?

No, it's self-explanatory.

@changeset-bot

changeset-bot Bot commented Feb 15, 2025 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 98ce368

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Patch

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

@Mouvedia Mouvedia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a regression test to font-family-no-missing-generic-family-keyword/__tests__/index.mjs?

@Mouvedia

Copy link
Copy Markdown
Member

While you are at it can you update

- The `font` and `font-family` properties accept a short list of special **keywords**: `inherit`, `serif`, `sans-serif`, `cursive`, `fantasy`, `system-ui`, `monospace`, `ui-serif`, `ui-sans-serif`, `ui-monospace`, and `ui-rounded`. If you wrap these words in quotes, the browser will not interpret them as keywords, but will instead look for a font by that name (e.g. will look for a `"sans-serif"` font) -- which is almost _never_ what you want. Instead, you use these keywords to point to the built-in, generic fallbacks (right?). Therefore, _all of the options below enforce no quotes around these keywords_. (If you actually want to use a font named `"sans-serif"`, turn this rule off.)

?

@Mouvedia Mouvedia left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ViachaslauIhnatsiuk thank you for the contribution. Ill add the changeset for you.

@jeddy3 jeddy3 changed the title Add emoji, math, fangsong for font-family-no-missing-generic-family-keyword Fix font-family-no-missing-generic-family-keyword false positives for math, emoji and fangsong Feb 15, 2025

@jeddy3 jeddy3 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you.

@ViachaslauIhnatsiuk

Copy link
Copy Markdown
Contributor Author

@Mouvedia Thanks a lot for the comments, made changes

@jeddy3
jeddy3 merged commit 6be2922 into stylelint:main Feb 15, 2025
@ViachaslauIhnatsiuk
ViachaslauIhnatsiuk deleted the font-family-no-missing-generic-family-keyword branch February 23, 2025 11:57
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Mar 1, 2025
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.14.0 | 16.15.0 |


## [v16.15.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16150---2025-02-28)

It adds 1 new rule, a `languageOptions` configuration property for configuring some of the new rules added in `16.13.0`, regex support to 1 option and support for computing `EditInfo` to 6 rules. It fixes 9 bugs, including 2 with the `tap` reporter.

-   Added: `syntax-string-no-invalid` rule ([#8331](stylelint/stylelint#8331)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `languageOptions` configuration property ([#8297](stylelint/stylelint#8297)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: regex support to `ignoreAtRules` option of `at-rule-empty-line-before` ([#8385](stylelint/stylelint#8385)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `alpha-value-notation` support for computing `EditInfo` ([#8369](stylelint/stylelint#8369)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Added: `color-hex-length` support for computing `EditInfo` ([#8415](stylelint/stylelint#8415)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `comment-empty-line-before` support for computing `EditInfo` ([#8416](stylelint/stylelint#8416)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `comment-whitespace-inside` support for computing `EditInfo` ([#8417](stylelint/stylelint#8417)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `custom-property-empty-line-before` support for computing `EditInfo` ([#8418](stylelint/stylelint#8418)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `declaration-block-no-duplicate-properties` support for computing `EditInfo` ([#8363](stylelint/stylelint#8363)) ([@romainmenke](https://github.com/romainmenke)).
-   Fixed: `tap` formatter not escaping `#` and `\` in its test point descriptions ([#8334](stylelint/stylelint#8334)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `tap` formatter outputting invalid YAML blocks for rules containing double quotes in their warnings' messages ([#8334](stylelint/stylelint#8334)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `declaration-block-no-redundant-longhand-properties` false positives for properties with `!important` ([#8366](stylelint/stylelint#8366)) ([@immitsu](https://github.com/immitsu)).
-   Fixed: `EditInfo` missing semicolon in `text` field ([#8370](stylelint/stylelint#8370)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Fixed: `declaration-property-value-keyword-no-deprecated` false negatives for `text-decoration: blink` ([#8351](stylelint/stylelint#8351)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `declaration-property-value-keyword-no-deprecated` false positives for styled components interpolated functions ([#8392](stylelint/stylelint#8392)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `font-family-name-quotes` false positives due to vendor-prefixed font-size values ([#8393](stylelint/stylelint#8393)) ([@Mouvedia](https://github.com/Mouvedia)).
-   Fixed: `font-family-no-missing-generic-family-keyword` false positives for `math`, `emoji` and `fangsong` ([#8395](stylelint/stylelint#8395)) ([@ViachaslauIhnatsiuk](https://github.com/ViachaslauIhnatsiuk)).
-   Fixed: `selector-type-no-unknown` false positives for `selectmenu` and `popup` ([#8376](stylelint/stylelint#8376)) ([@Mouvedia](https://github.com/Mouvedia)).


## [v16.14.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16141---2025-01-27)

It fixes a bug with caching.

-   Fixed: incompatible cache file format ([#8359](stylelint/stylelint#8359)) ([@romainmenke](https://github.com/romainmenke)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Fix font-family-no-missing-generic-family-keyword false positives for math, emoji and fangsong

3 participants