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.

The language switcher

The switcher stands in the toolbar in the header, to the right of search, colour scheme switch and reader mode. It shares their measurements: 44 px high, the same border, the same corners, the same feedback on hover. Four controls in one row that differ in height read as a mistake.

Three forms

The plugin knows three presentations. All three are designed in this template, one is visible — which one is decided by switcher.style in the configuration.

FormWhat it isWhat it is good for
dropdowna <details> element with a list below itin use here — one control, however many languages
linksthe languages side by side, separated by |two languages, plenty of room
flagsflag emoji instead of namesvery tight, when the languages are known

dropdown is chosen because it stands as one box next to the search field and does not grow wider when a third language arrives. The list opens downwards, right-aligned under the button, with the same shadow as search and preview — the only two other places in this template that really do float above the page.

The other two forms are fully designed all the same: anyone switching to links or flags in the app gets not an unstyled component but one that fits into the same bar. With flags the emoji grows to reading size and the button stays square.

What the switcher shows

  • The current language stands as the button label and in the list as a highlighted, non-clickable entry with aria-current.
  • The label is the name in the language itself (switcher.label: native) — “Deutsch” and “English”, not “German”. A language name you cannot read because you do not speak the language is no help.
  • If there is no translation of this page, the entry leads to the home page of the other language (switcher.missing: home) and says so in its title. The alternatives would be to hide the entry — then the way out disappears — or to grey it out, which shows a dead end instead of offering a way.
  • Every entry carries lang and hreflang. A screen reader therefore pronounces “English” in English, even in the middle of a German page.

On a smartphone

The toolbar is a flex row with wrap. At 390 px the drawer button, the site name and four controls share the space; the search gives up its word and becomes a square, the switcher keeps its name, because two letters (“EN”) say less than “English” and there is room for it.

Remembering

rememberChoice: true stores the chosen language in localStorage. That is used by the root redirect — which this site does not have, because its root is the German home page — and by the notices above the page: once someone has switched to English, they get the notice in English from then on, regardless of the browser language.

Which variables apply here

These 23 variables are read by the section nav-language-switcher in plugin-multilanguage.scss. They can be changed in QuartzControl under Styles → Variables — without a line of CSS.

VariableValuealso applies to
--dark#17171A · dark #FCFCFA13 other components
--darkgray#333333 · dark #DDDDDD18 other components
--font-interfacevar(--bodyFont) = "Noto Sans", system-ui, "Segoe UI", Robot…3 other components
--gray#5F5F5F · dark #A1A1A122 other components
--light#FCFCFA · dark #16171A14 other components
--secondary#1463A3 · dark #699DC319 other components
--tpl-icon-sm0.95rem3 other components
--tpl-leading-snug1.4rem4 other components
--tpl-motion150ms ease13 other components
--tpl-radius-md8px17 other components
--tpl-rule-controlcolor-mix(in srgb, var(--gray) 70%, var(-…11 other components
--tpl-rule-width1px25 other components
--tpl-shadow0 6px 24px rgba(23, 23, 26, 0.10) · dark 0 6px 24px rgba(0, 0, 0, 0.55)5 other components
--tpl-space-2xs0.25rem16 other components
--tpl-space-3xs0.125rem6 other components
--tpl-space-lg1.5rem12 other components
--tpl-space-md1rem18 other components
--tpl-space-sm0.75rem10 other components
--tpl-space-xs0.5rem20 other components
--tpl-surface-tintvar(--highlight) = rgba(42, 78, 108, 0.10)14 other components
--tpl-target44px12 other components
--tpl-text-sm0.875rem20 other components
--tpl-text-xl1.4rem6.4 – Variables

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.