Docs / Theming / Custom CSS

Custom CSS

How to extend and override Dustavez's styles while maintaining design consistency.

Dustavez’s styles are built entirely on CSS custom properties, making it straightforward to customize the appearance without modifying component source code.

Overriding tokens

The simplest way to customize Dustavez is to override CSS custom properties in src/styles/tokens.css. All components reference these properties, so changes propagate automatically.

src/styles/tokens.css
:root {
/* Change the accent color */
--accent: #8B5CF6;
--accent-subtle: #F3F0FF;
/* Adjust the content width */
--content-w: 720px;
}

Adding custom styles

For styles beyond token overrides, add a new CSS file and import it in src/styles/global.css:

src/styles/custom.css
/* Custom styles for your documentation */
.article img {
border-radius: var(--radius);
border: 1px solid var(--border);
}
src/styles/global.css
@import './reset.css';
@import './tokens.css';
@import './typography.css';
@import './animations.css';
@import './custom.css';

Scoped component styles

Each Astro component uses scoped <style> blocks, meaning styles don’t leak between components. If you need to override a specific component’s styles, use the :global() modifier in a parent component or add styles targeting the component’s class names in your custom CSS file.

Warning

Resist the urge to override too many styles. Dustavez’s visual consistency comes from its constrained design system. If you find yourself overriding many properties, consider whether your changes are improving readability or just adding visual noise.


CSS architecture

The styles are organized into focused files:

FilePurpose
reset.cssMinimal box-sizing and smoothing reset
tokens.cssCSS custom properties (light + dark)
typography.cssFont faces, type scale, article prose styles
animations.cssEntrance animation keyframes
global.cssImports all above, selection, scrollbar styles
Last updated: April 4, 2026
Edit this page on GitHub