hugo-theme-relearn/basics/branding/index.print.html
2024-01-05 15:17:53 +00:00

469 lines
33 KiB
HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="height=device-height, width=device-width, initial-scale=1.0, minimum-scale=1.0">
<meta name="generator" content="Hugo 0.121.1">
<meta name="generator" content="Relearn 5.23.2+tip">
<meta name="description" content="Documentation for Hugo Relearn Theme">
<meta name="author" content="Sören Weber">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image" content="https://McShelby.github.io/hugo-theme-relearn/images/hero.png">
<meta name="twitter:title" content="Branding :: Hugo Relearn Theme">
<meta name="twitter:description" content="Documentation for Hugo Relearn Theme">
<meta property="og:title" content="Branding :: Hugo Relearn Theme">
<meta property="og:description" content="Documentation for Hugo Relearn Theme">
<meta property="og:type" content="website">
<meta property="og:url" content="https://McShelby.github.io/hugo-theme-relearn/basics/branding/index.html">
<meta property="og:image" content="https://McShelby.github.io/hugo-theme-relearn/images/hero.png">
<meta property="og:site_name" content="Hugo Relearn Theme">
<title>Branding :: Hugo Relearn Theme</title>
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/branding/index.html" rel="alternate" hreflang="x-default">
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/branding/index.html" rel="alternate" hreflang="en">
<link href="https://McShelby.github.io/hugo-theme-relearn/pir/basics/branding/index.html" rel="alternate" hreflang="art-pir">
<link href="https://McShelby.github.io/hugo-theme-relearn/basics/branding/index.html" rel="canonical" type="text/html" title="Branding :: Hugo Relearn Theme">
<link href="../../basics/branding/index.xml" rel="alternate" type="application/rss+xml" title="Branding :: Hugo Relearn Theme">
<link href="../../images/logo.svg?1704467867" rel="icon" type="image/svg+xml">
<!-- https://github.com/filamentgroup/loadCSS/blob/master/README.md#how-to-use -->
<link href="../../css/fontawesome-all.min.css?1704467868" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/fontawesome-all.min.css?1704467868" rel="stylesheet"></noscript>
<link href="../../css/nucleus.css?1704467868" rel="stylesheet">
<link href="../../css/auto-complete.css?1704467868" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/auto-complete.css?1704467868" rel="stylesheet"></noscript>
<link href="../../css/perfect-scrollbar.min.css?1704467868" rel="stylesheet">
<link href="../../css/fonts.css?1704467868" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="../../css/fonts.css?1704467868" rel="stylesheet"></noscript>
<link href="../../css/theme.css?1704467868" rel="stylesheet">
<link href="../../css/theme-relearn-auto.css?1704467868" rel="stylesheet" id="R-variant-style">
<link href="../../css/chroma-relearn-auto.css?1704467868" rel="stylesheet" id="R-variant-chroma-style">
<link href="../../css/variant.css?1704467868" rel="stylesheet">
<link href="../../css/print.css?1704467868" rel="stylesheet" media="print">
<link href="../../css/format-print.css?1704467868" rel="stylesheet">
<link href="../../css/ie.css?1704467868" rel="stylesheet">
<script src="../../js/url.js?1704467868"></script>
<script src="../../js/variant.js?1704467868"></script>
<script>
// hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic:
// https://github.com/gohugoio/hugo/blob/145b3fcce35fbac25c7033c91c1b7ae6d1179da8/transform/urlreplacers/absurlreplacer.go#L72
window.index_js_url="../../index.search.js";
var root_url="../../";
var baseUri=root_url.replace(/\/$/, '');
window.relearn = window.relearn || {};
window.relearn.baseUriFull='https:\/\/McShelby.github.io\/hugo-theme-relearn/';
// variant stuff
window.relearn.themeVariantModifier='';
window.variants && variants.init( [ 'relearn-auto', 'relearn-light', 'relearn-dark', 'relearn-bright', 'zen-auto', 'zen-light', 'zen-dark', 'neon', 'learn', 'blue', 'green', 'red' ] );
// translations
window.T_Copy_to_clipboard = `Copy to clipboard`;
window.T_Copied_to_clipboard = `Copied to clipboard!`;
window.T_Copy_link_to_clipboard = `Copy link to clipboard`;
window.T_Link_copied_to_clipboard = `Copied link to clipboard!`;
window.T_Reset_view = `Reset view`;
window.T_View_reset = `View reset!`;
window.T_No_results_found = `No results found for "{0}"`;
window.T_N_results_found = `{1} results found for "{0}"`;
</script>
<style>
#R-body img.bg-white {
background-color: white;
}
</style>
</head>
<body class="mobile-support print disableInlineCopyToClipboard" data-url="../../basics/branding/index.html">
<div id="R-body" class="default-animation">
<div id="R-body-overlay"></div>
<nav id="R-topbar">
<div class="topbar-wrapper">
<div class="topbar-sidebar-divider"></div>
<div class="topbar-area topbar-area-start" data-area="start">
<div class="topbar-button topbar-button-sidebar" data-content-empty="disable" data-width-s="show" data-width-m="hide" data-width-l="hide"><button class="topbar-control" onclick="toggleNav()" type="button" title="Menu (CTRL&#43;ALT&#43;n)"><i class="fa-fw fas fa-bars"></i></button>
</div>
</div>
<ol class="topbar-breadcrumbs breadcrumbs highlightable" itemscope itemtype="http://schema.org/BreadcrumbList"><li
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><a itemprop="item" href="../../basics/index.html"><span itemprop="name">Basics</span></a><meta itemprop="position" content="1">&nbsp;>&nbsp;</li><li
itemscope itemtype="https://schema.org/ListItem" itemprop="itemListElement"><span itemprop="name">Branding</span><meta itemprop="position" content="2"></li>
</ol>
<div class="topbar-area topbar-area-end" data-area="end">
</div>
</div>
</nav>
<div id="R-main-overlay"></div>
<main id="R-body-inner" class="highlightable default" tabindex="-1">
<div class="flex-block-wrapper">
<article class="default">
<header class="headline">
</header>
<h1 id="branding">Branding</h1>
<p>The Relearn theme provides configuration options to change your your site&rsquo;s colors, favicon and logo. This allows you to easily align your site visuals to your desired style. Most of these options are exposed thru so called color variants.</p>
<p>A color variant lets you customize various visual effects of your site like almost any color, used fonts, color schemes of print, syntax highligtning, Mermaid and the OpenAPI shortcode, etc. It contains of a CSS file and optional configuration options in your <code>hugo.toml</code>.</p>
<p>The Relearn theme ships with a wide set of different color variants. You can use them as-is, copy them over and use them as a starting point for your customizations or just create completely new variants unique to your site. The <a href="../../basics/generator/index.html">interactive variant generator</a> may help you with this task.</p>
<p>Once configured in your <code>hugo.toml</code>, you can select them with the variant selector at the bottom of the menu.</p>
<h2 id="theme-variant">Change the Variant (Simple)</h2>
<h3 id="single-variant">Single Variant</h3>
<p>Set the <code>themeVariant</code> value to the name of your theme file. That&rsquo;s it! Your site will be displayed in this variant only.</p>
<div class="tab-panel" data-tab-group="d09cd6e0945063e45190f3d591112bdb">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="hugotoml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('d09cd6e0945063e45190f3d591112bdb','hugotoml')"
>
<span class="tab-nav-text">hugo.toml</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="hugotoml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">themeVariant</span> <span class="p">=</span> <span class="s2">&#34;relearn-light&#34;</span></span></span></code></pre></div></div>
</div>
</div>
</div>
<div class="box notices cstyle note">
<div class="box-label"><i class="fa-fw fas fa-exclamation-circle"></i> Note</div>
<div class="box-content">
<p>Your theme variant file must reside in your site&rsquo;s <code>static/css</code> directory or in the theme&rsquo;s <code>static/css</code> directory and the file name must start with <code>theme-</code> and end wit <code>.css</code>. In the above example, the path of your theme file must be <code>static/css/theme-relearn-light.css</code>.</p>
<p>If you want to make changes to a shipped color variant, create a copy in your site&rsquo;s <code>static/css</code> directory. Don&rsquo;t edit the file in the theme&rsquo;s directory!</p>
</div>
</div>
<h3 id="multiple-variants">Multiple Variants</h3>
<p>You can also set multiple variants. In this case, the first variant is the default chosen on first view and a variant selector will be shown in the menu footer if the array contains more than one entry.</p>
<div class="tab-panel" data-tab-group="cd8e653b42c869dca63496754143e18d">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="hugotoml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('cd8e653b42c869dca63496754143e18d','hugotoml')"
>
<span class="tab-nav-text">hugo.toml</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="hugotoml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">themeVariant</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">&#34;relearn-light&#34;</span><span class="p">,</span> <span class="s2">&#34;relearn-dark&#34;</span> <span class="p">]</span></span></span></code></pre></div></div>
</div>
</div>
</div>
<div class="box notices cstyle tip">
<div class="box-label"><i class="fa-fw fas fa-lightbulb"></i> Tip</div>
<div class="box-content">
<p>The theme provides an advanced configuration mode, combining the functionality for multiple variants with the below possibilities of adjusting to your OS settings, logo and syntax highlightning and even more!</p>
<p>Although all options documented here are still working, the advanced configuration options are the recommended way to configure your color variants. <a href="#theme-variant-advanced">See below</a>.</p>
</div>
</div>
<h2 id="adjust-to-os-settings">Adjust to OS Settings</h2>
<p>You can also cause the site to adjust to your OS settings for light/dark mode. Just set the <code>themeVariant</code> to <code>auto</code> to become an auto mode variant. That&rsquo;s it.</p>
<p>You can use the <code>auto</code> value with the single or multiple variants option. If you are using multiple variants, you can drop <code>auto</code> at any position in the option&rsquo;s array, but usually it makes sense to set it in the first position and make it the default.</p>
<div class="tab-panel" data-tab-group="47c459d9aac95a27a09006c54e1277ea">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="hugotoml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('47c459d9aac95a27a09006c54e1277ea','hugotoml')"
>
<span class="tab-nav-text">hugo.toml</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="hugotoml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">themeVariant</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">&#34;auto&#34;</span><span class="p">,</span> <span class="s2">&#34;red&#34;</span> <span class="p">]</span></span></span></code></pre></div></div>
</div>
</div>
</div><p>If you don&rsquo;t configure anything else, the theme will default to use <code>relearn-light</code> for light mode and <code>relearn-dark</code> for dark mode. These defaults are overwritten by the first two non-auto options of your <code>themeVariant</code> option if present.</p>
<p>In the above example, you would end with <code>red</code> for light mode and the default of <code>relearn-dark</code> for dark mode.</p>
<p>If you don&rsquo;t like that behavior, you can explicitly set <code>themeVariantAuto</code>. The first entry in the array is the color variant for light mode, the second for dark mode.</p>
<div class="tab-panel" data-tab-group="a549c6c49947b48b2452f80ee225008d">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="hugotoml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('a549c6c49947b48b2452f80ee225008d','hugotoml')"
>
<span class="tab-nav-text">hugo.toml</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="hugotoml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">themeVariantAuto</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">&#34;learn&#34;</span><span class="p">,</span> <span class="s2">&#34;neon&#34;</span> <span class="p">]</span></span></span></code></pre></div></div>
</div>
</div>
</div><h2 id="change-the-favicon">Change the Favicon</h2>
<p>If your favicon is a SVG, PNG or ICO, just drop your image in your site&rsquo;s <code>static/images/</code> directory and name it <code>favicon.svg</code>, <code>favicon.png</code> or <code>favicon.ico</code> respectively.</p>
<p>If you want to adjust your favicon according to your OS settings for light/dark mode, add the image files <code>static/images/favicon-light.svg</code> and <code>static/images/favicon-dark.svg</code> to your site&rsquo;s directory, respectively, corresponding to your file format. In case some of the files are missing, the theme falls back to <code>favicon.svg</code> for each missing file. All supplied favicons must be of the same file format.</p>
<p>If no favicon file is found, the theme will lookup the alternative filename <code>logo</code> in the same location and will repeat the search for the list of supported file types.</p>
<p>If you need to change this default behavior, create a new file <code>layouts/partials/favicon.html</code> in your site&rsquo;s directory and write something like this:</p>
<div class="tab-panel" data-tab-group="d4d8b5892b397ba9f9364c168a67a306">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="layoutspartialsfaviconhtml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('d4d8b5892b397ba9f9364c168a67a306','layoutspartialsfaviconhtml')"
>
<span class="tab-nav-text">layouts/partials/favicon.html</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="layoutspartialsfaviconhtml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-html" data-lang="html"><span class="line"><span class="cl"><span class="p">&lt;</span><span class="nt">link</span> <span class="na">rel</span><span class="o">=</span><span class="s">&#34;icon&#34;</span> <span class="na">href</span><span class="o">=</span><span class="s">&#34;/images/favicon.bmp&#34;</span> <span class="na">type</span><span class="o">=</span><span class="s">&#34;image/bmp&#34;</span><span class="p">&gt;</span></span></span></code></pre></div></div>
</div>
</div>
</div><h2 id="change-the-logo">Change the Logo</h2>
<p>Create a new file in <code>layouts/partials/logo.html</code> of your site. Then write any HTML you want. You could use an <code>img</code> HTML tag and reference an image created under the <em>static</em> folder, or you could paste a SVG definition!</p>
<div class="box notices cstyle note">
<div class="box-label"><i class="fa-fw fas fa-exclamation-circle"></i> Note</div>
<div class="box-content">
<p>The size of the logo will adapt automatically.</p>
</div>
</div>
<h2 id="syntax-highlightning">Syntax Highlightning</h2>
<p>If you want to switch the syntax highlighting theme together with your color variant, you need to configure your installation <a href="https://gohugo.io/content-management/syntax-highlighting/" target="_blank">according to Hugo&rsquo;s documentation</a> and provide a syntax highlighting stylesheet file.</p>
<p>You can use a one of the shipped stylesheet files or use Hugo to generate a file for you. The file must be written to <code>static/css/chroma-&lt;NAME&gt;.css</code>. To use it with your color variant you have to define <code>--CODE-theme: &lt;NAME&gt;</code> in the color variant stylesheet file.</p>
<p>For an example, take a look into <a href="https://github.com/McShelby/hugo-theme-relearn/blob/main/static/css/theme-relearn-light.css" target="_blank"><code>theme-relearn-light.css</code></a> and <a href="https://github.com/McShelby/hugo-theme-relearn/blob/main/exampleSite/config/_default/hugo.toml" target="_blank"><code>hugo.toml</code></a> of the exampleSite.</p>
<h2 id="theme-variant-advanced">Change the Variant (Advanced)</h2>
<p>The theme offers a new way to configure theme variants and all of the aspects above inside of a single configuration item. This comes with some features previously unsupported.</p>
<p>Like with the <a href="#multiple-variants">multiple variants</a> option, you are defining your theme variants in an array but now <em>not by simple strings</em> <strong>but in a table with suboptions</strong>.</p>
<p>Again, in this case, the first variant is the default chosen on first view and a variant selector will be shown in the menu footer if the array contains more than one entry.</p>
<div class="tab-panel" data-tab-group="91ebf48e701ffdaef16be28f809a81fe">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="hugotoml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('91ebf48e701ffdaef16be28f809a81fe','hugotoml')"
>
<span class="tab-nav-text">hugo.toml</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="hugotoml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">themeVariant</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">&#34;relearn-light&#34;</span><span class="p">,</span> <span class="s2">&#34;relearn-dark&#34;</span> <span class="p">]</span></span></span></code></pre></div></div>
</div>
</div>
</div><p>you now write it that way:</p>
<div class="tab-panel" data-tab-group="d2da15fd600534e4b1ed88952691bed4">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="hugotoml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('d2da15fd600534e4b1ed88952691bed4','hugotoml')"
>
<span class="tab-nav-text">hugo.toml</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="hugotoml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;relearn-light&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;relearn-dark&#34;</span></span></span></code></pre></div></div>
</div>
</div>
</div><p>The <code>identifier</code> option is mandatory and equivalent to the string in the first example. Further options can be configured, see the table below.</p>
<h3 id="parameter">Parameter</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Default</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<tr>
<td>identifier</td>
<td><em>&lt;empty&gt;</em></td>
<td>Must correspond to the name of a color variant either in your site&rsquo;s or the theme&rsquo;s directory in the form <code>static/css/theme-&lt;IDENTIFIER&gt;.css</code>.</td>
</tr>
<tr>
<td>name</td>
<td>see notes</td>
<td>The name to be displayed in the variant selector. If not set, the identifier is used in a human readable form.</td>
</tr>
<tr>
<td>auto</td>
<td><em>&lt;empty&gt;</em></td>
<td>If set, the variant is treated as an <a href="#adjust-to-os-settings">auto mode variant</a>. It has the same behavior as the <code>themeVariantAuto</code> option. The first entry in the array is the color variant for light mode, the second for dark mode. Defining auto mode variants with the advanced options has the benefit that you can now have multiple auto mode variants instead of just one with the simple options.</td>
</tr>
</tbody>
</table>
<h3 id="example-configuration-of-this-site">Example Configuration of This Site</h3>
<div class="tab-panel" data-tab-group="09d52eced4411620eb3b3366ab6f46e8">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="hugotoml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('09d52eced4411620eb3b3366ab6f46e8','hugotoml')"
>
<span class="tab-nav-text">hugo.toml</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="hugotoml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;relearn-auto&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="nx">name</span> <span class="p">=</span> <span class="s2">&#34;Relearn Light/Dark&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="nx">auto</span> <span class="p">=</span> <span class="p">[]</span>
</span></span><span class="line"><span class="cl"> <span class="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;relearn-light&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;relearn-dark&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;zen-auto&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="nx">name</span> <span class="p">=</span> <span class="s2">&#34;Zen Light/Dark&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="nx">auto</span> <span class="p">=</span> <span class="p">[</span> <span class="s2">&#34;zen-light&#34;</span><span class="p">,</span> <span class="s2">&#34;zen-dark&#34;</span> <span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;zen-light&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;zen-dark&#34;</span>
</span></span><span class="line"><span class="cl"> <span class="p">[[</span><span class="nx">params</span><span class="p">.</span><span class="nx">themeVariant</span><span class="p">]]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;neon&#34;</span></span></span></code></pre></div></div>
</div>
</div>
</div><h2 id="modify-shipped-variants">Modify Shipped Variants</h2>
<p>In case you like a shipped variant but only want to tweak some aspects, you have two choices:</p>
<ol>
<li>
<p>Copy and change</p>
<p>You can copy the shipped variant file from the theme&rsquo;s <code>static/css</code> directory to the site&rsquo;s <code>static/css</code> directory and either store it with the same name or give it a new name. Edit the settings and save the new file. Afterwards you can use it in your <code>hugo.toml</code> by the choosen name.</p>
</li>
<li>
<p>Create and import</p>
<p>You can create a new variant file in the site&rsquo;s <code>static/css</code> directory and give it a new name. Import the shipped variant, add the settings you want to change and save the new file. Afterwards you can use it in your <code>hugo.toml</code> by the choosen name.</p>
<p>For example, you want to use the <code>relearn-light</code> variant but want to change the syntax highlightning schema to the one used in the <code>neon</code> variant. For that, create a new <code>static/css/theme-my-branding.css</code> in your site&rsquo;s directory and add the following lines:</p>
<div class="tab-panel" data-tab-group="24b85de6a2c2d6c4289086177e85ce55">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="staticcsstheme-my-brandingcss"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('24b85de6a2c2d6c4289086177e85ce55','staticcsstheme-my-brandingcss')"
>
<span class="tab-nav-text">static/css/theme-my-branding.css</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="staticcsstheme-my-brandingcss"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-css" data-lang="css"><span class="line"><span class="cl"><span class="p">@</span><span class="k">import</span> <span class="s2">&#34;theme-relearn-light.css&#34;</span><span class="p">;</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="p">:</span><span class="nd">root</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl"> <span class="nv">--CODE-theme</span><span class="p">:</span> <span class="n">neon</span><span class="p">;</span> <span class="c">/* name of the chroma stylesheet file */</span>
</span></span><span class="line"><span class="cl"> <span class="nv">--CODE-BLOCK-color</span><span class="p">:</span> <span class="nb">rgba</span><span class="p">(</span> <span class="mi">226</span><span class="p">,</span> <span class="mi">228</span><span class="p">,</span> <span class="mi">229</span><span class="p">,</span> <span class="mi">1</span> <span class="p">);</span> <span class="c">/* fallback color for code text */</span>
</span></span><span class="line"><span class="cl"> <span class="nv">--CODE-BLOCK-BG-color</span><span class="p">:</span> <span class="nb">rgba</span><span class="p">(</span> <span class="mi">40</span><span class="p">,</span> <span class="mi">42</span><span class="p">,</span> <span class="mi">54</span><span class="p">,</span> <span class="mi">1</span> <span class="p">);</span> <span class="c">/* fallback color for code background */</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div>
</div>
</div>
</div><p>Afterwards put this in your <code>hugo.toml</code> to use your new variant:</p>
<div class="tab-panel" data-tab-group="daecc87dd94f2db4124665540e8fddcd">
<div class="tab-nav">
<div class="tab-nav-title">&#8203;</div>
<button
data-tab-item="hugotoml"
class="tab-nav-button tab-panel-style cstyle initial active" tabindex="-1"
onclick="switchTab('daecc87dd94f2db4124665540e8fddcd','hugotoml')"
>
<span class="tab-nav-text">hugo.toml</span>
</button>
</div>
<div class="tab-content-container">
<div
data-tab-item="hugotoml"
class="tab-content tab-panel-style cstyle initial active">
<div class="tab-content-text">
<div class="wrap-code highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">params</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"> <span class="nx">themeVariant</span> <span class="p">=</span> <span class="s2">&#34;my-branding&#34;</span></span></span></code></pre></div></div>
</div>
</div>
</div><p>In comparison to <em>copy and change</em>, this has the advantage that you profit from any adjustments to the <code>relearn-light</code> variant but keep your modifications.</p>
</li>
</ol>
<footer class="footline">
<div class=" taxonomy-categories term-list cstyle " title="Categories" style="--VARIABLE-TAGS-BG-color: var(--INTERNAL-TAG-BG-color);">
<i class="fa-fw fas fa-layer-group"></i>
<ul>
<li><a class="term-link" href="../../categories/custom/index.html">custom</a></li>
<li><a class="term-link" href="../../categories/theming/index.html">theming</a></li>
</ul>
</div>
</footer>
</article>
</div>
</main>
</div>
<script src="../../js/clipboard.min.js?1704467868" defer></script>
<script src="../../js/perfect-scrollbar.min.js?1704467868" defer></script>
<script src="../../js/theme.js?1704467868" defer></script>
</body>
</html>