CSS @property At-Rule

Beginner
3 examples
Updated: Nov 2026

Definition and Usage

The @property at-rule registers a custom property. You set its syntax type, whether it inherits, and an initial value. Typed properties animate more predictably than plain -- variables.

CSS Syntax

syntax.css
@property --brand {
  syntax: "<color>";
  inherits: true;
  initial-value: #0f766e;
}

Key Parts

PartPurposeTry it
syntaxType string such as "" or ""Try it
inheritsWhether the property inherits like colorTry it
initial-valueFallback when the property is unsetTry it

CSS Examples

Typed color token

example.css
@property --brand {
  syntax: "<color>";
  inherits: true;
  initial-value: #0f766e;
}
.btn { background: var(--brand); }
Try It Yourself

Animatable custom property

example.css
@property --pad {
  syntax: "<length>";
  inherits: false;
  initial-value: 8px;
}
.card { transition: --pad .3s; padding: var(--pad); }
.card:hover { --pad: 20px; }
Try It Yourself

Browser Support

@property is a modern CSS at-rule.

✓ Modern CSS

@property

Check current browsers before relying on advanced behavior.

90% Modern browsers
Google Chrome Recent
Full support
Mozilla Firefox Recent
Full support
Apple Safari Recent
Full support
Microsoft Edge Recent
Full support
@property Modern support

Bottom line: Use progressive enhancement. Keep a readable fallback when a browser ignores the at-rule.

Frequently Asked Questions

Registration adds a type and initial value so browsers can validate and interpolate the value.
No. Plain --tokens still work. Use @property when you need typing or smooth animation.
true means children inherit the value unless they override it.
The declaration is ignored and the property behaves like an unregistered custom property.
Supported in current Chromium, Safari, and Firefox.

Next: @scope

Continue with @scope.

@scope tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

3 people found this page helpful