Custom styling

Learn how to use custom styling in ctrl-alt-doc.

ctrl alt doc exposes its styling through CSS variables and component classes. Add your overrides to custom.css to change the appearance of your documentation without modifying the framework.

Use ctrl alt doc's layout tokens for broad changes across the site.

css
:root {
	--content-width: 760px;
	--sidebar-width: 260px;
	--toc-width: 220px;
	--header-height: 64px;

	--code-background: #1a1a1a;

	--radius-sm: 6px;
	--radius-md: 8px;
	--radius-lg: 12px;

	--shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.18);
	--shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
}

ctrl alt doc also uses shared typography and theme variables such as --font-sans, --font-mono, --accent, --text, and --text-muted.

For example:

css
:root {
	--font-sans: 'Inter', system-ui, sans-serif;
	--font-mono: 'JetBrains Mono', monospace;
}

Writing overrides #

Prefer CSS variables for broad visual changes and component selectors for targeted changes.

Your custom.css is loaded after CAD's framework styles, so you normally only need to override the properties you want to change.

css
.card {
	border-radius: 16px;
}

.callout {
	background: var(--gray-3);
}

.document {
	width: min(100%, 820px);
}

You do not need to copy the complete original ctrl alt doc rule into custom.css.

More specific customisation #

ctrl alt doc exposes additional classes for internal component elements, states, and responsive behaviour. If you need to customise something more specific, inspect the element in your browser to find its class and override only the properties you need.

Where possible, prefer ctrl alt doc's CSS variables and top-level component classes. These are less coupled to the framework's internal markup and make your customisations easier to maintain.