Configuration¶
Everything you can configure in Lumina — theme options, accent colors, and a complete reference.
Recommended Configuration¶
Most projects benefit from a few extensions and settings beyond the defaults. Here’s a practical starting point:
extensions = [
"myst_parser", # Write docs in Markdown
"sphinx_design", # Cards, grids, tabs, badges
"sphinx_copybutton", # Copy button on code blocks
]
html_theme = "lumina"
html_theme_options = {
"accent_color": "#10b981", # Emerald (default)
"source_repository": "https://github.com/you/your-project", # Enables "Edit on GitHub"
"source_branch": "main",
"source_directory": "docs/",
}
Tip
See Custom Styling for CSS custom properties, custom fonts, and template overrides.
Theme Options Reference¶
All options go in html_theme_options in your conf.py. Every option has a sensible default, so you only need to set what you want to change.
Appearance¶
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Primary brand color used for links, active states, and accents. Any valid CSS color. |
|
string |
|
Syntax highlighting preset. Sets matched Pygments styles for light and dark modes. Options: |
|
string |
|
Initial color mode. |
|
string |
|
Controls wide content layout ( |
|
string |
|
When |
|
string |
|
Logo image for light mode (path relative to |
|
string |
|
Logo image for dark mode (path relative to |
|
string |
|
Use a Lucide icon as the site logo instead of an image. Pass the icon name (e.g. |
|
string |
|
Display size in pixels for |
Tip
Why 24 and not 28? Lucide icons are designed on a 24×24 grid with 2-unit-wide strokes. When a Lucide icon is rendered at a size that isn’t a clean multiple of 24, those strokes land on fractional device pixels and the browser anti-aliases them across two columns of pixels — the icon looks subtly fuzzy. Stick to 24, 48, or 72 for a crisp logo.
Announcement¶
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
HTML content for a dismissible banner above the header. Supports links and inline formatting. Users can dismiss it; the preference persists in |
Doc Sections¶
Option |
Type |
Default |
Description |
|---|---|---|---|
|
list |
|
Define major documentation sections with icons and colors. Adds a dropdown at the top of the sidebar that lets readers switch between sections, each with its own navigation tree. See Navigation for setup. |
Version Switcher¶
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
URL to a JSON file listing available documentation versions. Enables a version dropdown in the header. |
|
string |
|
The current version string to highlight in the dropdown. Should match a |
Search¶
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Search implementation. |
HTTP API¶
These options control the interactive features on HTTP API endpoint pages. They require sphinxcontrib-openapi or sphinxcontrib-httpdomain. See OpenAPI for setup.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
Default base URL for all HTTP API endpoints. Enables the “Copy as curl” button and “Try it out” panel. Individual blocks can override this with a |
|
string |
|
Set to |
Source Links¶
These options enable the “Edit on GitHub” link in the table of contents sidebar.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
string |
|
URL to your source repository (e.g., |
|
string |
|
Branch name used in edit links. |
|
string |
|
Path to the docs directory within your repository. |
|
string |
|
URI path component for edit links. Use |
Accent Colors¶
The accent_color option controls links, active navigation items, buttons, and other interactive elements. It applies to both light and dark modes automatically.
Here are some well-tested color choices:
Color |
Hex |
Best for |
|---|---|---|
Emerald |
|
Default. Clean and professional. |
Blue |
|
Traditional documentation feel. |
Violet |
|
Creative and modern projects. |
Rose |
|
Bold, attention-grabbing. |
Amber |
|
Warm, energetic. Ensure contrast on light backgrounds. |
Teal |
|
Calm, technical feel. |
Warning
Choose a color with sufficient contrast against both light and dark backgrounds. Avoid very light colors (pastels) — they become unreadable on white backgrounds.
Full Configuration Example¶
Here’s a conf.py using every theme option:
html_theme = "lumina"
html_theme_options = {
# Appearance
"accent_color": "#10b981",
"dark_mode_default": "auto",
"logo_only": "false",
"light_logo": "logo-light.svg",
"dark_logo": "logo-dark.svg",
# Announcement
"announcement": 'New in v2.0 — <a href="/changelog">see what changed</a>!',
# Navigation
"nav_links": [
{"title": "Guide", "url": "getting-started"},
{
"title": "Reference",
"children": [
{"title": "Typography", "url": "reference/typography"},
{"title": "Code Blocks", "url": "reference/code-blocks"},
],
},
{"title": "GitHub", "url": "https://github.com/you/project", "external": True},
],
"nav_depth": "4",
"show_toc": "true",
"show_breadcrumbs": "true",
"show_prev_next": "true",
"show_attribution": "true",
"show_back_to_top": "true",
# Doc sections
"doc_sections": [
{
"name": "User Documentation",
"description": "Installation, guides & reference",
"icon": "book-open",
"color": "#10b981",
"default": True,
"link": "getting-started/index",
},
{
"path": "contributing",
"name": "Developer Documentation",
"description": "Architecture & development",
"icon": "code",
"color": "#8b5cf6",
},
],
# Version switcher
"version_switcher_json": "https://example.com/versions.json",
"version_switcher_match": "1.17",
# Search
"search_backend": "pagefind",
# HTTP API interactive features
"api_base_url": "https://api.example.com/v1",
"try_it_out": "true",
# Source links (enables "Edit on GitHub")
"source_repository": "https://github.com/you/project",
"source_branch": "main",
"source_directory": "docs/",
"edit_uri": "edit",
# Footer & social
"social_links": [
{"icon": "github", "url": "https://github.com/you/project"},
],
"footer_text": "Built with Sphinx and Lumina.",
}
Next Steps¶
Go deeper with CSS custom properties, custom fonts, syntax highlighting themes, and template overrides.