Skip to main content

Place Self

Set individual item justification & alignment simultaneously.

View as Markdown
baselinewidely
ClassCSS
ps:autoplace-self: auto;
ps:cplace-self: center;
ps:eplace-self: end;
ps:splace-self: start;
ps:stplace-self: stretch;

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

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