Theme and tokens

Looma controls the colors and typography. Markupress controls the documentation layout. Start with a stylesheet, then adjust the parts you need.

Start with a stylesheet

Add your site's styles to MarkupKit's configuration:

// markupkit.config.ts
import { defineConfig } from '@threadlabs/markupkit';

export default defineConfig({ css: ['app/site.css'] });

Then choose a font and sidebar width:

/* app/site.css */
:root {
  --ui-font-sans: "Inter", system-ui, sans-serif;
  --markupress-sidebar-width: 17rem;
}
Load your font

A font stack chooses a font; it does not download one. Load Inter in your site, or use system-ui, sans-serif to use the reader's system font.

Build a coordinated palette

The default palette is an exported Looma theme. To replace it with your own identity, use the Looma customizer. It creates light and dark palettes together, including readable text, selected rows, focus rings and status colors.

  1. Choose a starting theme, then adjust its palette and typography.
  2. Check both light and dark previews.
  3. Export the CSS and keep the editable recipe alongside it.
  4. Load the exported CSS before your site's layout adjustments.
One palette for the whole site

Theme the shared Looma properties instead of styling the internals of individual controls. Navigation, search, buttons and documentation then use the same visual language.

Colors and typography

Looma propertyUse
--ui-font-sansBody text and interface controls.
--ui-font-displayHeadings; falls back to the body font when unset.
--ui-font-monoCode.
--ui-surface, --ui-surface-raised, --ui-surface-sunkenThe page, raised content and recessed regions.
--ui-text, --ui-text-secondary, --ui-text-mutedBody text and supporting information.
--ui-accentPrimary action fill.
--ui-link-colorLink text, when supplied by your theme; otherwise the accent is used.
--ui-selection-*Selected navigation and choices.
--ui-focus-ringKeyboard focus.
--ui-border, --ui-radius-sm, --ui-radius-mdRules, edges and corners.

See Looma's token reference for the full set.

Layout widths

Markupress propertyDefaultUse
--markupress-page-width90remMaximum width of the header, columns and footer.
--markupress-content-width54remMaximum width of the content column, including its padding.
--markupress-sidebar-width18remSidebar width on wide screens.
--markupress-outline-width13remWidth of the “On this page” outline.
--markupress-home-width75remMaximum width of a home page.
--markupress-backgroundvar(--ui-surface)Documentation shell background; accepts a color, texture or gradient.

Light and dark modes

The appearance button cycles through Automatic, Light and Dark. Automatic follows the operating system. An explicit choice is remembered and applied before the page paints.

If your application supplies its own switch, set data-theme="light" or data-theme="dark" on the document root. Remove the attribute to follow the system. A nested theme boundary affects only its descendants.

How styles reach the page

Looma's tokens, light/dark themes and Markupress's document defaults are page-wide styles, delivered through MarkupKit's css option.

Each Markdown page imports styles/prose.css. Those rules stop at embedded component boundaries. The shell styles its own header, sidebar and columns; page-wide rules cover MarkupKit's breadcrumbs and pager.

With the standalone Markdown plugin, markdown({ styles: [file] }) imports the given stylesheets into every Markdown page component.

The reading area uses Looma’s --ui-surface-content; the header and footer use --ui-surface-chrome. Both follow the applied theme’s canvas, with the reading area lighter than the surrounding chrome. You can override these public surface roles in your theme.

Edit this page

Last updated