woff2-before-woff
Require woff2 entries before woff entries.
Rule catalog ID: R009
Targeted pattern scopeโ
- Ordering of comma-separated
srcentries in@font-face.
What this rule reportsโ
- Source lists where a
woffsource appears before awoff2source.
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");
}