Skip to main content

Padding

Set the padding for an element.

View as Markdown
baselinewidely

The same values work with py, pbe, pbs, pb, px, pie, pis, pl, pr & pt, as in pt:4.

Variants

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

Breakpoints

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

@xs:p:4From 32rem up.
@sm:p:4From 40rem up.
@md:p:4From 48rem up.
@lg:p:4From 64rem up.
@xl:p:4From 80rem up.
@xxl:p: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:p:4Container from 32rem up.
@c:sm:p:4Container from 40rem up.
@c:md:p:4Container from 48rem up.
@c:lg:p:4Container from 64rem up.
@c:xl:p:4Container from 80rem up.
@c:xxl:p: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:p:4On a touch screen.
@prm:p:4With reduced motion on.
@st:p:4On the first frame.

States

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

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

Pseudo Elements

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

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