Skip to main content

woff2-before-woff

Require woff2 entries before woff entries.

Rule catalog ID: R009

Targeted pattern scopeโ€‹

  • Ordering of comma-separated src entries in @font-face.

What this rule reportsโ€‹

  • Source lists where a woff source appears before a woff2 source.

Why this rule existsโ€‹

Ordering woff2 first helps capable browsers select the smallest supported file immediately.

โŒ Incorrectโ€‹

@font-face {
src: url("./inter.woff") format("woff"), url("./inter.woff2") format("woff2");
}

โœ… Correctโ€‹

@font-face {
src: url("./inter.woff2") format("woff2"), url("./inter.woff") format("woff");
}

Further readingโ€‹