Skip to main content

Width

Set the width for an element.

View as Markdown
baselinewidely

The same values work with max-w & min-w, as in min-w:4.

Variants

Prefix any class with a variant to apply it only under that condition. Variants stack, as in @md:h:w:4.

Breakpoints

Apply a class from a viewport width up. Each breakpoint covers its width & every width above it.

@xs:w:4From 32rem up.
@sm:w:4From 40rem up.
@md:w:4From 48rem up.
@lg:w:4From 64rem up.
@xl:w:4From 80rem up.
@xxl:w:4From 96rem up.

Containers

Apply a class from a container's width up, not the viewport's. Mark the parent with ct:is first.

@c:xs:w:4Container from 32rem up.
@c:sm:w:4Container from 40rem up.
@c:md:w:4Container from 48rem up.
@c:lg:w:4Container from 64rem up.
@c:xl:w:4Container from 80rem up.
@c:xxl:w:4Container from 96rem up.

Media

Apply a class when the device or the page matches a condition, or on the first frame an element renders.

@pc:w:4On a touch screen.
@prm:w:4With reduced motion on.
@st:w:4On the first frame.

States

Apply a class only while the element is in a state, such as hovered, focused or checked.

h:w:4On :hover.
f:w:4On :focus.
fv:w:4On :focus-visible.
a:w:4On :active.
d:w:4On :disabled.
fc:w:4On :first-child.
c:w:4On :checked.
e:w:4On :empty.
fw:w:4On :focus-within.
i:w:4On :invalid.
in:w:4On :indeterminate.
lc:w:4On :last-child.
nc:w:4On :nth-child.
r:w:4On :required.
ro:w:4On :read-only.
v:w:4On :valid.

Pseudo Elements

Style a part of the element rather than the element itself, such as its placeholder or the selected text.

a::w:4On ::after.
b::w:4On ::before.
p::w:4On ::placeholder.
s::w:4On ::selection.