[ @sdxc/u/overflow ]
overflow-inline
Applies overflow-inline, independently of the block axis.
import { overflowInline } from "@sdxc/u/overflow";Quick reference
Every documented call, beside the CSS it emits.
| Call | CSS |
|---|---|
u.overflowInline("auto") | css({ overflowInline: "auto" }) |
Examples
Basic example
Use overflowInline("auto") to let an element scroll along the inline axis, horizontally in a left-to-right page, when its content does not fit. Scroll the row sideways:
1
2
3
4
5
<div
mix={[overflowInline("auto"), hstack({ gap: 4 }), is(96), maxIs("100%"), p(4), ...]}
>
<div mix={[shrink(), is(24), ...]}>1</div>
<div mix={[shrink(), is(24), ...]}>2</div>
<div mix={[shrink(), is(24), ...]}>3</div>
<div mix={[shrink(), is(24), ...]}>4</div>
<div mix={[shrink(), is(24), ...]}>5</div>
</div>Clipping the inline axis
Call overflowInline(), which applies hidden, to clip content that overflows along the inline axis:
1
2
3
4
5
<div mix={[overflowInline(), hstack({ gap: 4 }), is(96), maxIs("100%"), p(4), ...]}>
<div mix={[shrink(), is(24), ...]}>1</div>
<div mix={[shrink(), is(24), ...]}>2</div>
<div mix={[shrink(), is(24), ...]}>3</div>
<div mix={[shrink(), is(24), ...]}>4</div>
<div mix={[shrink(), is(24), ...]}>5</div>
</div>Applying on a state
Wrap the call in a state utility to scope it to one selector.
u.hover(u.overflowInline("auto"))Responsive design
Wrap the call in a container query to scope it to one width.
u.at("md", u.overflowInline("auto"))Signature
u.overflowInline(value?: OverflowValue)