Skip to content

Files

Latest commit

 

History

History
127 lines (86 loc) · 2.33 KB

font-family-name-quotes.md

File metadata and controls

127 lines (86 loc) · 2.33 KB

Pattern: Malformed quotation marks around font family name

Issue: -

Description

This rule checks the font and font-family properties.

This rule ignores $sass, @less, and var(--custom-property) variable syntaxes.

Examples

"always-unless-keyword"

Expect quotes around every font family name that is not a keyword.

The following patterns are considered violations:

a { font-family: Arial, sans-serif; }
a { font-family: Times New Roman, Times, serif; }
a { font: 1em Arial, sans-serif; }

The following patterns are not considered violations:

a { font-family: 'Arial', sans-serif; }
a { font-family: "Times New Roman", "Times", serif; }
a { font: 1em 'Arial', sans-serif; }

"always-where-required"

Expect quotes only when quotes are required according to the criteria above, and disallow quotes in all other cases.

The following patterns are considered violations:

a { font-family: "Arial", sans-serif; }
a { font-family: 'Times New Roman', Times, serif; }
a { font: 1em "Arial", sans-serif; }

The following patterns are not considered violations:

a { font-family: Arial, sans-serif; }
a { font-family: Arial, sans-serif; }
a { font-family: Times New Roman, Times, serif; }
a { font-family: "Hawaii 5-0"; }
a { font: 1em Arial, sans-serif; }

"always-where-recommended"

Expect quotes only when quotes are recommended according to the criteria above, and disallow quotes in all other cases. (This includes all cases where quotes are required, as well.)

The following patterns are considered violations:

a { font-family: Times New Roman, Times, serif; }
a { font-family: SomeFontVersion6, sake_case_font; }
a { font-family: 'Arial', sans-serif; }
a { font: 1em Times New Roman, Times, serif; }

The following patterns are not considered violations:

a { font-family: 'Times New Roman', Times, serif; }
a { font-family: "SomeFontVersion6", "sake_case_font"; }
a { font-family: Arial, sans-serif; }
a { font: 1em 'Times New Roman', Times, serif; }

Further Reading