What is CSS inline-size?
inline-size is a logical CSS property — in the default horizontal, left-to-right writing mode it behaves exactly like width, but it's defined relative to the text flow (the "inline" axis) rather than a fixed physical direction. That means the same clamp() value keeps working correctly if the writing mode or text direction changes.
Example:
inline-size: clamp(320px, calc(203.636px + 36.364vw), 640px);Same fluid scaling as a width clamp(), just expressed with the logical property name.
inline-size vs. width: When to Use Which
- ✅ Use
inline-sizefor components that need to work correctly under RTL languages (Arabic, Hebrew) or vertical writing modes. - ✅ Use
inline-sizefor design-system components meant to be direction-agnostic by default. - ✅
widthis fine when the layout is always horizontal, left-to-right, and RTL support isn't a requirement. - ✅ The clamp() math is identical either way — only the property name changes.
inline-size, min-inline-size & max-inline-size
inline-size— a self-contained fluid size along the inline axis.min-inline-size— a floor for flex/grid items or percentage-based sizes.max-inline-size— a ceiling so a fluid or percentage-based element never grows too wide.
👉 Switch between them using the property buttons above the calculator.
Live Preview
A live preview appears below the inputs with a slider that simulates a viewport width across your configured min/max range — no need to actually resize your browser. The dashed frame represents the simulated viewport and the solid bar inside represents the resulting value, both scaled by the same factor so the proportion on screen is accurate.
Export as CSS Variable, SCSS, or Tailwind
The generated code isn't limited to a plain CSS declaration. Choose an output format above the code box:
- CSS —
inline-size: clamp(...); - CSS Variable —
--card-inline-size: clamp(...); - SCSS —
$card-inline-size: clamp(...); - Tailwind —
'card-inline-size': 'clamp(...)',ready to paste intotailwind.config.js
Using inline-size Carefully
- Don't mix
inline-sizeandwidthon the same element. Whichever declaration comes last in the cascade wins — pick one property per axis to avoid confusing overrides. - It only affects block-level and replaced elements, exactly like
width— setdisplay: inline-block,block, orflexon inline elements first. - Flex and grid items still need an explicit
min-inline-size. They default to an automatic minimum that can override a fluidinline-sizeand cause overflow with long unbroken content. - 100vw still includes the scrollbar on a full-bleed element, same caveat as
width— cap the max at something like98vwif the element reaches the viewport edge.
Inline-Size Clamp Generator FAQs
What is inline-size in CSS?
inline-size is the logical, writing-mode-aware equivalent of width. In the default horizontal, left-to-right writing mode it behaves exactly like width — but it automatically adapts if the writing mode or text direction changes.
Should I use inline-size or width?
For most everyday layouts either works. Prefer inline-size when you're building components that need to work correctly in RTL languages (Arabic, Hebrew) or vertical writing modes (some Japanese/Chinese layouts) — it removes an entire class of direction-specific bugs.
What's the difference between inline-size, min-inline-size, and max-inline-size?
inline-size sets a fluid, self-contained size along the inline axis. min-inline-size sets a floor a flexible element will never shrink below. max-inline-size sets a ceiling for a fluid or percentage-based element. All three accept the same clamp() output from this tool.
Does inline-size have the same browser support as width?
Yes — CSS logical properties including inline-size have been supported in all major browsers since 2021, so support is no longer a practical concern for most projects.
Can I export the inline-size clamp value as a CSS variable, SCSS, or Tailwind?
Yes. Switch the output format above the code box to CSS Variable, SCSS, or Tailwind, and edit the name field to control the variable or config key used.
Is this inline-size clamp generator free to use?
Yes, it's completely free with no login required, and works offline once the page has loaded.
Related Tools
- Width Clamp Generator (physical equivalent)
- Block-Size Clamp Generator (logical height)
- Layout & Spacing Clamp Generator
- ClampGenerator Homepage