SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

display

Sets display: block.

tsx
import { block } from "@sdxc/u/layout";

Quick reference

Every documented call, beside the CSS it emits.

CallCSS
u.block()css({ display: "block" })

Examples

Basic example

Use block() to make an element a block box that starts on its own line and fills the width of its parent:

When an inline span becomes a block,block()it breaks out of the line of text it sat in and stretches across the paragraph.

tsx
<p mix={[maxIs(96), ...]}>
	When an inline span becomes a block,
	<span mix={[block(), ...]}>block()</span>
	it breaks out of the line of text it sat in and stretches across the paragraph.
</p>

Applying on a state

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

typescript
u.hover(u.block())

Responsive design

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

typescript
u.at("md", u.block())

Signature

typescript
u.block()
@sdxc/u

Can’t find it? Contact us