Skip to main content

Place Items

Set item justification & alignment simultaneously.

View as Markdown
baselinewidely
ClassCSS
pi:bplace-items: baseline;
pi:cplace-items: center;
pi:eplace-items: end;
pi:splace-items: start;
pi:ssplace-items: stretch stretch;

Variants

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

Breakpoints

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

@xs:pi:eFrom 32rem up.
@sm:pi:eFrom 40rem up.
@md:pi:eFrom 48rem up.
@lg:pi:eFrom 64rem up.
@xl:pi:eFrom 80rem up.
@xxl:pi:eFrom 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:pi:eContainer from 32rem up.
@c:sm:pi:eContainer from 40rem up.
@c:md:pi:eContainer from 48rem up.
@c:lg:pi:eContainer from 64rem up.
@c:xl:pi:eContainer from 80rem up.
@c:xxl:pi:eContainer 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:pi:eOn a touch screen.
@prm:pi:eWith reduced motion on.
@st:pi:eOn the first frame.

States

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

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

Pseudo Elements

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

a::pi:eOn ::after.
b::pi:eOn ::before.
p::pi:eOn ::placeholder.
s::pi:eOn ::selection.