English
About this handbook

This handbook belongs to the Quartz plugin quartz-navigations. And it is built with it: the menu above and the previous/next links below every text come from there.

What the entries behind them look like is explained in 8.1.

7.2 – CSS variables

Where to set them

In the project’s quartz/styles/custom.scss:

.quartz-nav {
  --quartz-nav-indent: 1.5rem;
  --quartz-nav-color-active: var(--tertiary);
}

That wins without higher specificity: Quartz puts every component’s CSS into a CSS layer (@layer quartz-base), custom.scss not — and rules outside a layer beat rules inside one.

A single navigation

Every navigation carries its ID in the data-quartz-nav attribute:

.quartz-nav[data-quartz-nav="sidebar"] {
  --quartz-nav-bg-hover: transparent;
}

The ID is the value of id — without id, a checksum that changes with every option. So give a navigation you style specifically an id (7.3). Alternatively className adds classes of your own to the <nav>.

Colours and fonts

The defaults refer to Quartz’s theme variables and therefore follow dark mode.

VariableDefaultEffect
--quartz-nav-color--darkgraylinks
--quartz-nav-color-hover--secondarylinks on hover
--quartz-nav-color-active--secondarythe current page
--quartz-nav-color-trail--secondaryfolders on the path to the current page
--quartz-nav-color-static--darkfolder titles without a link
--quartz-nav-color-heading--darkthe title heading
--quartz-nav-color-muted--graychevrons, labels
--quartz-nav-color-icon--grayglyphs and icons
--quartz-nav-bg-hover--highlightbackground on hover
--quartz-nav-bg-active--highlightbackground of the current page
--quartz-nav-bg-panel--lightmenus, panels, mobile menu
--quartz-nav-border--lightgrayborders and guide lines
--quartz-nav-focus--secondaryfocus ring
--quartz-nav-shadowsoft shadow, stronger in dark modemenus and panels
--quartz-nav-backdroprgba(0,0,0,.35), .55 in dark modebackground behind the mobile menu
--quartz-nav-font--bodyFontfont of the entries
--quartz-nav-heading-font--headerFontfont of the heading
--quartz-nav-folder-font--quartz-nav-heading-fontfont of folder titles

Spacing and shape

VariableDefaultEffect
--quartz-nav-gap0.25rem 0.5remgap in horizontal rows
--quartz-nav-nested-gap0.25rem 0.5remgap of the sublevels in bar
--quartz-nav-indent1remindentation per level
--quartz-nav-item-padding-y, -x0.2rem, 0.5rempadding of a row
--quartz-nav-radius4pxcorner radius of a row
--quartz-nav-line-height1.6line height
--quartz-nav-row-heightline height plus paddingheight of the expand button
--quartz-nav-toggle-size1.75remwidth of the expand button
--quartz-nav-icon-size1.1emsize of the icons
--quartz-nav-accent-bar3pxaccent bar on the current page
--quartz-nav-chevron-open-rotate180degrotation of the chevron on an open folder
--quartz-nav-title-size, --quartz-nav-title-margin1rem, 0 0 0.5remthe title heading
VariableDefaultEffect
--quartz-nav-panel-min-width12remminimum width of a menu
--quartz-nav-panel-padding0.5rempadding of a menu
--quartz-nav-panel-radius6pxcorner radius of a menu
--quartz-nav-panel-z20stacking order of menus
--quartz-nav-mega-min-widthmin(40rem, 90vw)width of the mega menu
--quartz-nav-column-min-width10remminimum column width in columns and mega
--quartz-nav-column-gap1rem 1.5remgap between columns
--quartz-nav-offcanvas-widthmin(20rem, 85vw)width of the mobile menu
--quartz-nav-offcanvas-padding1rempadding of the mobile menu
--quartz-nav-offcanvas-z100stacking order of the mobile menu

Type by level

Folder rows get smaller and lighter with each level: level 1 is a section, level 2 a chapter, everything below a place. Pages stay light and at most as large as --quartz-nav-page-size. The top row of the horizontal variants, by contrast, is uniform.

VariableDefault
--quartz-nav-level-1-size, -weight0.95rem, 700
--quartz-nav-level-2-size, -weight0.9rem, 600
--quartz-nav-level-3-size, -weight0.875rem, 500
--quartz-nav-level-4-size, -weight0.8rem, 500 — for level 4 and deeper
--quartz-nav-page-size, --quartz-nav-page-weight0.875rem, 400
--quartz-nav-bar-weight500 — top row of bar, dropdown, mega, tabs
--quartz-nav-weight-active600 — the current page

Motion

Chevrons rotate, colours fade, folders and menus fade in when opening, the mobile menu slides in. Everything hangs on one variable:

.quartz-nav {
  --quartz-nav-transition: 0s;   /* default: 0.2s ease */
}

With prefers-reduced-motion the plugin sets it to 0s itself.