<p>Th' Relearrrn theme provides configurat'n opt'ns t' change yer your site’s colors, favicon an' logo. This allows ye t' easily align yer ship visuals t' yer desired style. Most o' these opt'ns be exposed thru so called color variants.</p>
<p>A color variant lets ye cust'mize various visual effects o' yer ship like almost any color, used fonts, color schemes o' print, rules highligtn'n, Merrrmaid an' th' OpenAPI shortcode, etc. It contains o' a CSS file an' optional configurat'n opt'ns 'n yer <code>config.toml</code>.</p>
<p>Th' Relearrrn theme ships wit' a wide set o' different color variants. Ye can use them as-is, copy them over an' use them as a start'n point fer yer customizat'ns or just create completely new variants unique t' yer ship. Th' <ahref="../../../basics/generator/index.html">interactive variant generator</a> may help ye wit' this task.</p>
<p>Once configured 'n yer <code>config.toml</code>, ye can select them wit' th' variant selector at th' bottom o' th' menu.</p>
<p>Yer theme variant file must reside 'n yer site’s <code>static/css</code> directory or 'n th' theme’s <code>static/css</code> directory an' th' file name must start wit' <code>theme-</code> an' end wit <code>.css</code>. In th' above example, th' path o' yer theme file must be <code>static/css/theme-relearn-light.css</code>.</p>
<p>If ye want t' make changes t' a shipped color variant, create a copy 'n yer site’s <code>static/css</code> directory. Don’t edit th' file 'n th' theme’s directory!</p>
</div>
</div>
<h3id="multiple-variants">Multiple Variants</h3>
<p>Ye can also set multiple variants. In this case, th' first variant be th' default chosen on first view an' a variant selector will be shown 'n th' menu footer if th' array contains more than one entry.</p>
<p>Th' theme provides an advanced configurat'n mode, combin'n th' functionality fer multiple variants wit' th' below possibilities o' adjust'n t' yer OS sett'ns, logo an' rules highlightn'n an' even more!</p>
<p>Although all opt'ns documented here be still work'n, th' advanced configurat'n opt'ns be th' recommended way t' configure yer color variants. <ahref="#theme-variant-advanced">See below</a>.</p>
</div>
</div>
<h2id="adjust-to-os-settings">Adjust t' OS Sett'ns</h2>
<p>Ye can also cause th' ship t' adjust t' yer OS sett'ns fer light/dark mode. Just set th' <code>themeVariant</code> t' <code>auto</code> t' become an auto mode variant. That’s it.</p>
<p>Ye can use th' <code>auto</code> value wit' th' single or multiple variants opt'n. If ye be us'n multiple variants, ye can drop <code>auto</code> at any posit'n 'n th' option’s array, but usually it makes sense t' set it 'n th' first posit'n an' make it th' default.</p>
</span></span><spanclass="line"><spanclass="cl"><spanclass="nx">themeVariant</span><spanclass="p">=</span><spanclass="p">[</span><spanclass="s2">"auto"</span><spanclass="p">,</span><spanclass="s2">"red"</span><spanclass="p">]</span></span></span></code></pre></div><p>If ye don’t configure anyth'n else, th' theme will default t' use <code>relearn-light</code> fer light mode an' <code>relearn-dark</code> fer dark mode. These defaults be overwritten by th' first two non-auto opt'ns o' yer <code>themeVariant</code> opt'n if present.</p>
<p>In th' above example, ye would end wit' <code>red</code> fer light mode an' th' default o' <code>relearn-dark</code> fer dark mode.</p>
<p>If ye don’t like that behavior, ye can explicitly set <code>themeVariantAuto</code>. Th' first entry 'n th' array be th' color variant fer light mode, th' second fer dark mode.</p>
<p>If yer favicon be a SVG, PNG or ICO, just drop yer image 'n yer site’s <code>static/images/</code> directory an' name it <code>favicon.svg</code>, <code>favicon.png</code> or <code>favicon.ico</code> respectively.</p>
<p>If ye want t' adjust yer favicon accord'n t' yer OS sett'ns fer light/dark mode, add th' image files <code>static/images/favicon-light.svg</code> an' <code>static/images/favicon-dark.svg</code> t' yer site’s directory, respectively, correspond'n t' yer file format. In case some o' th' files be miss'n, th' theme falls back t' <code>favicon.svg</code> fer each miss'n file. All supplied favicons must be o' th' same file format.</p>
<p>If no favicon file be found, th' theme will lookup th' alternative filename <code>logo</code> 'n th' same locat'n an' will repeat th' search fer th' list o' supported file types.</p>
<p>If ye need t' change this default behavior, create a new file <code>layouts/partials/favicon.html</code> 'n yer site’s directory an' write someth'n like this:</p>
<p>Create a new file 'n <code>layouts/partials/logo.html</code> o' yer ship. Then write any HTML ye want. Ye could use an <code>img</code> HTML tag an' reference an image created under th' <em>static</em> folder, or ye could paste a SVG definit'n!</p>
<p>If ye want t' switch th' rules highlight'n theme together wit' yer color variant, generate a rules highlight'n stylesheet an' configure yer installat'n <ahref="https://gohugo.io/content-management/syntax-highlighting/"target="_blank">accord'n t' Hugo’s documentat'n</a>. Then, <code>@import</code> th' rules highlightn'n stylesheet 'n yer color variant stylesheet.</p>
<p>For an example, take a look into <code>theme-relearn-light.css</code> an' <code>config.toml</code> o' th' exampleSite.</p>
<p>If ye want t' reconfigure just th' rules highlight'n o' an exist'n color variant, ye need t' copy th' file t' yer site’s directory an' adjust it accordingly.</p>
<p>Th' theme offers a new way t' configure theme variants an' all o' th' aspects above inside o' a single configurat'n item. This comes wit' some features previously unsupported.</p>
<p>Like wit' th' <ahref="#multiple-variants">multiple variants</a> opt'n, ye be defin'n yer theme variants 'n an array but now <em>not by simple str'ns</em><strong>but 'n a t'ble wit' subopt'ns</strong>.</p>
<p>Again, 'n this case, th' first variant be th' default chosen on first view an' a variant selector will be shown 'n th' menu footer if th' array contains more than one entry.</p>
</span></span><spanclass="line"><spanclass="cl"><spanclass="nx">themeVariant</span><spanclass="p">=</span><spanclass="p">[</span><spanclass="s2">"relearn-light"</span><spanclass="p">,</span><spanclass="s2">"relearn-dark"</span><spanclass="p">]</span></span></span></code></pre></div><p>ye now write it that way:</p>
</span></span><spanclass="line"><spanclass="cl"><spanclass="nx">identifier</span><spanclass="p">=</span><spanclass="s2">"relearn-dark"</span></span></span></code></pre></div><p>Th' <code>identifier</code> opt'n be mandatory an' equivalent t' th' str'n 'n th' first example. Further opt'ns can be configured, see th' t'ble below.</p>
<h3id="parameter">Parameter</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Default</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>identifier</td>
<td><em><empty></em></td>
<td>Must correspond t' th' name o' a color variant either 'n yer site’s or th' theme’s directory 'n th' form <code>static/css/theme-<IDENTIFIER>.css</code>.</td>
</tr>
<tr>
<td>name</td>
<td>see notes</td>
<td>Th' name t' be displayed 'n th' variant selector. If not set, th' identifier be used 'n a human read'ble form.</td>
<td>If set, th' variant be treated as an <ahref="#adjust-to-os-settings">auto mode variant</a>. It has th' same behavior as th' <code>themeVariantAuto</code> opt'n. Th' first entry 'n th' array be th' color variant fer light mode, th' second fer dark mode. Defin'n auto mode variants wit' th' advanced opt'ns has th' benefit that ye can now have multiple auto mode variants instead o' just one wit' th' simple opt'ns.</td>