Skip to main content

no-absolute-font-url

Disallow absolute root-relative font URLs in @font-face.

Rule catalog ID: R018

Targeted pattern scopeโ€‹

  • url("/...") font paths inside @font-face src.

What this rule reportsโ€‹

  • Root-relative font URLs that can break under sub-path deployments.

Why this rule existsโ€‹

Relative URLs are safer across GitHub Pages paths, reverse proxies, and nested app routes.

โŒ Incorrectโ€‹

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

โœ… Correctโ€‹

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

Further readingโ€‹