CSS @property: give a custom property a type and initial value
Answer: If you create a custom property only by setting a value, it can be any type. It also inherits.
What @property adds
The @property rule is how you get more control.
syntax names the types of CSS values that are valid for the property.
Creating the property with @property also lets you disable inheritance.
An initial-value is required unless syntax is the wildcard for any CSS type.
Then the property always has a value of the specified syntax and is never undefined.
Why it exists
CSS Houdini names a set of low-level APIs.
Those APIs expose parts of the CSS rendering engine.
Developers also gain access to the CSS Object Model.
That is how you tell the browser how to read and parse custom CSS.
See also
Claims
- id: C1 claim: An ordinary custom property can be any type and inherits. source: S1 evidence: "created by setting a value can be any type, and inherits"
- id: C2 claim: The @property rule gives more control over a custom property. source: S1 evidence: "you can use the @property rule"
- id: C3 claim: The syntax value sets which CSS types are valid. source: S1 evidence: "sets the types of CSS values that are valid for the property"
- id: C4 claim: CSS Houdini exposes parts of the CSS rendering engine. source: S2 evidence: "low-level APIs that expose parts of the CSS rendering engine"
Sources
- [S1] Custom properties. web.dev. https://web.dev/learn/css/custom-properties . License: CC-BY-4.0. Accessed 2026-11-24.
- [S2] @property: Giving superpowers to CSS variables. web.dev. https://web.dev/articles/at-property . License: CC-BY-4.0. Accessed 2026-11-24.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: web.dev, Custom properties; web.dev, @property: Giving superpowers to CSS variables. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: web.dev, Custom properties; web.dev, @property: Giving superpowers to CSS variables. CC-BY-4.0 (https://web.dev/learn/css/flexbox). Copyright Google LLC. web.dev text is CC BY 4.0.
Cite this
iinventedlight. 2026. "CSS @property: give a custom property a type and initial value." iinventedlight Library, iil:note:f39n1wjh, version of 2026-11-24. https://iinventedlight.com/library/notes/css-at-property/. License: CC-BY-4.0.
@misc{iil_note_f39n1wjh,
author = {{iinventedlight}},
title = {{CSS @property: give a custom property a type and initial value}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-24},
url = {https://iinventedlight.com/library/notes/css-at-property/},
note = {Permanent ID iil:note:f39n1wjh. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- css-at-property.schema.json (schema; CC-BY-4.0)
- css-at-property.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/css-at-property.md.