noUndeclaredCustomProperties (CSS)
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/noUndeclaredCustomProperties - This rule doesn’t have a fix.
- The default severity of this rule is information.
- This rule belongs to the following domains:
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noUndeclaredCustomProperties": "error" } } }}Description
Section titled “Description”Reports custom properties used with var() that have no visible declaration.
This rule checks custom properties defined by declarations such as --theme: blue,
registrations such as @property --theme, imported stylesheets, linked stylesheets, and
<style> blocks in HTML-like files. Files that aren’t imported by the project
aren’t analyzed.
Locally scoped styles in Vue, Svelte, and Astro are visible only within their component. Global styles can provide custom properties to imported child components.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”a { color: var(--link-color);}:root { --link-color: blue;}
a { color: var(--link-color);}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.