Skip to content

noUndeclaredCustomProperties (HTML)

biome.json
{
"linter": {
"rules": {
"nursery": {
"noUndeclaredCustomProperties": "error"
}
}
}
}

Reports custom properties used with var() that have no visible declaration.

<div style="color: var(--text-color)"></div>
code-block.html:1:24 lint/nursery/noUndeclaredCustomProperties ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

ℹ The custom property --text-color is not defined.

> 1 │ <div style="color: var(--text-color)"></div>
│ ^^^^^^^^^^^^
2 │

ℹ An undeclared custom property can indicate a misspelled name or a missing declaration.

ℹ Define the custom property in an available stylesheet, rename it or remove it.

ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.

<div style="--text-color: blue; color: var(--text-color)"></div>