nercone.devaboutlinkscontactsitemap
aboutlinkssitemap82ffc6419

Typography

Text elements need no classes. font.css defines the fonts and the font utility classes.

Font families

Each family is a variable and a class of the same name. The Nercone fonts are variable fonts that cover Latin and CJK; they are loaded from assets.nercone.dev unless they are installed. The families after them are fallbacks.

Variable and classFirst fontFallbacks
--font-family-sansNercone Sans CJKInter, Noto Sans JP/SC/TC/KR, sans-serif
--font-family-serifNercone Serif CJKCharter, Noto Serif JP/SC/TC/KR, serif
--font-family-monoNercone Mono CJKMeslo, Noto Sans JP/SC/TC/KR, monospace
--font-family-sans-nfNercone Sans CJK NFSame as sans
--font-family-serif-nfNercone Serif CJK NFSame as serif
--font-family-mono-nfNercone Mono CJK NFSame as mono

The page uses sans. <code> and <pre> use mono-nf. The -nf families include the Nerd Fonts icons.

Sans: The quick brown fox jumps over the lazy dog. 0123456789 あのイーハトーヴォのすきとおった風、夏でも底に冷たさをもつ青いそら。

Serif: The quick brown fox jumps over the lazy dog. 0123456789 あのイーハトーヴォのすきとおった風、夏でも底に冷たさをもつ青いそら。

Mono: The quick brown fox jumps over the lazy dog. 0123456789 あのイーハトーヴォのすきとおった風、夏でも底に冷たさをもつ青いそら。

Mono NF:     

<p class="font-family-serif">…</p>
font-family: var(--font-family-mono-nf);

Headings

Headings use --color-foreground-alt. <h1> and <h2> have a border below them, and get space above them when they are direct children of <main>.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Text

This is a paragraph. The quick brown fox jumps over the lazy dog. 0123456789 あのイーハトーヴォのすきとおった風、夏でも底に冷たさをもつ青いそら。

Bold (b), strong, italic (i), emphasis (em), underline (u), strikethrough (s), link (a), code, Ctrl + C (kbd), highlight (mark), small, H2O (sub), x2 (sup), HTML (abbr).

Links keep the color of the text around them and are underlined. <strong> is bold in --color-foreground-alt, so it stands out more than <b>. <mark> is --color-mark-foreground on --color-mark-background: yellow-bright (yellow-40 in the light themes) on yellow-opacity-10, or black on jis-yellow in the UD themes.

Lists

  1. Load style.css
  2. Load a theme
  3. Write plain HTML
Block
An area with a border.
Layer
An area with a background.

Quotes and rules

Write programs that do one thing and do it well.


Code

<pre> has a border and scrolls horizontally when its content is too wide. Inline <code> breaks inside a word when the word does not fit on a line.

(() => {
    const toast = window.nercone.get('toast');
    document.querySelector('form').addEventListener('submit', () => toast.show('Saved', { variant: 'success' }));
})();

Images

The nercone.dev banner
images/banner.svg

Font weights

Named weights are variables (--font-weight-{name}) and classes (font-weight-{name}). The numeric classes font-weight-100 to font-weight-1000 are the same weights.

thin (100) — The quick brown fox jumps over the lazy dog. 0123456789

extralight (200) — The quick brown fox jumps over the lazy dog. 0123456789

light (300) — The quick brown fox jumps over the lazy dog. 0123456789

regular (400) — The quick brown fox jumps over the lazy dog. 0123456789

medium (500) — The quick brown fox jumps over the lazy dog. 0123456789

semibold (600) — The quick brown fox jumps over the lazy dog. 0123456789

bold (700) — The quick brown fox jumps over the lazy dog. 0123456789

extrabold (800) — The quick brown fox jumps over the lazy dog. 0123456789

black (900) — The quick brown fox jumps over the lazy dog. 0123456789

extrablack (1000) — The quick brown fox jumps over the lazy dog. 0123456789

Font sizes

The classes use the keywords of CSS, so they follow the font size set by the user.

font-size-xx-small

font-size-x-small

font-size-small

font-size-medium

font-size-large

font-size-x-large

font-size-xx-large

font-size-xxx-large

Relative to the parent: font-size-smaller and font-size-larger.

Style and decoration

font-style-italic, font-style-normal on <i>, font-decoration-underline, font-decoration-overline, font-decoration-line-through, and font-decoration-none on <a>.

Font variants

The font-variant-* classes set the CSS font-variant properties. Glyphs that the font does not have are left as they are.

ClassSample
font-variant-caps-smallSmall Caps
font-variant-caps-all-smallAll Small Caps
font-variant-caps-petitePetite Caps
font-variant-caps-all-petiteAll Petite Caps
font-variant-caps-unicaseUnicase
font-variant-caps-titlingTitling Caps
font-variant-ligatures-noneoffice fi fl -> =>
font-variant-ligatures-commonoffice fi fl -> =>
font-variant-ligatures-discretionaryct st Th
font-variant-ligatures-historicalct st Th
font-variant-ligatures-no-contextual-> => !=
font-variant-numeric-tabular1111
8888
font-variant-numeric-proportional1111
8888
font-variant-numeric-oldstyle0123456789
font-variant-numeric-lining0123456789
font-variant-numeric-slashed-zero0 O 0
font-variant-numeric-ordinal1st 2nd 3rd
font-variant-numeric-diagonal-fractions1/2 3/4
font-variant-numeric-stacked-fractions1/2 3/4
font-variant-position-subH2O
font-variant-position-superx2
font-variant-historical-formshistorical s

Each group also has classes that reset it: font-variant-normal, font-variant-caps-normal, font-variant-ligatures-normal, font-variant-numeric-normal, and font-variant-position-normal. The ligature groups can be turned off one by one with font-variant-ligatures-no-common, -no-discretionary, -no-historical, and turned back on with -contextual.

Text colors

See Colors for the fg-color-* classes.