Skip to main content

font-recommended

font-recommended enables the curated default policy for modern CSS/SCSS font loading.

It includes declaration correctness, src ordering/format guidance, duplicate detection, and fallback-performance checks.

Rules in this configโ€‹

Fix legend: ๐Ÿ”ง = autofixable ยท โ€” = report only

RuleFixDescription
consistent-font-displayโ€”Require @font-face declarations in the same file to use a consistent font-display value.
consistent-font-family-casing๐Ÿ”งRequire consistent font-family casing across @font-face declarations.
local-src-before-url๐Ÿ”งRequire local(...) entries to appear before url(...) entries in @font-face src.
no-absolute-font-urlโ€”Disallow absolute root-relative font URLs in @font-face src declarations.
no-data-uri-srcโ€”Disallow data: URL font sources in @font-face src.
no-duplicate-descriptors-in-font-faceโ€”Disallow duplicate descriptor declarations within a single @font-face block.
no-duplicate-font-faceโ€”Disallow duplicate @font-face blocks that share the same font-family + font-style + font-weight variant.
no-duplicate-font-family-srcโ€”Disallow duplicate src URLs across @font-face blocks that share the same font-family name.
no-duplicate-src-formatโ€”Disallow duplicate explicit format() hints within a single @font-face src declaration.
no-empty-font-faceโ€”Disallow empty @font-face declaration blocks that contain no descriptors.
no-font-face-in-selectorsโ€”Disallow @font-face rules nested inside regular CSS selectors.
no-generic-family-in-font-faceโ€”Disallow CSS generic family keywords as font-family descriptor values inside @font-face blocks.
no-http-font-urlโ€”Disallow plain http:// URLs in @font-face src declarations.
no-invalid-font-displayโ€”Disallow invalid font-display descriptor values in @font-face blocks.
no-invalid-font-styleโ€”Disallow invalid font-style descriptor values in @font-face blocks.
no-invalid-font-weightโ€”Disallow invalid font-weight descriptor values in @font-face blocks.
no-invalid-unicode-rangeโ€”Disallow invalid unicode-range descriptor values in @font-face blocks.
no-legacy-formats๐Ÿ”งDisallow legacy @font-face formats (eot, svg, truetype) in modern projects.
no-missing-fallback-before-web-fontโ€”Disallow web-font-first font-family stacks that omit a fallback family.
no-overlapping-unicode-rangeโ€”Disallow overlapping unicode-range subsets across @font-face blocks that share the same family/style/weight tuple.
no-protocol-relative-font-urlโ€”Disallow protocol-relative URLs (//) in @font-face src declarations.
no-src-format-mismatchโ€”Disallow @font-face src entries where the URL file extension contradicts the explicit format() hint.
no-unquoted-font-family-in-font-face๐Ÿ”งRequire the font-family descriptor value inside @font-face to be quoted.
no-whitespace-in-unquoted-family๐Ÿ”งDisallow unquoted whitespace-containing font-family names.
prefer-variable-fontsโ€”Prefer variable-font workflows when the same family defines many static @font-face weight variants.
prefer-woff2โ€”Prefer including a woff2 source in every @font-face src list.
require-font-display๐Ÿ”งRequire font-display in every @font-face declaration block.
require-font-family-in-font-faceโ€”Require a font-family descriptor in every @font-face declaration block.
require-font-style๐Ÿ”งRequire explicit font-style in every @font-face block.
require-font-weight๐Ÿ”งRequire explicit font-weight in every @font-face block.
require-format-hint๐Ÿ”งRequire format(...) hints for url(...) sources in @font-face src values.
require-src-in-font-faceโ€”Require a src descriptor in every @font-face declaration block.
require-system-font-fallback๐Ÿ”งRequire regular selector font-family stacks to end with a system fallback.
require-unicode-range-for-large-familyโ€”Require unicode-range for families that define four or more @font-face blocks in the same file.
woff2-before-woff๐Ÿ”งRequire woff2 entries to appear before woff entries in @font-face src.