org.sonar.css.checks.l10n.common.font-family-not-ending-with-generic-font-family.html Maven / Gradle / Ivy
A generic font family should always be defined at the end of a font-family
list. Because there is no
guarantee that a specific font is installed on the computer or can be downloaded using a @font-face
at-rule. The generic family lets the browser select an acceptable fallback font when needed.
Noncompliant Code Example
font-family: 'Arial', 'MS Trebuchet';
Compliant Solution
font-family: 'Arial', 'MS Trebuchet', sans-serif;
Note
Obviously, this check does not apply to font-family
descriptors in @font-face
at-rules.
For instance, the following piece of code does not raise any issue:
@font-face {
font-family: 'My font family';
src: url('http://xxx');
}
See
© 2015 - 2024 Weber Informatics LLC | Privacy Policy