Skip to main content
/
/
/
Typography

Typography

Font guidelines and desktop/print files

TLDR

Typography styles are not applied by default. To enable Bifrost typography styling throughout your app, wrap your application in the .bf-elements class:

HTML
<div class="bf-elements">
  <!-- Your entire app -->
  <h1>This heading will be styled</h1>
  <p>This paragraph will be styled</p>
</div>

This applies styles to all headings, paragraphs, links, lists, etc. without needing individual classes on each element. See .bf-elements and .bf-content below for more details.

Fonts

Use Satoshi for headings, and Open Sans for anything else.

They should automatically be included and applied by our css bundle (bifrost-all.css for css setup or bifrost-app.css for React).

You can either use the headers found in the documentation below (like .bf-h1 or .bf-content), or set the font explicitly through .bf-open-sans and .bf-satoshi;

The quick brown fox jumps over Satoshi
The quick brown fox jumps over Open Sans

Headers

H1 The quick brown fox jumps over the lazy dog

H2 The quick brown fox jumps over the lazy dog

H3 The quick brown fox jumps over the lazy dog

H4 The quick brown fox jumps over the lazy dog

H5 The quick brown fox jumps over the lazy dog

Paragraphs

Large (regular) - The quick brown fox jumps over the lazy dog

Large (italic) - The quick brown fox jumps over the lazy dog

Large (bold) - The quick brown fox jumps over the lazy dog

Medium (regular) - The quick brown fox jumps over the lazy dog

Medium (italic) - The quick brown fox jumps over the lazy dog

Medium (bold) - The quick brown fox jumps over the lazy dog

Small (regular) - The quick brown fox jumps over the lazy dog

Small (italic) - The quick brown fox jumps over the lazy dog

Small (bold) - The quick brown fox jumps over the lazy dog

CSS classes

Some additional utility classes are provided for styling common elements.

A .bf-p paragraph with some .bf-small text, a .bf-link, and a .bf-code. Here's some .bf-strong text and some .bf-em emphasized text

bf-elements

Recommended for most apps: Wrap your entire application in .bf-elements to automatically apply Bifrost typography styles to all headings, paragraphs, lists, and other elements without needing to add classes to each element individually.

This approach gives you consistent styling throughout your app without adding extra margins or spacing, making it ideal for application layouts where you want better control over spacing via gap when using <Grid>, <AutoCol>, display: flex, or display: grid etc.

The class also applies a default medium font-size (14px), so you typically won't need .bf-medium.

HTML
<div class="bf-elements">
  <h1>Styled heading without needing .bf-h1</h1>
  <p>Styled paragraph without needing .bf-p</p>
  <ul>
    <li>Styled list items without needing .bf-ul or .bf-li</li>
  </ul>
</div>

bf-content

Use for dynamic content you don't control: When rendering content from a CMS, API response, or other external source where you can't add classes to individual elements, use .bf-content instead.

This does the same as .bf-elements but also adds margins between elements, making it perfect for article-style content blocks where automatic spacing is desired.

<h1> heading 1

<h2> heading 2

<h3> heading 3

<h4> heading 4

<h5> heading 5

A <p> paragraph with some <small> text, <a> link, and some <code>. Both <strong> strong and <b> bold text looks the same. As does <em> emphasized and <i> italic.

  • Unordered list
  • <ul> inside .bf-content
    • Nested
    • List
  • Items
  1. Ordered (numbered) list
  2. <ol> inside .bf-content
  3. Items

bf-toc

See table of contents documentation at css/list

CSS font-size variables

These variables only store the font size (in px value), not font-family, line-height or weight etc. Usually you will want to use the .bf-h1 etc classes above instead.

CSS
.myClass {
  font-size: var(--bf-font-size-m); /* sets the font size to 14px */
}
CSS variableSizePreview
--bf-font-size-s12pxLorem ipsum dolor sit amet
--bf-font-size-m14pxLorem ipsum dolor sit amet
--bf-font-size-l16pxLorem ipsum dolor sit amet
--bf-font-size-h518pxLorem ipsum dolor sit amet
--bf-font-size-h420pxLorem ipsum dolor sit amet
--bf-font-size-h324pxLorem ipsum dolor sit amet
--bf-font-size-h229pxLorem ipsum dolor sit amet
--bf-font-size-h132pxLorem ipsum dolor sit amet

Highlight active header

Table of Contents code example

Use .bf-hightlight-target on an element to enable hightlighting on descendant headings (h1-h6) when linking to them using their id (like this style guide does).

HTML
<article class="bf-highlight-target">
  <a href="#my-heading">Scroll to "my heading"</a>
  <h3 id="my-heading">My heading</h3>
</article>

When clicking on this "scroll to" link or opening a new browser tab with a url including the hash, the <h3> should play a highlight animation: scale slightly 3 times, bfc-theme colored and fade back to default color over a 12s duration.

Interactive demo

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Heading 1

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Heading 2

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Heading 3

Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Heading 4

Curabitur pretium tincidunt lacus. Nulla gravida orci a odio. Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Long words and URLs

Long words will often make text overflow or stretch its container. If you want to contain long words you can use the .bf-break-word css class.

Some text inside .bf-break-word withareallylongwordthatismadeupfortestingpurposes in the middle
Some default rendering text withareallylongwordthatismadeupfortestingpurposes in the middle

Font CSS playground

The quick brown fox jumps over the lazy dog
Ligatures disabled f t ft fi