Skip to content

Search documentation

Search guides, examples, and component APIs.

Quick links
↑↓ NavigateEnter OpenEsc Close
Get started

Documentation navigation

Guide

Typography

Weini defines typography in its shared theme. The same sizes, line heights, weights, and text roles work in your app, the components you install, and these docs.

Install the type system

Import the Weini foundation after Tailwind. base.css provides the scale and roles; default.css provides the font fallbacks and colors. Add nebula-font.css if you want the bundled Nebula Sans faces.

app.css
@import "tailwindcss";
@import "@getweini/vue/styles/base.css";
@import "@getweini/vue/styles/default.css";
@import "@getweini/vue/styles/nebula-font.css"; /* optional */

The scale belongs to @getweini/vue, so it is available wherever the Weini theme is imported. Changing a docs class alone does not change installed components.

Use text roles

Start with a role for page content. Roles include their size, line height, and weight. Display and section roles also set tighter tracking. The fluid roles adjust between mobile and desktop widths without a separate breakpoint class.

text-display-heroclamp(3.5rem, 16vw, 6rem)Landing page hero
text-displayclamp(2.25rem, 4vw, 3.5rem)Page title
text-section-titleclamp(2rem, 3vw, 2.5rem)Major section title
text-card-title1.25remCard and subsection title
text-body-lg1.0625remShort introduction
text-body1remMain reading copy
text-body-sm0.9375remCompact reading copy
text-caption0.8125remSupporting detail
text-label0.75remShort uppercase label

Page title

A clearer starting point

Section title

Build with confidence

Reading copy

One steady body size makes a page easier to read.

A quieter supporting detail.

Page.vue
<template>
  <p class="text-label uppercase">Getting started</p>
  <h1 class="font-display text-display">Build with Weini</h1>
  <p class="text-body">Readable copy for the main content.</p>
  <p class="text-caption text-muted-foreground">Updated today</p>
  <button class="text-sm font-medium">Continue</button>
</template>

Use text-body for ordinary reading. Reserve text-body-lg for short introductions; use text-caption and text-label only for brief supporting text. Pair heading roles with the matching semantic heading element.

Everyday size scale

The numbered Tailwind sizes are neutral building blocks. Each has a Weini line height, tracking, and normal 400 weight. A component can add font-medium or font-semibold without changing the shared size rule.

text-xs0.75rem1.5 lineShort metadata and dense controls
text-sm0.875rem1.5 lineControls and navigation
text-base1rem1.5 lineDefault interface text
text-lg1.125rem1.55 lineEmphasized copy
text-xl1.25rem1.4 lineSmall headings
text-2xl1.5rem1.3 lineSection headings
text-3xl1.875rem1.2 linePage headings
text-4xl2.25rem1.15 lineLarge headings
text-5xl3rem1.1 lineDisplay text
text-6xl3.75rem1.05 lineLarge display text

A size class does not make text bold. Apply a weight when the content calls for emphasis. text-sm is 14px with a 21px line height and 400 weight by default.

Choose a weight

Use 400 for paragraphs, 500 for control labels that need a little emphasis, 600 for section headings, and 700 for strong display text. Nebula Sans also includes light (300) and black (900) faces when a product needs them.

Book400
Medium500
Semibold600
Bold700

Override a role

Standard Tailwind utilities can override a role's weight, line height, or tracking. Use responsive variants when content needs a different reading size on a narrow screen. Keep control labels aligned with the sm, md, and lg component size progression.

Typography overrides
<template>
  <h1 class="text-display">A page title</h1>
  <p class="text-body-sm md:text-body">Responsive reading copy.</p>
  <p class="text-sm font-semibold leading-relaxed">A stronger small label.</p>
</template>

Change the font

--type-sans controls body text and controls, --type-display controls headings, and --type-mono controls code. Load your font first, then set the family variables after the theme imports.

Your app CSS
/* Add below the Weini imports in your app CSS. */
:root {
  --type-sans: Georgia, serif;
  --type-display: Georgia, serif;
  --type-mono: ui-monospace, monospace;
}

Leave out @getweini/vue/styles/nebula-font.css when using another font. The older --weini-font-family override remains supported for the sans and display families.

Readability checks

Keep long reading passages at the body size, let lines wrap, and check the page at narrow widths and enlarged browser text. WCAG does not require a single default font size; it asks that text can grow to 200% and that content reflows without losing information.

Nebula Sans is distributed under the SIL Open Font License. The bundled license includes the required copyright notice.