stylelint: Add font-family-no-missing-generic

Describe the issue. Is it a bug or a feature request (new rule, new option, etc.)?

This is a proposal for a new rule that always requires a generic font-family at the end of font-family list. Helps reduce various visual bugs when there’s:

  • missing or disabled “web-safe” font,
  • misspelled font name
  • @font-face web font that failed to load

pull request coming in a minute

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

New rule called font-family-generic-fallback

What CSS is needed to reproduce this issue?

.foo {
  font-family: Arial;
}

What stylelint configuration is needed to reproduce this issue?

e.g.

{
  "rules": {
    "font-family-generic-fallback": "always"
  }
}

Which version of stylelint are you using?

fresh github branch

How are you running stylelint: CLI, PostCSS plugin, Node API?

Clone the repo, npm test

Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?

No non-standard CSS

What did you expect to happen?

Warnings to be flagged when using the new rule

What actually happened (e.g. what warnings or errors you are getting)?

Nothing yet.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

❤️ font-family-no-missing-generic-family-keyword

A little on the verbose side but clear and correct. And self-documenting.