Modern CSS Features of 2025
Recently supported CSS features and units worth adopting now, from dynamic viewport units to conditional values.
Content tagged css-2025
Tutorial:
min(),max(), andclamp()— CSS's Value-Bounding FunctionsThree comparison functions that pick a value from a rule, without a single media query.min(), max(), and clamp() pick the smallest, largest, or a bounded value from a list of CSS expressions at the point of use, replacing media-query-driven overrides for readable measures, safe-area-aware insets, and bounded widths with one declaration each.Tutorial:Animating
height: autoin CSS withinterpolate-sizeAnimate height to auto in pure CSS, no JavaScript.Animate height: auto in CSS with interpolate-size and calc-size(): smooth accordions and details panels without JavaScript, plus fallbacks and reduced motion.Tutorial:Auto-Growing Textareas with CSS
field-sizing: contentAuto-grow textareas with one line of CSS, no JavaScript.Make a textarea grow and shrink with its text using CSS field-sizing: content: no scrollHeight JavaScript, plus size limits, fallbacks and browser support.Tutorial:Conditional CSS Values with the
if()FunctionSwap CSS values by media, supports, or style conditions.The if() function picks between several values inside one CSS declaration based on a media(), supports(), or style() condition — collapsing what used to require duplicating an entire rule under @media/@supports, or a JS class toggle, into one line, with a fallback for browsers that don't support it yet.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.