Skip to main content

Letter Spacing

Set the letter spacing for an element.

View as Markdown
baselinewidely
ClassCSS
ls:0letter-spacing: 0;
ls:1letter-spacing: -.05em;
ls:2letter-spacing: -.025em;
ls:3letter-spacing: .025em;
ls:4letter-spacing: .05em;
ls:5letter-spacing: .1em;

Variants

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

Breakpoints

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

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

States

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

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

Pseudo Elements

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

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

Negative

Put a minus after the colon to negate a value.

ls:-4A minus after the colon.