sdxc

[ @sdxc/u/layout ]

display

Sets display: inline-grid.

import { inlineGrid } from "@sdxc/u/layout";

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.inlineGrid()css({ display: "inline-grid" })

Examples

Basic example

Use inlineGrid() to lay out an element's children on a grid while the element itself flows inline with the text:

Reviewed by and two others before it was merged.
<div mix={[is(96), ...]}>
	Reviewed by{" "}
	<span mix={[inlineGrid(), gridTemplate({ columns: repeat(3, "1.25rem") }), gap(1)]}>
		<span mix={[is(5), bs(5), rounded("full"), bg("brand.solid")]} />
		<span mix={[is(5), bs(5), rounded("full"), bg("success.solid")]} />
		<span mix={[is(5), bs(5), rounded("full"), bg("warning.solid")]} />
	</span>{" "}
	and two others before it was merged.
</div>

Applying on a state

Wrap the call in a state utility to scope it to one selector.

u.hover(u.inlineGrid())

Responsive design

Wrap the call in a container query to scope it to one width.

u.at("md", u.inlineGrid())

Signature

u.inlineGrid()

Written by Sergio Xalambrí. Follow @sergiodxa for new packages, or sponsor the work.