Skip to main content

Font Variant Numeric

Set how numbers are drawn for an element.

View as Markdown
baselinewidely
ClassCSS
fvn:nfont-variant-numeric: normal;
fvn:ofont-variant-numeric: ordinal;
fvn:szfont-variant-numeric: slashed-zero;
fvn:lnfont-variant-numeric: lining-nums;
fvn:onfont-variant-numeric: oldstyle-nums;
fvn:pnfont-variant-numeric: proportional-nums;
fvn:tnfont-variant-numeric: tabular-nums;
fvn:dffont-variant-numeric: diagonal-fractions;
fvn:sffont-variant-numeric: stacked-fractions;

Variants

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

Breakpoints

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

@xs:fvn:onFrom 32rem up.
@sm:fvn:onFrom 40rem up.
@md:fvn:onFrom 48rem up.
@lg:fvn:onFrom 64rem up.
@xl:fvn:onFrom 80rem up.
@xxl:fvn:onFrom 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:fvn:onContainer from 32rem up.
@c:sm:fvn:onContainer from 40rem up.
@c:md:fvn:onContainer from 48rem up.
@c:lg:fvn:onContainer from 64rem up.
@c:xl:fvn:onContainer from 80rem up.
@c:xxl:fvn:onContainer 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:fvn:onOn a touch screen.
@prm:fvn:onWith reduced motion on.
@st:fvn:onOn the first frame.

States

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

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

Pseudo Elements

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

a::fvn:onOn ::after.
b::fvn:onOn ::before.
p::fvn:onOn ::placeholder.
s::fvn:onOn ::selection.