Typography
Fonts, the type ramp, and the text components.
Each font has one role:
| Role | Font | Token | Used for |
|---|---|---|---|
| Prose | SUSE (variable) | --ore-font-prose | The page default, long-form writing, body copy and captions |
| Display | Cinnangles Ten | --ore-font-display | Titles, display text, modal and card titles, hero buttons |
| Label | Minecraft Regular | --ore-font-label | Labels of controls: buttons, tabs, fields, menus, tags |
| Monospace | Monocraft | --ore-font-monospace | code, kbd, pre and samp, and font="monospace" text |
The stylesheet sets body to the prose font and code, kbd, pre and samp to Monocraft. Components set their own fonts.
Prose
SUSE is a variable font, so every weight from 100 to 900 is drawn rather than synthesized.
The quick brown fox jumps over the lazy dog.
Display
Cinnangles Ten draws Latin, Greek, Cyrillic and symbols, and has one weight. Titles stay regular instead of using a synthetic bold.
CREATE NEW WORLD
Labels
Minecraft Regular has one weight. Use size, color and spacing for hierarchy.
Play · Settings · Marketplace
Monospace
Monocraft draws regular, bold and their italics. Monospace text always has Monocraft's ligatures (its liga feature) and glyph composition (ccmp), and normal letter spacing, because browsers drop ligatures from letter-spaced text. The ligatures cover arrows such as ->, =>, <-, <== and <=>, the operators !=, !==, ==, ===, <= and >=, <!--, NOTE: and TODO:, and runs of +, -, = and ^ up to 31 characters long.
/give @s minecraft:diamond 64
if (count >= 64 && slot != null) => next(); // TODO: <-- ===>
Text components
@bedform/ui has a component for each of Fluent UI 2's typography presets. Each renders a span unless you pass as, such as as="h1".
| Component | Size | Line height | Weight | Font |
|---|---|---|---|---|
Caption2 | 10px | 14px | Regular | Prose |
Caption2Strong | 10px | 14px | Semibold | Prose |
Caption1 | 12px | 16px | Regular | Prose |
Caption1Strong | 12px | 16px | Semibold | Prose |
Caption1Stronger | 12px | 16px | Bold | Prose |
Body1 | 14px | 20px | Regular | Prose |
Body1Strong | 14px | 20px | Semibold | Prose |
Body1Stronger | 14px | 20px | Bold | Prose |
Body2 | 16px | 22px | Regular | Prose |
Subtitle2 | 16px | 22px | Semibold | Prose |
Subtitle2Stronger | 16px | 22px | Bold | Prose |
Subtitle1 | 20px | 28px | Semibold | Prose |
Title3 | 24px | 32px | Regular | Display |
Title2 | 28px | 36px | Regular | Display |
Title1 | 32px | 40px | Regular | Display |
LargeTitle | 40px | 52px | Regular | Display |
Display | 68px | 92px | Regular | Display |
Text takes the same properties as Fluent's: size (100 to 1000), weight (regular, medium, semibold, bold), font (prose, label, display, monospace), italic, underline, strikethrough, block, wrap, truncate and align. The presets take all of them except size, weight and font.
Body holds long-form prose. It renders a div unless you pass as. Its text is 16px with a 1.5 line height, and its children are spaced 0.75em apart; change the spacing with --ore-body-gap.
import { Body, Caption1, Title1 } from "@bedform/ui";
<Body as="article">
<Title1 as="h1">World settings</Title1>
<p>
These settings apply to every player. Run <code>/gamerule</code> to change
them later.
</p>
<Caption1 block>Last changed today.</Caption1>
</Body>;The components render the ore-text and ore-body classes with data attributes, such as data-variant="title1", so ordinary CSS can target them.
Tokens
| Token | Default |
|---|---|
--ore-font-prose | "SUSE", "Noto Sans", "GNU Unifont", sans-serif |
--ore-font-display | "Cinnangles Ten", "Minecraft Regular", "Noto Sans", "GNU Unifont", sans-serif |
--ore-font-label | "Minecraft Regular", "Noto Sans", "GNU Unifont", sans-serif |
--ore-font-monospace | "Monocraft", "Cascadia Mono", Consolas, monospace |
--ore-font-body | var(--ore-font-label); deprecated |
--ore-font-size-100 to --ore-font-size-1000 | 0.625rem to 4.25rem |
--ore-line-height-100 to --ore-line-height-1000 | 0.875rem to 5.75rem |
--ore-font-weight-regular to --ore-font-weight-bold | 400, 500, 600 and 700 |
GNU Unifont and Noto Sans are fallbacks for characters the bundled fonts do not draw. Neither is bundled; load them yourself under those family names.