Typography
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;
<div class="bf-satoshi">The quick brown fox jumps over Satoshi</div> <div class="bf-open-sans">The quick brown fox jumps over Open Sans</div>
Headers
<h1 class="bf-h1">H1 The quick brown fox jumps over the lazy dog</h1> <h2 class="bf-h2">H2 The quick brown fox jumps over the lazy dog</h2> <h3 class="bf-h3">H3 The quick brown fox jumps over the lazy dog</h3> <h4 class="bf-h4">H4 The quick brown fox jumps over the lazy dog</h4> <h5 class="bf-h5">H5 The quick brown fox jumps over the lazy dog</h5>
Paragraphs
.bf-pfor paragraphs.bf-strongfor bold text.bf-emfor italic text.bf-smallfor small (12px) font-size.bf-mediumfor medium (14px) font-size.bf-largefor large (16px) font-size
<p class="bf-p bf-large"> Large (regular) - The quick brown fox jumps over the lazy dog </p> <p class="bf-p bf-large bf-em"> Large (italic) - The quick brown fox jumps over the lazy dog </p> <p class="bf-p bf-large bf-strong"> Large (bold) - The quick brown fox jumps over the lazy dog </p> <p class="bf-p bf-medium"> Medium (regular) - The quick brown fox jumps over the lazy dog </p> <p class="bf-p bf-medium bf-em"> Medium (italic) - The quick brown fox jumps over the lazy dog </p> <p class="bf-p bf-medium bf-strong"> Medium (bold) - The quick brown fox jumps over the lazy dog </p> <p class="bf-p bf-small"> Small (regular) - The quick brown fox jumps over the lazy dog </p> <p class="bf-p bf-small bf-em"> Small (italic) - The quick brown fox jumps over the lazy dog </p> <p class="bf-p bf-small bf-strong"> Small (bold) - The quick brown fox jumps over the lazy dog </p>
CSS classes
Some additional utility classes are provided for styling common elements.
.bf-linkfor styling<a>tags, also see link styling.bf-codefor inline code or keywords.bf-strongfor bold.bf-emfor italic.bf-ul,.bf-ol, and.bf-lifor lists
<p class="bf-p"> A .bf-p paragraph with some <small class="bf-small">.bf-small text</small>, <a href="#path" class="bf-link">a .bf-link</a>, and a <code className="bf-code">.bf-code</code>. Here's some <strong class="bf-strong">.bf-strong text</strong> and some <em class="bf-em">.bf-em emphasized text</em> </p>
<ul class="bf-ul"> <li class="bf-li">Unordered list</li> <li class="bf-li"> .bf-li inside .bf-ul <ul class="bf-ul"> <li class="bf-li">Nested</li> <li class="bf-li">List</li> </ul> </li> <li class="bf-li">Items</li> </ul>
<ol class="bf-ol"> <li class="bf-li">Ordered (numbered) list</li> <li class="bf-li">.bf-li inside .bf-ol</li> <li class="bf-li">Items</li> </ol>
bf-elements
To apply the above styles to all elements inside a container without resorting
to using the classnames on every element, use the .bf-elements CSS class on a
parent.
This also applies a default medium font-size so you probably won't need
.bf-medium.
<h1 class="bf-h1">bifrost-styled heading</h1>
<div class="bf-elements">
<h1>also a bifrost-styled heading</h1>
</div>
bf-content
To apply the styles to a block of HTML content you don't control, wrap it in
the .bf-content CSS class instead, which does the same as .bf-elements and
also applies margins.
<div class="bf-content"> <h1><h1> heading 1</h1> <h2><h2> heading 2</h2> <h3><h3> heading 3</h3> <h4><h4> heading 4</h4> <h5><h5> heading 5</h5> <p> A <p> paragraph with some <small><small> text</small>, <a href="#path"><a> link</a>, and some <code><code></code>. Both <strong><strong> strong</strong> and <b><b> bold</b> text looks the same. As does <em><em> emphasized</em> and <i><i> italic</i>. </p> <ul> <li>Unordered list</li> <li> <ul> inside .bf-content <ul> <li>Nested</li> <li>List</li> </ul> </li> <li>Items</li> </ul> <ol> <li>Ordered (numbered) list</li> <li><ol> inside .bf-content</li> <li>Items</li> </ol> </div>
bf-toc
For table of contents styling, use the .bf-toc class on
an ordered list. We recommend using the .bf-title-link class on the links:
<ol class="bf-toc"> <li><a href="#path" class="bf-title-link">1st level</a></li> <li> <a href="#path" class="bf-title-link">1st level</a> <ol> <li> <a href="#path" class="bf-title-link">2nd level</a> <ol> <li><a href="#path" class="bf-title-link">3rd level</a></li> <li><a href="#path" class="bf-title-link">3rd level</a></li> </ol> </li> <li><a href="#path" class="bf-title-link">2nd level</a></li> <li><a href="#path" class="bf-title-link">2nd level</a></li> </ol> </li> <li><a href="#path" class="bf-title-link">1st level</a></li> </ol>
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.
.myClass {
font-size: var(--bf-font-size-m); /* sets the font size to 14px */
}
| CSS variable | Size | Preview |
|---|---|---|
--bf-font-size-s | 12px | Lorem ipsum dolor sit amet |
--bf-font-size-m | 14px | Lorem ipsum dolor sit amet |
--bf-font-size-l | 16px | Lorem ipsum dolor sit amet |
--bf-font-size-h5 | 18px | Lorem ipsum dolor sit amet |
--bf-font-size-h4 | 20px | Lorem ipsum dolor sit amet |
--bf-font-size-h3 | 24px | Lorem ipsum dolor sit amet |
--bf-font-size-h2 | 29px | Lorem ipsum dolor sit amet |
--bf-font-size-h1 | 32px | Lorem ipsum dolor sit amet |
Highlight active header
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).
<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).
Sandbox
Here we're using .bf-page-padding for default padding and .bf-toc for table
of contents styling.
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.
<div style="max-width: 300px" class="bfl-grid"> <div class="bf-break-word bfc-success-fade-bg bf-padding"> Some text inside <code>.bf-break-word</code> withareallylongwordthatismadeupfortestingpurposes in the middle </div> <div class="bfc-alert-fade-bg bf-padding"> Some default rendering text withareallylongwordthatismadeupfortestingpurposes in the middle </div> </div>