Theming & Appearance

Great Docs ships with a polished default look, but every visual layer of the site is configurable. You can adjust the color scheme, add animated gradients to the navbar and content areas, enable dark mode, display an announcement banner, inject custom HTML into the page head, configure logos, and set up a hero section on your landing page. All of these options live in great-docs.yml.

This page covers the visual customization options. For functional settings (API discovery, parsers, GitHub integration, etc.), see Configuration.

Dark Mode Toggle

Great Docs includes a light/dark mode toggle in the navbar. It respects the visitor’s system preference on first visit and remembers their choice in local storage for subsequent visits. The toggle is enabled by default.

To enable or disable the toggle:

great-docs.yml
dark_mode_toggle: true   # Enabled by default
great-docs.yml
dark_mode_toggle: false  # Disable the toggle

When enabled, the toggle provides instant switching without a page reload. Visitors who prefer reduced motion in their operating system settings will still see the theme change, but without the transition animation.

Announcement Banner

A site-wide banner can be displayed above the navbar to highlight important news, releases, or alerts. The banner appears on every page and can optionally be dismissed by the visitor.

Simple Form

The simplest way to add a banner is with a string value. This creates a blue, info-styled banner that visitors can dismiss:

great-docs.yml
announcement: "Version 2.0 is now available!"

Full Configuration

For more control over the banner’s appearance and behavior, use a dictionary with content, type, dismissable, and url keys:

great-docs.yml
announcement:
  content: "We've moved to a new domain. Please update your bookmarks!"
  type: warning        # info (default), warning, success, or danger
  dismissable: true    # Allow visitors to close the banner (default: true)
  url: https://example.com/blog/migration  # Optional: makes the text a link

The available banner types and their colors:

Type Light Mode Dark Mode
info Blue Dark blue
warning Yellow (dark text) Dark yellow
success Green Dark green
danger Red Dark red

Dismiss Behavior

When dismissable: true (the default), visitors can click the close button to hide the banner. The dismissal is stored in sessionStorage, so the banner stays hidden for the rest of the browsing session but reappears after the browser is closed. If you change the announcement text, the new message will appear even for visitors who dismissed the previous one.

Disabling the Banner

To remove a previously configured banner, either set the key to false or remove it from the file entirely:

great-docs.yml
announcement: false

Animated Gradient Presets

The announcement banner, navbar, and content area all support gradient backgrounds. The banner and navbar use animated gradients that shift slowly across the element, creating a subtle, eye-catching effect. The content area uses a soft radial glow at the top of each page. Each preset includes paired light-mode and dark-mode color palettes.

Available Presets

Great Docs ships with eight gradient presets:

Preset Description
sky Soft sky blues
peach Peach and blush
prism Mint, sky, and lavender
lilac Lilac and pink
slate Cool grays
honey Warm cream and apricot
dusk Soft lavender-blue
mint Pale aqua

Gradient on the Announcement Banner

Add a style key to the announcement config to apply a gradient background instead of the solid color:

great-docs.yml
announcement:
  content: "Version 2.0 is now available!"
  style: sky

When style is set, it overrides the solid-color type background with the animated gradient. The type key is still used for semantic class names but has no visual effect on the background when a gradient is active.

Gradient on the Navbar

Use the top-level navbar_style key to apply the animated gradient to the site’s top navigation bar:

great-docs.yml
navbar_style: peach

In dark mode, text and icons are automatically adjusted to white for readability.

Gradient on the Content Area

Use the top-level content_style key to add a subtle radial glow at the top of the main content area:

great-docs.yml
content_style: lilac

The glow fades out smoothly and does not interfere with text or interactive elements. It uses the same preset names as the banner and navbar gradients.

By default the glow appears on all pages. To restrict it to the homepage only, use the dictionary form with a pages key:

great-docs.yml
content_style:
  preset: lilac
  pages: homepage    # "all" (default) or "homepage"

Combining All Three

You can use the same preset or different presets for the banner, navbar, and content area. Here is an example that mixes two presets:

great-docs.yml
announcement:
  content: "New release!"
  style: sky

navbar_style: sky
content_style:
  preset: lilac
  pages: homepage

Custom Head Content

Use include_in_header to inject custom HTML into the <head> of every page. This is useful for adding analytics scripts, custom meta tags, external stylesheets, or any other head content that needs to load before the page renders.

A single string is treated as inline HTML:

great-docs.yml
include_in_header: '<link rel="stylesheet" href="https://example.com/custom.css">'

For multiple entries, use a list. Each item can be a string (inline HTML) or a dictionary with a text or file key:

great-docs.yml
include_in_header:
  - text: |
      <script>
        console.log("hello from great-docs");
      </script>
  - text: '<meta name="custom" content="value">'
  - file: custom-head.html

Your entries are merged with Great Docs’ own head injections (Font Awesome, theme scripts, etc.) so everything cooperates automatically.

Favicon

Great Docs automatically generates a complete set of favicons for your site. If a logo is configured, favicons are derived from it with no extra setup needed. You can also specify a dedicated favicon image.

Dedicated Favicon

If you want a different image for your favicon (for example, a simplified icon rather than the full logo), set the favicon option:

great-docs.yml
favicon: assets/favicon.svg

This generates the same set of raster variants as the logo-based approach, but uses your dedicated favicon source image instead. Both SVG and PNG source files are supported.

Non-Square Source Images

Source images do not need to be perfectly square. Non-square images are automatically centered on a transparent canvas, preserving the original aspect ratio. This means wide logos will not be distorted; they will be padded with transparency above and below.

Hero Section

The hero section is a prominent banner displayed at the top of the landing page, showcasing the package logo, name, tagline, and badges. It is generated automatically when a logo is present and gives your documentation a polished, professional look.

Auto-Enable Behavior

The hero section auto-enables when a logo is configured (or auto-detected). No explicit configuration is needed: if you have a logo, you get a hero. The hero displays:

  • The package logo (with dark-mode support)
  • The package display name
  • The package description from pyproject.toml
  • Badges auto-extracted from the README (shields.io badges, etc.)

Disabling the Hero

To disable the hero entirely (for example, if you prefer your index.qmd or README.md rendered as-is):

great-docs.yml
hero: false

Customizing the Hero

Each hero component can be overridden or suppressed individually:

great-docs.yml
hero:
  name: "My Package"                    # Override the auto-detected name
  tagline: "A better way to build things"  # Override the description
  logo_height: 120px                    # Default: 200px
  badges: false                         # Suppress badge display

Set any component to false to suppress it:

great-docs.yml
hero:
  name: false              # Hide the name (logo and tagline only)
  badges: false            # No badges

Hero Logo Auto-Detection

Great Docs can also auto-detect hero-specific logo files from conventional file locations, with no configuration needed. Place files using these naming conventions:

my-package/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ logo-hero.svg          # Hero logo (single image)
β”‚   β”œβ”€β”€ logo-hero-light.svg    # Hero logo (light variant)
β”‚   └── logo-hero-dark.svg     # Hero logo (dark variant)

Auto-detection checks these paths in priority order:

  1. logo-hero.svg / logo-hero.png (project root)
  2. assets/logo-hero.svg / assets/logo-hero.png
  3. logo-hero-light.svg / logo-hero-light.png (project root)
  4. assets/logo-hero-light.svg / assets/logo-hero-light.png

If a file named logo-hero-dark.svg (or logo-hero-dark.png) exists alongside the primary hero logo, it is automatically used for dark mode.

When hero logo files are detected, the hero section auto-enables even if no logo or hero config is set in great-docs.yml.

The full logo fallback chain for the hero is:

  1. Explicit hero.logo in great-docs.yml
  2. Auto-detected hero logo files (logo-hero.*)
  3. Explicit top-level logo in great-docs.yml
  4. Auto-detected navbar logo files (logo.*)

Explicit Badge List

By default, badges are auto-extracted from the README. You can provide an explicit list instead:

great-docs.yml
hero:
  badges:
    - alt: PyPI version
      img: https://img.shields.io/pypi/v/my-package
      url: https://pypi.org/project/my-package/
    - alt: License
      img: https://img.shields.io/badge/license-MIT-green
      url: https://opensource.org/licenses/MIT

Hero Section Summary

Option Type Default Description
hero bool / dict auto false to disable; true or {} to enable; dict to customize
hero.name str / false display name Package name shown in hero
hero.tagline str / false description Tagline shown below the name
hero.logo str / dict / false auto-detect Hero-specific logo (can have light/dark keys); auto-detects logo-hero.* files
hero.logo_height str 200px CSS max-height for the hero logo
hero.badges list / false auto Explicit badge list or false to suppress

Next Steps

  • Configuration covers the functional settings (API discovery, parsers, GitHub integration)
  • User Guides explains how to write and organize narrative documentation
  • Deployment shows how to publish your site to GitHub Pages