English
About this handbook

This handbook belongs to the template Example for QuartzControl. It explains the template and, at the same time, shows everything it can do.

The text here comes from a Markdown file, not from the configuration.

Code styling

Inline

Out of the box a box with a border. In this template a tint without a border — enough to separate, too little to interrupt. Set slightly smaller (0.9em), because the mono next to the text face otherwise looks too big.

Blocks

The surface comes from the template, not from the syntax theme: keepBackground: false makes shiki set only the character colours. Only that way does the block fit in both colour schemes.

Since 2026-09-05 it is lighter than the rest of the tint and has a token of its own (--tpl-surface-code, #F1EFE9 in light mode, still lightgray in dark). A block is a large area, and the tint that is right for one word of inline code turns twenty lines into a grey slab. Measured, what it buys:

Colouron the old surfaceon the new one
Text (#24292E)10.69 : 112.76 : 1
Blue (#005CC5)4.59 : 15.47 : 1
Purple (#6F42C1)4.75 : 15.66 : 1
Orange (#E36209)2.54 : 13.04 : 1

It is paid for in separation: the surface now stands at 1.12 : 1 against the page ground instead of 1.34 : 1. That is why the block takes its border from --tpl-rule — exactly the colour its fill used to be.

Five colours of the syntax theme are corrected

The lighter ground was not enough. So the count was made over the whole built site: every --shiki-light and --shiki-dark value on all 333 pages, with its frequency and its contrast against the code surface. Five pairs failed:

Colourwhat forbeforenow
#22863A lightstrings, tags (206×)4.02 : 1#1F7A35 — 4.69 : 1
#D73A49 lightkeywords (112×)3.98 : 1#CA2938 — 4.70 : 1
#E36209 lightconstants, CSS variables (82×)3.04 : 1#B04C07 — 4.70 : 1
#6A737D lightcomments (4×)4.19 : 1#636B74 — 4.70 : 1
#6A737D darkcomments (4×)2.74 : 1#949CA4 — 4.74 : 1

Every correction keeps the hue and the saturation and changes only the lightness — github-light still reads as github-light. It is the same thing this template does with Quartz’s callout colours.

They have been checked on every run since: --check-contrast reads the five values out of content.scss and measures them against --tpl-surface-code. 78 pairs have become 83; with the thirteenth callout, no longer skipped since 2026-09-05, and two control borders, it is 93 today.

How that works technically

shiki writes the colour inline onto every single <span> (style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"), and an inline declaration beats any author rule that is not !important. So what is overridden is the variable, not color — then Quartz’s own light/dark switch carries on doing what it should.

What this does not cover: a language whose tokens produce a tenth colour would arrive unmeasured. The count is repeatable — grep --shiki-light: out of public/.

Long lines do not wrap, they scroll inside the block.

The language label

At the top left stands the language — as an ::after in the stylesheet, not as an element. So it does not end up in a copy, nor in the reading order.

The copy button

Out of the box it appears only on hover with a pointer — on a smartphone it is therefore unreachable.

In this template it appears on hover, on focus and permanently on devices without a pointer (@media (hover: none)). It measures 44 px, while the symbol inside stays small. It is hidden through opacity, never through display — otherwise it would not be there for the keyboard at all.

And it is the icon alone: no border, no surface. Its state is the colour of the icon, from gray to dark.

The exception to the layering rule

“Everything in custom.scss is unlayered and therefore beats the plugin styles” — true for component CSS, not for resource stylesheets. Quartz ships this button’s styling in static/resource-style-….css, unlayered and linked after index.css. At equal specificity the later rule wins:

.clipboard-button { float: right; border: 1px solid; border-color: var(--dark);
                    background-color: var(--light); margin: .3rem; padding: .4rem }

Measured on the built page: the button still reported a 1px border and --light behind it, although every rule in this template said border: none and background: transparent. One descendant in the selector (pre .clipboard-button) settles it.

Highlighted lines

Surface and a bar on the left. A tint alone is too weak on a block that is tinted anyway.

Which variables apply here

These 22 variables are read by the section body-code in content.scss. They can be changed in QuartzControl under Styles → Variables — without a line of CSS.

VariableValuealso applies to
--codeFont"Noto Sans Mono", ui-monospace, SFMono-Re…4 other components
--dark#17171A · dark #FCFCFA13 other components
--darkgray#333333 · dark #DDDDDD18 other components
--gray#5F5F5F · dark #A1A1A122 other components
--headerFont"Noto Sans", system-ui, "Segoe UI", Robot…15 other components
--secondary#1463A3 · dark #699DC319 other components
--tpl-accent-bar3px6 other components
--tpl-motion150ms ease13 other components
--tpl-radius-md8px17 other components
--tpl-radius-sm4px10 other components
--tpl-rulevar(--lightgray) = #DDDDDD19 other components
--tpl-rule-width1px25 other components
--tpl-space-2xs0.25rem16 other components
--tpl-space-lg1.5rem12 other components
--tpl-space-md1rem18 other components
--tpl-space-xs0.5rem20 other components
--tpl-surfacevar(--lightgray) = #DDDDDD6 other components
--tpl-surface-codecolor-mix(in srgb, var(--lightgray) 40%, … · dark var(--lightgray)only here
--tpl-surface-tintvar(--highlight) = rgba(42, 78, 108, 0.10)14 other components
--tpl-target44px12 other components
--tpl-text-xs0.78rem10 other components
--tpl-tracking-caps0.06em6.4 – Variables, 3.1 – Bases

This table is generated: it is read out of the stylesheets rather than kept by hand.

Read on

This page belongs to Example — the example template for QuartzControl. An overview of every area is on the English home page.

On a narrow screen the navigation is collapsed at the top.