Skip to main content

Font Size

Set the font size for an element.

View as Markdown
baselinewidely

Variants

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

Breakpoints

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

@xs:fs:3xlFrom 32rem up.
@sm:fs:3xlFrom 40rem up.
@md:fs:3xlFrom 48rem up.
@lg:fs:3xlFrom 64rem up.
@xl:fs:3xlFrom 80rem up.
@xxl:fs:3xlFrom 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:fs:3xlContainer from 32rem up.
@c:sm:fs:3xlContainer from 40rem up.
@c:md:fs:3xlContainer from 48rem up.
@c:lg:fs:3xlContainer from 64rem up.
@c:xl:fs:3xlContainer from 80rem up.
@c:xxl:fs:3xlContainer 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:fs:3xlOn a touch screen.
@prm:fs:3xlWith reduced motion on.
@st:fs:3xlOn the first frame.

States

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

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

Pseudo Elements

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

a::fs:3xlOn ::after.
b::fs:3xlOn ::before.
p::fs:3xlOn ::placeholder.
s::fs:3xlOn ::selection.