Skip to content

Theme

Text

Learn how to change the text size, alignment, and font-weight.

Typeface

We use the Roboto font family by Google. Add this line to the <head> of your widgets to use this font:

<link href="https://fonts.googleapis.com/css?family=Roboto:400,400i,700,700i" rel="stylesheet">

Font Size

The base font size is 16px. It's applied by default.

Note, that if an element doesn't have a class it inherits all font properties from its parent. This means that you can add a class once, and it will be applied to all child elements (if they don't have a class that overrides the parent class).

Use these classes to change the font size:

CSS Class Font Size / Line Height
.text-sm12px / 16px
.text-md14px / 20px
.text-lg16px / 24px
.h320px / 28px
.h224px / 32px
.h128px / 36px
.h036px / 44px
.title248px / 56px
.title160px / 68px

Font Weight, Decoration, and Alignment

CSS Class Result
.text-boldBold text
.text-normalNormal text (default)
.text-underlineUnderlined text
.text-italicItalic text
.text-leftLeft-aligned text (default)
.text-centerCenter-aligned text
.text-rightRight-aligned text

You can also use responsive alignment.
Example: text with .text-center.text-md-left.text-lg-right.text-xl-center classes will be center-aligned on screens up to 679px, left-aligned on screens up to 879px, right-aligned on screens up to 1179px, and center-aligned on larger screens.

Text Wrapping & Truncation

CSS Class Result
.text-wrapVery long text that wraps words (default behaviour)
.text-wrap-allVery long text that wraps letters
.text-nowrapVery long text that don't wrap
.text-keep-newlines

Keeps the line breaks from the source text (for example user-entered text), while still wrapping long lines.

.text-truncate
Text that truncates if there's not enough space, so this long sentence ends with an ellipsis instead of wrapping to the next line.

Text that truncates if there's not enough space. Please note that it must be placed in a container that has an overflow: hidden. You can add the .overflow-hidden class to its parent container.

.line-clamp-{1–10}

Text limited to two lines with .line-clamp-2. Anything that doesn't fit is cut off with an ellipsis at the end of the last visible line, which is handy for card descriptions and previews of long content.

Limits text to 1–10 lines and adds an ellipsis. Unlike .text-truncate, it needs no extra container.

Lists & Paragraphs

By default text paragraphs (<p>) don't have bottom margins. You can add them manually by using .mb-8 or similar classes.

CSS Class Effect Result
ul.list-unstyled
ol.list-unstyled
Removes bullet points from the list
  • One
  • Two
  • Three
ul.list-inline
ol.list-inline
Produces inline list (implicitly makes a flex layout)
  • One
  • Two
  • Three
.list-disc Restores solid bullets on a nested list (browsers switch nested lists to hollow circles)
  • Item
    • Nested item with a solid bullet
li.list-item-unstyled Removes the bullet from an <li> that isn't inside a <ul> or <ol>, e.g. a dragged list item Used inside components (not shown)

Links use the theme's link color (--link-color). Keyboard users see a focus ring around a focused link.

CSS Class Effect Result
a.link-unstyled Removes link styling completely Unstyled link
.underline-links Underlines every link inside the element. The app sets it on <html>, as this styleguide does Underlined link
a.inset-focus-indicator Draws the keyboard focus ring inside the link instead of around it, for links that fill a clipped container. Press Tab to see it Inset focus ring

Highlights & Other Elements

Element Effect Result
mark.mark-highlight Yellow highlight, e.g. for search matches Search for design tokens
mark.mark-bold Marks text in bold without a background Search for design tokens
kbd Keyboard key Press Ctrl + K
hr Divider line in the border color

Content above


Content below