Skip to content

Interpolate Size

The CSS interpolate-size property enables smooth transitions to and from keyword sizes like auto, min-content, and max-content. Without it, CSS cannot animate between a fixed size and auto.

Browser Support

interpolate-size is supported in Chromium browsers only (~48% of users). Firefox and Safari do not support it yet.

Import

Included in @import 'tw-jib-css/experimental'. To import individually:

css
@import 'tw-jib-css/experimental/interpolate';

Quick Reference

Class Styles
interpolate-numericinterpolate-size: numeric-only
interpolate-keywordsinterpolate-size: allow-keywords
interpolate-[<value>]interpolate-size: <value>

Basic Usage

Add interpolate-keywords to a parent element to enable smooth height transitions for its children:

Values

ValueBehaviour
numeric-onlyDefault browser behaviour — only numeric-to-numeric transitions work. 0pxauto will snap.
allow-keywordsEnables transitions involving keyword sizes (auto, min-content, max-content, fit-content).