Skip to content

Text

Size, weight, color, alignment and spacing for type.

Type is styled with three properties. font sets the typeface: size, family, weight and letter spacing. text sets how the text sits on the page: color, line height, line length, alignment and decoration. format handles case and wrapping.

A heading and a readable paragraph
<h2 class="font:h4:semibold:tight text:grey-3:snug">…</h2>
<p class="font:base text:grey:relaxed:blog">…</p>

font

ModifierValuesCompiles to
Sizetiny, eyebrow, small, base, h6, h5, h4, h3, h2, h1, display (type scale)font-size
Familysans, serif, mono, rounded: each the operating system’s own font, with fallbacksfont-family
Weightthin 100, extra-light 200, light 300, regular 400, medium 500, semibold 600, bold 700, extra-bold 800, black 900font-weight
Letter spacingextra-tight -0.04em, tight -0.02em, normal 0, wide 0.02em, wider 0.05em, widest 0.1emletter-spacing

The default families use the fonts already on each device, like San Francisco on Apple devices and Segoe UI on Windows, so they look native and load instantly. To use a brand font, load it in your CSS and point a family token at it in elevate/core/system/design/typography.ts. Letter spacing is in em, so it scales with the text: tight on a headline does as much as tight on body copy.

text

ModifierValuesCompiles to
ColorAny color tokencolor
Line heightnone 1, hug 1.2, snug 1.3, normal 1.4, relaxed 1.5, loose 1.6, spacious 1.7, extra-spacious 1.8line-height
Line lengthnote 20ch, blob 35ch, brief 45ch, blog 65ch, book 70ch, essay 75ch, full 80chmax-width
Alignmentleft, center, right, justifytext-align
Decorationunderline, overline, line-through, underline-overline, underline-line-through, overline-line-through, underline-overline-line-through, no-decorationtext-decoration

text:none sets line-height: 1. To remove an underline, use text:no-decoration.

format

ModifierValuesCompiles to
Caseuppercase, lowercase, capitalizetext-transform
Hyphensnone, manual, autohyphens
White spacenormal, no-wrap, pre, pre-line, pre-wrap, break-spaceswhite-space
Word breakall (break-all), keep (keep-all), word (break-word), break-normalword-break
Overflow wrapbreak-word, anywhere, wrap-normaloverflow-wrap

format:normal sets white-space. The other two axes use break-normal and wrap-normal.

One line, cut off with an ellipsis
<p class="format:no-wrap overflow:hidden text-overflow:ellipsis">…</p>

More type properties

Each of these is its own property.

PropertyValuesExample
font-stylenormal, italic, obliquefont-style:italic
font-variantnormal, small-caps, all-small-caps, petite-caps, all-petite-caps, unicase, titling-capsfont-variant:small-caps
font-stretchultra-condensed, extra-condensed, condensed, semi-condensed, normal, semi-expanded, expanded, extra-expanded, ultra-expandedfont-stretch:condensed
text-indentA spacing tokentext-indent:d4
text-overflowclip, ellipsistext-overflow:ellipsis
text-renderingauto, optimizeSpeed, optimizeLegibility, geometricPrecisiontext-rendering:optimizeLegibility
word-spacingA spacing tokenword-spacing:d1
tab-sizeA numbertab-size:4
writing-modehorizontal-tb, vertical-rl, vertical-lr, sideways-rl, sideways-lrwriting-mode:vertical-rl
directionltr, rtldirection:rtl
unicode-bidinormal, embed, bidi-override, isolate, isolate-override, plaintextunicode-bidi:isolate
line-clampA numberline-clamp:3
text-decoration-colorA color tokentext-decoration-color:indigo+2
text-decoration-stylesolid, dashed, dotted, double, groove, ridge, inset, outset, none, hiddentext-decoration-style:dotted
text-decoration-thicknessA spacing tokentext-decoration-thickness:d0

line-clamp writes only the standard line-clamp property. Browsers that need the older -webkit-line-clamp with display: -webkit-box won’t clamp from this class alone.