## CSS Custom Properties: @property Is Now Universal CSS custom properties (`--variable`) have been around since 2017, but `@property` - which adds types, defaults, and animation - was experimental until recently. In 2026, it's universally supported and changes how we build design systems. ## Browser Support (2026) | Browser | Support | Notes | |---------|---------|-------| | Chrome 85+ | Full | Since Aug 2020 | | Edge 85+ | Full | Chromium-based | | Firefox 128+ | Full | Since July 2024 | | Safari 15.4+ | Full | Since March 2022 | **Global support: ~95%** No more polyfills or fallbacks needed for most audiences. ## The @property Game Changer ### Before: Untyped Variables ```css :root { --primary-color: #3b82f6; --spacing: 16px; --opacity: 0.8; } /* Problems: 1. Can't animate custom properties 2. No type checking - any value accepted 3. No fallback for inheritance issues */ ``` ### After: Typed Variables with @property ```css @property --primary-color { syntax: ''; inherits: true; initial-value: #3b82f6; } @property --spacing { syntax: ''; inherits: true; initial-value: 16px; } @property --opacity { syntax: ''; inherits: false; initial-value: 0.8; } ``` ## The Three Powers of @property ### 1. Type Safety with `syntax` Define what values are valid: ```css @property --angle { syntax: ''; inherits: false; initial-value: 0deg; } @property --percentage { syntax: ''; inherits: false; initial-value: 0%; } @property --size { syntax: ' | '; inherits: true; initial-value: 100%; } /* Invalid values are ignored */ .element { --angle: red; /* Ignored - not an angle */ --angle: 45deg; /* Works */ } ``` Available syntax types: - `` - px, rem, em, etc. - `` - numeric values - `` - percentage values - `` - any color value - `` - deg, rad, turn - `