Skip to main content

require-font-style

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

Rule catalog ID: R002

Targeted pattern scopeโ€‹

  • font-style declarations inside @font-face.

What this rule reportsโ€‹

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

Why this rule existsโ€‹

Explicit style declarations make face selection deterministic across normal and italic variants.

โŒ Incorrectโ€‹

@font-face {
font-family: "Inter";
font-weight: 400;
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โ€‹