Skip to main content

require-font-weight

Require explicit font-weight in every @font-face block.

Rule catalog ID: R003

Targeted pattern scopeโ€‹

  • font-weight declarations inside @font-face.

What this rule reportsโ€‹

  • @font-face blocks that omit font-weight.

Why this rule existsโ€‹

Missing weights create ambiguous mapping and make variable/static face upgrades riskier.

โŒ Incorrectโ€‹

@font-face {
font-family: "Inter";
font-style: normal;
src: url("./inter.woff2") format("woff2");
}

โœ… Correctโ€‹

@font-face {
font-family: "Inter";
font-style: normal;
font-weight: 400;
src: url("./inter.woff2") format("woff2");
}

Further readingโ€‹