CSS Functions
Modern CSS functions such as `clamp()`, `min()`, `max()`, and `if()` that compute values directly in the browser.
Content tagged css-functions
Tutorial:
contrast-color(): Automatic Readable Text on Any BackgroundLet CSS choose readable white or black text automatically.Use CSS contrast-color() to pick white or black text for any background colour: how the spec defines it, custom properties and brand colours, buttons and tags, pairing with light-dark(), mid-tone limits, and an @supports fallback.Tutorial:The CSS
shape()Function: Responsiveclip-pathShapesCut responsive curved shapes with CSS shape() and clip-path.Draw responsive clip-path shapes with the CSS shape() function: lines, curves and arcs in %, calc() and custom properties, plus browser support and fallbacks.Tutorial:CSS Custom Functions with
@function: Reusable Logic Without SassNative, reusable CSS functions with parameters — no Sass needed.Define native CSS custom functions with @function: typed parameters, defaults, fallbacks for older browsers, how they differ from Sass, and when to use them.Tutorial:HTML Attributes as Real CSS Values with Typed
attr()Read HTML attributes as CSS colours, lengths and numbers.Typed attr() reads an HTML attribute as a real CSS value — type(<color>), type(<integer>), a unit like % or px, or raw-string — for any property on any element, not just text in content. Covers fallbacks for missing or invalid values, patterns for layout, transitions and view transitions, safe fallbacks in browsers without support, and when a custom property is the better choice.Tutorial:CSS-Only Staggered Animations with
sibling-index()andsibling-count()Stagger animations from each element's own position, without JavaScript.sibling-index() and sibling-count() give an element its own 1-based position and its sibling total directly inside calc() — replacing the JavaScript loop that sets a --i custom property, with fixed-step and fixed-total staggers, index-driven colours and rotations, fallbacks, and reduced-motion handling.