Median

Site themes

Style your public site with CSS variables and stable part names.

Updated Oct 1, 20262 minute read

Custom CSS loads after the theme, so your rules win without !important. Write it in Site → Appearance → Custom CSS, or push a file from the CLI.

:root {
  --site-accent: #0f766e;
  --site-radius-lg: 6px;
  --site-control-radius: 6px;
}

[data-part="hero-title"] {
  font-family: "Fraunces", serif;
  letter-spacing: -0.02em;
}
median site css pull theme.css
median site css push theme.css

Cascade

@layer reset, base, theme, brand;
LayerHolds
resetBrowser defaults cleared
baseLayout and default tokens
themeThe theme you picked
brandThe brand color from Appearance
Your CSSUnlayered, so it beats every layer

Light and dark

<html data-theme="paper" data-scheme="dark">

Put dark values under [data-scheme="dark"]:

:root[data-scheme="dark"] {
  --site-bg: #05070a;
}

data-navigation on <html> is top or sidebar, from Site → Appearance. Sidebar lists each topic's articles under it and is what a site gets until it picks. Sidebar, topics only (topics in the API and CLI) is also sidebar.

:root[data-navigation="sidebar"] {
  --site-sidebar-width: 240px;
}

Tokens

TokenUse
--site-bgPage background
--site-surface, --site-surface-2, --site-surface-3Cards, fills, raised fills
--site-border, --site-border-strongLines
--site-text, --site-text-muted, --site-text-faintText
--site-accent, --site-accent-textBrand color and text on it
--site-accent-soft, --site-accent-strongDerived from the accent
--site-link, --site-focus, --site-selectionLinks, focus rings, selection
--site-tone-gray, -red, -orange, -yellow, -green, -teal, -blue, -purple, -pinkColors for feedback statuses, boards and tags
--site-dangerErrors
--site-font-body, --site-font-heading, --site-font-monoFont families
--site-text-sizeBase font size
--site-heading-weight, --site-heading-trackingHeadings
--site-radius-sm, --site-radius, --site-radius-lgCorners
--site-control-radiusButtons, tabs and nav links
--site-shadow-sm, --site-shadow, --site-shadow-lgShadows
--site-width, --site-reading-widthPage and article widths
--site-gutter, --site-header-heightSpacing
--site-ease, --site-ease-in-outEasing
--site-duration-fast, --site-duration, --site-duration-slowTiming

Parts

Target elements with [data-part="<name>"]. States use data-state, data-active, aria-current and aria-pressed. Parts a team colors carry data-tone, which sets --tone.

AreaParts
Framesite, header, brand, brand-logo, brand-name, nav, nav-indicator, nav-link, scheme-toggle, main, footer, powered-by
Sidebarsidebar, sidebar-bar, sidebar-nav, sidebar-group, sidebar-heading, sidebar-item, sidebar-menu, drawer, drawer-panel
Sidebar with articlessidebar-branch, sidebar-row, sidebar-toggle, sidebar-leaves, sidebar-leaf, sidebar-section, collapse, caret
Pagespage, page-header, page-title, page-description, breadcrumbs, breadcrumb-current, section, section-title, empty
Controlsbutton (data-variant: primary, secondary, ghost), input, textarea, status (data-tone)
Composercomposer (data-surface, data-mode, data-results), composer-frame, composer-chip, composer-row, composer-lead, composer-attach, composer-input, composer-modes, composer-mode, composer-send, composer-results
Help center homehero, hero-title, search (data-mode), search-result, search-ask, popular-list, popular-link, article-icon, collection-grid, collection-card, collection-icon, collection-name, collection-description, collection-preview, collection-count, contact
Articlesarticle-layout, article-sidebar, article, article-head, article-title, article-lead, article-meta, prose, table, code-block, code-title, code-copy, toc, toc-marker, toc-link, toc-fold, toc-fold-toggle, article-pager, pager-link
Listsarticle-list, article-row, article-row-title, article-row-excerpt
Supportsupport, support-thread, support-greeting, support-avatar (data-size), support-starter, support-divider, support-message (data-sender), support-byline, support-bubble (data-sender), support-markdown, support-typing, support-source, support-copy, support-attachment, support-foot, support-waiting, support-notice, support-composer, support-tab
Feedbackfeedback, notice, feedback-tabs, feedback-tab, board-list, board-link, list-toolbar, segmented, list-search, filter-button, post-list, post-card, post-card-title, post-card-excerpt, chip (data-kind), vote (data-voted, data-layout), avatar, team-badge
Postspost-view, post-title, post-body, post-aside, follow, timeline, comment (data-team), status-line, comment-form, post-composer, similar
Roadmaproadmap, roadmap-column, roadmap-header, roadmap-card, roadmap-card-title
Dialogsdialog, dialog-panel, dialog-title, form
Sign-inaccount, account-trigger, account-avatar, account-menu (data-state), account-name, account-email, account-item, auth-status (data-state)

article-sidebar is hidden. Show it with custom CSS for a list of the collection's articles beside each article.

Themes

ThemeLookFonts
PaperLight and roomy, a glow behind the searchGeist, Geist Mono

The Console theme is retired. Sites that used it show Paper, and the API refuses "theme": "console".

Limits

LimitValue
Custom CSS60,000 characters
@import and @font-faceAllowed
ScriptsNot supported

Still need help?

    Esc