Skip to main content

local-src-before-url

Require local(...) entries before url(...) entries in @font-face src.

Rule catalog ID: R006

Targeted pattern scopeโ€‹

  • Comma-separated source lists in @font-face src.

What this rule reportsโ€‹

  • Lists where the first network URL appears before a local source.

Why this rule existsโ€‹

Prioritizing local(...) avoids unnecessary requests when fonts are already installed.

โŒ Incorrectโ€‹

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

โœ… Correctโ€‹

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

Further readingโ€‹