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.
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-elementsbut 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.
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 */
}
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