Skip to main content

Harshal V. LADHE

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(), and clamp() — CSS's Value-Bounding Functions

    Three 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.
    Published at:
    Categories:CSS
    Estimated reading time:5 min read
  • Tutorial:Animating height: auto in CSS with interpolate-size

    Animate 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.
    Published at:
    Categories:Animations
    Estimated reading time:9 min read
  • Tutorial:Auto-Growing Textareas with CSS field-sizing: content

    Auto-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.
    Published at:
    Categories:CSS
    Estimated reading time:8 min read
  • Tutorial:Conditional CSS Values with the if() Function

    Swap 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.
    Published at:
    Categories:CSS
    Estimated reading time:7 min read
  • Tutorial:CSS Custom Functions with @function: Reusable Logic Without Sass

    Native, 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.
    Published at:
    Categories:CSS
    Estimated reading time:10 min read