← All notes

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

Sources

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

Permanent ID: iil:note:f39n1wjh

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.},
}

Markdown

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.

All artifact files (JSON index)

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.