Skip to main content

Font Style

Set the font style for an element.

View as Markdown
baselinewidely
ClassCSS
fs:ifont-style: italic;
fs:nfont-style: normal;

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

a::fs:nOn ::after.
b::fs:nOn ::before.
p::fs:nOn ::placeholder.
s::fs:nOn ::selection.