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 class | First font | Fallbacks |
|---|---|---|
--font-family-sans | Nercone Sans CJK | Inter, Noto Sans JP/SC/TC/KR, sans-serif |
--font-family-serif | Nercone Serif CJK | Charter, Noto Serif JP/SC/TC/KR, serif |
--font-family-mono | Nercone Mono CJK | Meslo, Noto Sans JP/SC/TC/KR, monospace |
--font-family-sans-nf | Nercone Sans CJK NF | Same as sans |
--font-family-serif-nf | Nercone Serif CJK NF | Same as serif |
--font-family-mono-nf | Nercone Mono CJK NF | Same 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
- Apple
- Orange
- Mandarin
- Ponkan
- Grape
- Load
style.css - Load a theme
- 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
images/banner.svgFont 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.
| Class | Sample |
|---|---|
font-variant-caps-small | Small Caps |
font-variant-caps-all-small | All Small Caps |
font-variant-caps-petite | Petite Caps |
font-variant-caps-all-petite | All Petite Caps |
font-variant-caps-unicase | Unicase |
font-variant-caps-titling | Titling Caps |
font-variant-ligatures-none | office fi fl -> => |
font-variant-ligatures-common | office fi fl -> => |
font-variant-ligatures-discretionary | ct st Th |
font-variant-ligatures-historical | ct st Th |
font-variant-ligatures-no-contextual | -> => != |
font-variant-numeric-tabular | 1111 8888 |
font-variant-numeric-proportional | 1111 8888 |
font-variant-numeric-oldstyle | 0123456789 |
font-variant-numeric-lining | 0123456789 |
font-variant-numeric-slashed-zero | 0 O 0 |
font-variant-numeric-ordinal | 1st 2nd 3rd |
font-variant-numeric-diagonal-fractions | 1/2 3/4 |
font-variant-numeric-stacked-fractions | 1/2 3/4 |
font-variant-position-sub | H2O |
font-variant-position-super | x2 |
font-variant-historical-forms | historical 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.