The CSS `@function` at-rule is an experimental feature that lets developers define reusable custom CSS functions with typed parameters, default values, and return types. Functions are defined with dashed-ident names (e.g. `--my-func`), can accept typed arguments, support comma-separated list inputs, and return a single value via the `result` descriptor. They follow the CSS cascade, support conditional at-rules like `@media` and `@container` inside their body, allow nesting of other custom functions, and scope internal custom properties locally. Unlike `@mixin`, they cannot produce side effects or multiple declarations. Circular dependencies are caught and invalidated by the browser. Browser support is currently limited (Chrome 148+).

Table of contents
SyntaxArguments and DescriptorsBasic UsageType CheckingComma-Separated ListsConstructs and the CSS CascadeDefaultsNo Side EffectsCircular DependenciesSpecificationBrowser SupportMore Information35.6K Impressions1 Comment