The post introduces the `@property` at-rule for CSS, which as of Firefox 128 (July 2024) is cross-browser. It details how `@property` can be used to define types, control inheritance, and set initial values for custom properties, helping to prevent errors such as 'invalid at computed value time'. Examples illustrate its use to make CSS more reliable and easier to troubleshoot.

17m read timeFrom moderncss.dev
Post cover image
Table of contents
Standard Use of Custom PropertiesCommon Error Conditions Using Custom PropertiesWhy Traditional Fallbacks Can FailDefining Types for Safer CSSProviding Types via syntaxModifying InheritanceValid Use of initial-valueLimitations of initial-valueExceptions to Dynamic LimitationsMy border is a semi-transparent blueResize the window to see the fluid behaviorConsequences of Setting initial-valueConsiderations For Using @property
2 Comments

Sort: