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 system fonts in font-family-no-missing-generic-family-keyword #3794

Merged
merged 1 commit into from Nov 12, 2018

Conversation

3 participants
@regseb
Contributor

regseb commented Nov 9, 2018

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

Closes #3793

Is there anything in the PR that needs further explanation?

No, it's self explanatory.

@jeddy3

@regseb Thanks for your contribution.

Is there somewhere in the specs we can find out more about these font values? I believe the current list is based on the one found in this spec.

@regseb

This comment has been minimized.

Contributor

regseb commented Nov 9, 2018

@jeddy3 I got list from MDN. Here are the spec.

@jeddy3

This comment has been minimized.

Member

jeddy3 commented Nov 9, 2018

Fascinating! Thanks for the sharing the link to the spec. I had no idea there were such things are system fonts and they are set using the font shorthand property which is sometimes not a shorthand property!

Here's the relevant bit from the spec for those interested:

System fonts may only be set as a whole; that is, the font family, size, weight, style, etc. are all set at the same time. These values may then be altered individually if desired. If no font with the indicated characteristics exists on a given platform, the user agent should either intelligently substitute (e.g., a smaller version of the 'caption' font might be used for the 'small-caption' font), or substitute a user agent default font. As for regular fonts, if, for a system font, any of the individual properties are not part of the operating system's available user preferences, those properties should be set to their initial values.

That is why this property is "almost" a shorthand property: system fonts can only be specified with this property, not with 'font-family' itself, so 'font' allows authors to do more than the sum of its subproperties. However, the individual properties such as 'font-weight' are still given values taken from the system font, which can be independently varied.

[Emphasis mine]

@jeddy3

jeddy3 approved these changes Nov 9, 2018

This PR LTGM. Nice work :)

@jeddy3 jeddy3 changed the title from Fix system font values on font property to Fix false positives for system fonts in font-family-no-missing-generic-family-keyword Nov 9, 2018

@ntwb

ntwb approved these changes Nov 12, 2018

Thanks @regseb 👍

@ntwb

This comment has been minimized.

Member

ntwb commented Nov 12, 2018

Chengelog updated in: 384f201

Fixed: false positives for system fonts in font-family-no-missing-generic-family-keyword (#3794).

@jeddy3 jeddy3 merged commit f865f3d into stylelint:master Nov 12, 2018

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.001%) to 96.354%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment