Skip to main content

Scroll Padding

Set the scroll padding for snapping & alignment.

View as Markdown
baselinewidely

The same values work with spb, spie, spis, spl, spr, spt, spx & spy, as in spy:4.

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

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