Themes

Choose a theme, install a fixed release, update an older copy, and set light and dark modes.

A theme is a stylesheet that sets the colours and the fonts of the site. The pages of smalldocs use Bootstrap, a library of CSS. Bootswatch is a set of free themes for Bootstrap. smalldocs includes the 25 themes of Bootswatch 5.3, as the CSS files that Bootswatch builds. To use a theme, give its name in theme, at the top level of _smalldocs.yml:

theme: flatly

In a _quarto.yml, theme is under format.html.

The themes have these names:

The name bootstrap gives Bootstrap with no theme.

A light theme and a dark theme

If you give two themes, the navbar or the sidebar gets a toggle between them. For example:

theme:
  light: cosmo
  dark: darkly

On the first visit, the page starts in the mode that the browser prefers. The browser keeps the choice of the reader after a click on the toggle, and that choice wins on later visits. The page loads the right theme before it shows anything, so it does not flash the other theme first.

An extension can include both modes under one name. This site uses theme: folio, which selects the light and dark stylesheets of Folio. The Elegant collection has installation examples.

A theme from a git repository

A theme extension is a theme in a folder of your project, _extensions/<name>/. You get it once from a git repository with smalldocs add, and the folder stays in your project. Quarto keeps its extensions in the same folder.

First, add the theme. Give the repository as org/repo on GitHub:

smalldocs add rahuldave/smalldocs-tufte

The command clones the repository with git clone --depth 1. It clones org/repo over ssh, so it can get a private repository that your own ssh key can read. It copies each folder of _extensions/ in the repository into the _extensions/ folder of your project, without .git. Then it prints the line to use:

theme: tufte

The source can also be one of these:

  • org/repo@v1.0: a branch, a tag or a whole commit hash after @
  • a git URL, such as git@gitlab.com:org/repo.git or https://github.com/org/repo.git
  • a local git repository, or a bare one. smalldocs clones it, so it gets the files of a commit, and not the changes that you did not commit
  • a local folder with an _extensions/ folder, which is not a git repository. smalldocs copies its files as they are

If the folder of an extension is already in your project, the command asks before it replaces the folder. Give --force to replace it without a question.

theme takes the name of the folder. The name works alone, or with a Bootswatch theme:

theme: tufte              # the light and the dark CSS of the extension, and a toggle
theme:
  light: tufte            # the light CSS of the extension
  dark: darkly            # a Bootswatch theme

smalldocs also looks in _extensions/<org>/<name>/, the other folder layout of Quarto. If two folders have the same name, or an extension has the name of a Bootswatch theme, the build stops with an error. If no theme has the name, the error lists the names you can use.

In a _quarto.yml, a theme extension for both tools is often a custom format of Quarto. Give its name with -html in format:

format:
  tufte-html:
    toc: true

Quarto uses the format of the extension. smalldocs reads the options under tufte-html as the options under html. If _extensions/tufte/ has a smalldocs.yml, smalldocs also uses its theme.

You can also write the theme of smalldocs under smalldocs:. Quarto reads format.html.theme, and smalldocs reads smalldocs.theme, so each tool gets its own theme:

format:
  html:
    theme: [cosmo, _extensions/tufte/tufte.scss]
smalldocs:
  theme: tufte

What the build copies

The build copies the CSS of the theme into _site/site_libs/themes/<name>/. It also copies each file that the CSS uses through url(...) or @import, such as a font or an image. A file outside the folder of the extension is not copied, and the build gives a warning.

The licence files go with these files. The build copies the licence files at the top of the extension folder. It also copies the licence files in the folder of each copied file and in each folder above it, up to the top. The logo and the favicon of the theme count as copied files. So a font keeps its licence, as the SIL Open Font License asks.

A licence file is a text file. Its name has no extension, or .txt, .md, .rst or .html. The name holds one of these words, alone or between -, _ and ., in any case:

  • license or licence, with or without un before it or s after it;
  • copying or copyright;
  • notice or notices;
  • OFL.

Examples are LICENSE, BOOTSTRAP-LICENSE, NOTICE.md and inter-OFL.txt. A link to a file outside the extension is not copied.

The build does not copy the other files of the extension, and it never copies _extensions/ itself into the site.

If your site sets no logo, the site uses the logo of the theme. If it sets no favicon, the site uses the favicon of the theme. A favicon is the small picture in the tab of the browser.

See what is installed

smalldocs add writes a file .source in the folder of each extension. The file holds the source as you gave it, the ref after @, and the commit that git cloned:

source: rahuldave/smalldocs-tufte@v0.1.0
ref: v0.1.0
commit: 5f0c2a9e...

smalldocs themes lists the bundled themes, and each extension of the project with its source:

smalldocs themes

Update a theme

Run smalldocs add again with --force. To get the newest commit of the default branch, leave out the ref:

smalldocs add rahuldave/smalldocs-tufte --force

To get a release, give its tag, such as @v0.2.0. smalldocs themes prints the command that gets the same source again, and the command that gets the newest commit. Commit the folder _extensions/ with your project, so that each build uses the same theme.

Themes in the Elegant collection

The Elegant collection compares themes on the same pages. It includes the original custom designs and their refinements, with source links and example sites.

The theme handbook describes each theme, its fonts and its colour modes. It also shows how to add optional labels above page titles.

Each of the nine themes in the table has a light mode and a dark mode under one name. Each Reading theme has its native palette and a companion palette designed for it. The Reading themes do not change the stock Bootswatch themes that smalldocs includes.

Each theme defines its colours, fonts, spacing and control states in a file foundations.json. The three custom themes, Folio, Atelier and Nocturne, declare version 0.3.0, the Reading themes 0.2.0, and Tufte 0.2.1. A version in the manifest does not mean that a Git tag with that name exists. The custom v0.2.0 tags still select the October release, with the earlier fixed title labels.

Theme and example Name in theme: Modes
Folio folio Light and dark
Atelier atelier Light and dark
Nocturne nocturne Light and dark
Tufte tufte Light and dark
Zephyr Reading zephyr-reading Light and dark
Simplex Reading simplex-reading Light and dark
Pulse Reading pulse-reading Light and dark
Litera Reading litera-reading Light and dark
Darkly Reading darkly-reading Light and dark

The name links to the source repository. The install source is rahuldave/smalldocs- followed by the name, as in the commands below.

Install Folio

Run the command in the folder with your _smalldocs.yml:

smalldocs add rahuldave/smalldocs-folio

Set the theme, then render the site:

theme: folio
smalldocs render

The command gets the newest commit of the default branch. The extension includes compiled CSS and local fonts, so installation needs no Sass compiler. To install a fixed version, give a tag or a full commit hash.

Update the original Atelier

The revised Atelier keeps the name atelier. Existing sites keep their installed copy until you replace it. To install the revised Atelier:

smalldocs add rahuldave/smalldocs-atelier --force
smalldocs render

Keep theme: atelier. The command replaces _extensions/atelier/. Keep any local theme changes in your own stylesheet before replacing that folder. Commit the updated extension with your project.

Use smalldocs themes to see the installed source and commit. Folio and Nocturne use the same update commands, with their own repository names.

The original custom designs remain at the tag before-reading-redesign-2026-10-16. To restore the original Atelier, keep theme: atelier and run:

smalldocs add rahuldave/smalldocs-atelier@before-reading-redesign-2026-10-16 --force
smalldocs render

Use a Reading theme

The Reading extensions have separate names from the bundled themes. For example, litera selects the stock Bootswatch theme and litera-reading selects the refinement. Install the refinement first:

smalldocs add rahuldave/smalldocs-litera-reading
theme: litera-reading

A Reading extension includes both modes, so the navbar or the sidebar shows the toggle. You can also use a different theme in each mode. For example, install both extensions:

smalldocs add rahuldave/smalldocs-litera-reading
smalldocs add rahuldave/smalldocs-darkly-reading
theme:
  light: litera-reading
  dark: darkly-reading

The pair takes the light CSS of litera-reading and the dark CSS of darkly-reading.

Fix a source commit

To install the exact Folio revision assessed on 10 November 2026, give its full commit hash:

smalldocs add rahuldave/smalldocs-folio@e33e059ff40fd49aad28a8b7449cf77449e66898 --force

The version guide lists the source commits of all nine themes. Commit the installed extension with your site. Without a tag or a hash, the next smalldocs add can get a different commit, because the source repository changes.

Use the foundation roles

A foundation manifest is a JSON file that defines colours, font roles, spacing and control states. Each installed extension includes foundations.json. The source repository holds its editable copy in src/foundations.json.

A profile is a set of sizes for one use. The reading profile defines the sizes of prose, interface, metadata and code. The presentation profile is separate, and it does not enlarge the navigation of a document. The handbook explains the roles and an optional denser reading style.

At the default size of the browser, the prose of the themes is 18 to 20px and their code is 16px. The line spacing of their prose is 1.60. The fixed rubric of the typography assessment deducts points for that line spacing, because Butterick prefers 1.20 to 1.45. The November assessment also flags specific controls in Pulse Reading and Litera Reading, and light syntax colours in Darkly Reading.

Each theme also has a Quarto format. For example:

quarto add rahuldave/smalldocs-litera-reading
format: litera-reading-html

Read the assessments and principles

The collection has separate assessments for typography and visual design. Each scores themes out of 100, with the same criteria before and after refinement. The scores come from a self-review of shared specimens.

The typography criteria draw on Butterick’s Practical Typography. The visual design criteria draw on Refactoring UI.

Make a theme for smalldocs and Quarto

One repository can hold a theme for both tools. Each tool reads its own files in the same folder, and ignores the files of the other tool:

_extensions/tufte/
  _extension.yml     # Quarto reads this
  tufte.scss         # Quarto compiles this Sass
  smalldocs.yml      # smalldocs reads this
  tufte.css          # the light theme for smalldocs: all of Bootstrap 5.3, then your rules
  tufte-dark.css     # the dark theme for smalldocs
  et-book/           # fonts, which both CSS files use through url(...)
  logo.svg

smalldocs.yml names the files:

css:
  light: tufte.css
  dark: tufte-dark.css
logo: logo.svg       # optional. The site uses it only when it sets no logo
favicon: logo.svg    # optional. The site uses it only when it sets no favicon

css can also name one file, which smalldocs uses as a light theme. A file in smalldocs.yml must be inside the folder of the extension.

smalldocs compiles no Sass. So each CSS file is a complete Bootstrap 5.3 stylesheet, as a Bootswatch file is. Make it from tufte.scss with a Sass compiler. Or put the CSS of Bootstrap first, and your own rules after it.

The stylesheet of smalldocs loads after the theme. If a rule of your theme sets the same property on the same element as a rule of smalldocs, the rule of smalldocs wins. Start such a rule with html, as in html h2, so that it wins. The next section tells you which variables to set.

How the page gets the colours of the theme

Bootswatch writes each theme in Sass, a language that a compiler turns into CSS. smalldocs uses the CSS that Bootswatch builds, so it needs no Sass compiler. A Bootstrap 5.3 theme sets its colours, fonts and borders as CSS variables, such as --bs-primary, --bs-body-bg and --bs-border-color.

The stylesheet of smalldocs lays out the navbar, the sidebar, the table of contents, the callouts and the listings. It uses only those variables. So each part of the page gets the colours of the theme, in the light theme and in the dark theme.

Fonts and colours from options

These options of a page change the fonts, the colours and the width of the theme. Set them at the top level of _smalldocs.yml, in a _metadata.yml file, or in front matter:

mainfont: "Georgia, serif"   # the font of the text
monofont: "Menlo, monospace" # the font of code
fontsize: 16px               # the size of 1rem; 17px if you set none
linestretch: 1.6             # the height of a line of text
linkcolor: "#1a5fb4"         # the colour of links
backgroundcolor: "#fdfdf8"   # the colour of the page
fontcolor: "#222222"         # the colour of the text
max-width: 900px             # the width of the text; 760px if you set none

smalldocs writes each value into a CSS variable of Bootstrap or of smalldocs, after its own stylesheet and before your css. Write linkcolor, backgroundcolor and fontcolor as a hex colour such as #1a5fb4, or as rgb(). Bootstrap needs the red, green and blue parts of the colour of links. The build leaves out a value with <, >, {, }, ; or a backslash, and gives a warning.

linkcolor applies to the light theme and to the dark theme. backgroundcolor and fontcolor apply only to the light theme, so a dark theme keeps its own. To set them for the dark theme, write them in your own CSS, under html.quarto-dark.

Your own CSS

theme: cosmo
css: styles.css

The browser loads styles.css after the theme and after the stylesheet of smalldocs. In it, set the variables of Bootstrap to change the theme, or the variables of smalldocs to change the layout:

:root {
  --bs-primary: #7a3e9d;     /* the colours of Bootstrap */
  --sd-body-width: 900px;    /* the width of the text */
  --sd-sidebar-width: 280px; /* the width of the sidebar */
  --sd-root-font-size: 16px; /* the size of 1rem, which sets every size of text; 17px if you set none */
}

smalldocs does not compile a .scss file in theme. The build gives a warning about it.

If the name of your CSS file ends in .min.css, the site keeps that name. A file my.css becomes my.min.css in site_libs/themes/.