Theme Structure
Theme settings are nested within theconfiguration object:
quartz.config.ts
Typography
Define fonts for headers, body text, and code blocks.Font Configuration
quartz.config.ts
Font family for headings (h1, h2, h3, etc.). Example:
"Schibsted Grotesk"Font family for body text and paragraphs. Example:
"Source Sans Pro"Monospace font for code blocks and inline code. Example:
"IBM Plex Mono"Font Loading
Where to load fonts from:
"googleFonts"- Load from Google Fonts CDN"local"- Use locally hosted font files
Enable CDN caching for faster font loading. Only applies when
fontOrigin is "googleFonts".- Google Fonts
- Local Fonts
Color Schemes
Quartz supports separate color schemes for light and dark modes. Each mode defines a complete color palette.Color Structure
BothlightMode and darkMode use the same color properties:
Background color for the main content area
Background for secondary UI elements (sidebars, cards)
Border colors and subtle dividers
Secondary text color (metadata, captions)
Primary text color for body content
Primary accent color (links, buttons)
Secondary accent color (hover states, tags)
Background highlight for selections and hover states
Text highlight color (like a marker)
Error and warning text color
Background for error/warning messages
Light Mode Colors
Example from the Siebenlande configuration:quartz.config.ts
Background
light: #faf8f8Warm off-white for comfortable reading
Primary Accent
secondary: #284b63Deep blue for links and interactive elements
Secondary Accent
tertiary: #84a59dMuted sage green for tags and metadata
Dark Mode Colors
Example from the Siebenlande configuration:quartz.config.ts
Background
light: #161618Near-black with subtle warmth
Primary Accent
secondary: #7b97aaDesaturated blue for reduced eye strain
Secondary Accent
tertiary: #84a59dConsistent sage green across both modes
Complete Theme Example
Here’s the full theme configuration from Siebenlande:quartz.config.ts
Color Guidelines
Choosing accessible colors
Choosing accessible colors
Ensure sufficient contrast between text and background colors:
- Body text: Minimum 4.5:1 contrast ratio (WCAG AA)
- Large text (18pt+): Minimum 3:1 contrast ratio
- Use tools like WebAIM Contrast Checker
Light vs. dark mode strategy
Light vs. dark mode strategy
Light mode: Higher contrast, brighter colors
- Use darker text on lighter backgrounds
- More saturated accent colors work well
- Avoid pure white (#ffffff) - use off-white (#ebebec)
- Desaturate accent colors to reduce eye strain
- Lower opacity for highlights and overlays
Using transparency
Using transparency
Transparent colors (rgba) are useful for:
- Highlights:
rgba(143, 159, 169, 0.15) - Text highlights:
#fff23688(hex with alpha) - Overlays: Semi-transparent backgrounds
Semantic color naming
Semantic color naming
Color properties have semantic meanings:
light→dark: Background to foreground hierarchysecondary: Primary interactive elementstertiary: Secondary interactive elementsdanger: Errors, warnings, destructive actions
Popular Font Combinations
- Modern Sans
- Classic Serif
- Mixed Style
- Siebenlande
Testing Your Theme
After configuring your theme:- Build your site:
npx quartz build - Test both modes: Toggle between light and dark mode
- Check contrast: Verify text is readable in all contexts
- Test interactive states: Hover over links, buttons, and other elements
- Validate on devices: Check appearance on desktop, tablet, and mobile
Changes to theme configuration require rebuilding your site to take effect.
Related Configuration
Site Settings
Configure page title, locale, and behavior
Layout Configuration
Organize components and page structure