Skip to main content

Getting Started

cosmos is a CSS-only theme plugin for Docusaurus 3 — aligned with the Rackscope Void/Slate design system. No component swizzling, no JavaScript, pure CSS.

Zero config

Drop it in and every Docusaurus native element is styled automatically. No customCss entry needed.

Installation

npm install cosmos-docusaurus-theme

Setup

Add the theme to the themes array in docusaurus.config.js:

docusaurus.config.js
export default {
themes: ['cosmos-docusaurus-theme'],
themeConfig: {
colorMode: {
defaultMode: 'dark',
respectPrefersColorScheme: true,
},
},
};
Alternative — direct CSS import

If you prefer to import the CSS manually instead of using the theme plugin:

presets: [['classic', { theme: { customCss: ['cosmos-docusaurus-theme/css/theme.css'] } }]]

What's included

Native Docusaurus elements

Everything styled automatically — no classes, no configuration required:

ElementNotes
Navbar — ghost buttons, brand, toggleCOSMOS wordmark · brand indigo title
Sidebar — icons, sub-menu line, version badgeclassName: 'sidebar-cat-*' for icons
Breadcrumb — ChevronRight separatorAutomatic, brand hover
Tabs — flat underline, brand activeimport Tabs from '@theme/Tabs'
Pagination — sublabel monospace, brand hoverAutomatic prev / next
Code blocks — all languages, titlesLine highlighting supported
Admonitions — Toast style, semantic icons5 types: note / tip / info / warning / danger
Tables — full-width desktop, scroll mobileAutomatic
Cards — rounded-2xl, dark shadow, hover<div className="card">
Tags — pill style, brand hover<span className="tag">
Details / summary — accordion style<details><summary>
TOC — active pill, H2/H3 hierarchyRight panel
Blockquote — brand left border> markdown syntax
<kbd> — chip style, 3D border<kbd>Ctrl</kbd>
Images — rounded-xl, shadow![alt](src) in markdown
<abbr title> — tooltip on hover<abbr title="...">
Back-to-top + progress barAutomatic
Algolia DocSearch--docsearch-* variables overridden
Local search (easyops-cn)--search-local-* variables overridden

Utility classes (MDX)

Optional classes for MDX pages — full reference at Utility Classes:

ClassPurpose
.btn .btn-primary .btn-secondary .btn-dangerCTA buttons in docs pages
.badge-new .badge-beta .badge-deprecated .badge-experimentalRelease lifecycle labels
.method-get/post/put/delete/patchHTTP method labels for API docs
.status-ok/warn/crit/unknownOperational health indicators
.steps on <ol>Numbered procedure guide
.timeline on <ul>Version history / changelog
.list-check on <ul>Feature checklist

Requirements

  • Docusaurus 3.0+ Required
  • Node.js 18+
  • Docker — optional for zero-install preview
note

CSS-only — no React components, no swizzling, no JavaScript runtime.