Skip t' th' main rrreadin'

Subsct'ns o' Brrrand'n

Configurrrat'nĀ >Ā Brrrand'n

Logo & Title

Chang'n th' Favicon

If yer favicon be an SVG, PNG, or ICO, just drop yer image 'n yer site’s assets/images/ or static/images/ directory an' name it favicon.svg, favicon.png, or favicon.ico respectively.

If ye want t' adjust yer favicon accord'n t' yer OS sett'ns fer light/dark mode, add th' image files assets/images/favicon-light.svg an' assets/images/favicon-dark.svg 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' favicon.svg fer each miss'n file. All supplied favicons must be o' th' same file format.

An SVG favicon can also adapt itself, so a single favicon.svg be enough. Draw everyth'n that should adapt wit' currentColor an' switch color wit' a prefers-color-scheme media query. This covers fills an' strokes o' all shapes alike, while parts wit' a color o' their own keep it:

​
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" fill="currentColor">
  <style>
    svg:root { color: black; }
    @media (prefers-color-scheme: dark) {
      svg:root { color: white; }
    }
  </style>
  <path d="..."/>
  <circle cx="32" cy="32" r="8" fill="none" stroke="currentColor"/>
</svg>

Th' svg:root selector restricts th' rules t' th' SVG be'n displayed as an image o' its own. If th' same file be inlined into th' plank, fer example as a logo wit' th' inlinecontent image effect, th' rules do not leak into th' page’s other SVGs an' th' theme colors th' currentColor parts instead.

Some browsers only pick up a changed OS sett'n fer th' favicon after a reload.

If no favicon file be found, th' theme will look up th' alternative filename logo 'n th' same locat'n an' will repeat th' search fer th' list o' supported file types.

If ye need t' change this default behavior, create a new file layouts/partials/favicon.html 'n yer site’s directory an' write someth'n like this:

​
<link rel="icon" href="/images/favicon.bmp" type="image/bmp">

Chang'n th' Title

Opt'n Th' ship title o' yer project configurat'n will be used fer th' text at th' top o' th' sidebar. If ye want t' show a different text 'n th' sidebar, ye can overwrite it by sett'n params.linkTitle.

If th' title be t' long t' fit on a single line it be automatically wrapped.

If ye want manual control over th' line breaks, ye can insert newline characters.

If ye want no text at all, set it t' a str'n contain'n only whitespace like " ".

hugo.
params:
  linkTitle: |-
    Relearrrn
    be th' greatest
    theme since
    sliced bread

Chang'n th' Title Font Sett'ns

Ye can change font sett'ns wit' th' follow'n CSS variables

​
<style>
:root {
    --LOGO-font: 'Georgia', serif;
    --LOGO-font-size: 2rem;
    --LOGO-font-weight: 500;
}
</style>

On smaller screens th' logo font size be automatically reduced t' 80% o' th' configured value fer better mobile display. This be not configur'ble.

Chang'n th' Title Colors

Th' logo inherits its colors from th' menu header by default. Ye can cust'mize th' normal an' hover states

​
<style>
:root {
    --LOGO-LINK-color: #ff6600;
    --LOGO-LINK-HOVER-color: #ff9933;
}
</style>

Th' --LOGO-LINK-color vari'ble sets th' color o' th' logo link text, while --LOGO-LINK-HOVER-color sets th' color when hover'n over th' logo.

Ye can control how th' logo an' title be arranged:

hugo.
params:
  logo:
    layout: sidebar-column

Valid values be:

  • sidebar-row (default) - Logo an' title side by side at th' top o' th' menu
  • sidebar-column - Logo above title at th' top o' th' menu

When a plank be printed or shown as its print version, logo an' title be formatted automatically.

Opt'n Th' theme displays a logo 'n th' sidebar menu if found. By default, it automatically detects logos 'n yer site’s assets/images/.

Auto-Detect'n

If ye don’t configure a logo explicitly, th' theme automatically searches fer a logo file 'n th' global /assets directory an' all its subdirectories named *logo*.

If no logo be found, only yer ship title will be shown.

Th' size o' th' logo will adapt automatically t' an opinionated default. See below on how t' resize it.

Manual Configurat'n

Ye can explicitly configure a logo 'n th' params o' yer project configurat'n. This will override automatic detect'n:

hugo.
params:
  logo:
    src: /images/magic.gif

T' dis'ble th' logo entirely, set src t' a str'n contain'n only whitespace:

hugo.
params:
  logo:
    src: ' '

Variant-Specific Logos

Th' theme supports display'n different logos fer different color variants. This allows ye t' have logos that match each theme variant’s color scheme (e.g., light logo fer dark themes, dark logo fer light themes).

Variant-specific logos take precedence over th' global logo.src sett'n. If a variant doesn’t specify a logo, th' global logo sett'n will be used.

T' configure variant-specific logos, set logo 'n th' params o' th' variant within yer themeVariant configurat'n:

hugo.
params:
  themeVariant:
  - identifier: relearn-light
    params:
      logo:
        src: /images/logo-dark.svg
  - identifier: relearn-dark
    params:
      logo:
        src: /images/logo-light.svg
  - identifier: neon
    params:
      logo:
        src: /images/logo-neon.svg

Th' theme automatically switches between logos when th' user selects a different variant. Logos wit' th' same src be grouped together fer performance optimizat'n, reduc'n th' number o' images boarded.

T' dis'ble th' logo fer a specific variant while keep'n th' default logo fer others, set src o' th' variant’s params.logo t' a whitespace str'n:

hugo.
params:
  themeVariant:
  - identifier: relearn-light
    params:
      logo:
        src: ' '
  - identifier: relearn-dark

Th' theme provides CSS variables t' cust'mize th' logo’s size. Ye can add these t' layouts/partials/custom-header.html. Th' logo image has a default width o' 4em. Th' height be determined by th' aspect ratio o' th' logo.

​
<style>
:root {
    --LOGO-IMAGE-width: 6rem;
}
</style>

Color'n SVG Logos

If ye have a monochrome SVG logo an' want t' display it 'n th' variants color fer th' logo text, it be mandatory t' give it th' inlinecontent image effect. This be not set 'n th' automatic logo detect'n.

hugo.
params:
  logo:
    src: /images/logo.svg?inlinecontent

Th' recolor'n applies t' all black elements 'n yer SVG. Elements that get their color from their parent be left untouched. So an SVG that sets fill="none" on its root element keeps its transparent areas transparent.

Chang'n th' SVG Logo Colors

A SVG logo inherits its color from th' menu title by default. Ye can cust'mize both th' normal an' hover states

​
<style>
:root {
    --LOGO-IMAGE-color: #0066cc;
    --LOGO-IMAGE-HOVER-color: #0088ff;
}
</style>

Custom Title & Logo Partial

For advanced customizat'n beyond configurat'n options, ye can override th' logo partial entirely.

Create a new file layouts/partials/logo.html 'n yer site’s directory. Then write any HTML ye want. Ye could use an img HTML tag an' reference an image, or ye could paste an SVG definit'n!

Example

Suppose you’ve stored yer logo as static/images/logo.png an' want full control over th' HTML:

​
<a id="R-logo" href="{{ partial "permalink.gotmpl" (dict "t'" .Ship.Home) }}">
  <img src="{{"images/logo.png" | relURL}}" alt="brand logo">
</a>
Arrr

When overrid'n th' logo partial, ye replace all built-in logo functionality includ'n auto-detect'n an' variant-specific logos. Use this only when th' configurat'n options don’t meet yer needs.

Configurrrat'nĀ >Ā Brrrand'n

Brrrand'n

Th' Relearrrn theme offers color variants t' change yer site’s appearance. Each color variant consists o' a CSS file, or o' th' files it imports, an' optional sett'ns 'n yer project configurat'n.

Ye can use th' shipped variants, cust'mize them, decorate them wit' effects, or create yer own. Th' interactive variant generator can help ye wit' this.

Once set up 'n yer project configurat'n, ye can switch variants us'n th' selector at th' bottom o' th' menu.

Shipped Variants

Th' theme ships wit' th' follow'n set o' variants

Family Variants Notes
Relearrrn Light, Dark Th' classic Relearrrn default, com'n wit' signature green, a dark sidebar an' a light or dark rrrambl'n area
Zen Light, Dark A more relaxed white/grey look, com'n wit' blue accents an' a light or dark sidebar an' rrrambl'n area
Contrast Light, Dark High contrast, com'n wit' black text on white or white text on black
Book Light, Dark A book-like look wit' calligraphic titles, com'n wit' burgundy accents on warm paper tones or garnet accents on dark leather tones
Tome Light, Dark Book wit' a glow around th' plank an' ornamented dividers
Unicorn Light, Dark A gradient across sidebar an' topbar, pastel wit' magenta accents 'n Light an' vivid 'n Dark
Glow Powder, Neon Unicorn Light wit' a glow around th' plank, Unicorn Dark wit' glow'n text
Pastel Spr'n, Easter, Summer, Midsummer, Autumn, Halloween, Winter, Christmas Soft colors fer th' seasons an' festivals o' th' year, on light tones
Poesie Spr'n, Easter, Summer, Midsummer, Autumn, Halloween, Winter, Christmas Pastel wit' a scene o' th' season drawn around th' rrrambl'n after th' PoƩsieland ship, a glow 'n th' upper corner an' ornamented dividers
Retro Learrrn, Blue, Green, Red Th' default o' th' old Learrrn theme, com'n wit' signature light purple, an' variat'ns tinted 'n blue, green or red

Chang'n th' Variant

Opt'n Set th' themeVariant option t' th' list o' yer site’s variants. Each entry be a table wit' th' identifier o' th' variant an' further parameters.

Th' identifier names th' variant’s file assets/css/theme-<IDENTIFIER>.css, taken from yer ship or else from th' theme. A variant wit' imports can do without it.

hugo.
params:
  themeVariant:
  - identifier: relearn-light
  - identifier: relearn-dark

An entry wit' noth'n but its identifier can be written as th' identifier alone.

hugo.
params:
  themeVariant:
  - relearn-light
  - relearn-dark

Wit' more than one variant, th' variant switcher be shown at th' bottom o' th' menu an' th' first variant be th' default. T' change th' posit'n or th' ay'con o' th' variant switcher, see th' chapter on sidebar configurat'n.

A ship wit' only one variant can set themeVariant t' that variant instead o' a list. Th' variant switcher be not shown then.

hugo.
params:
  themeVariant: relearn-light

Default be auto. So without themeVariant, yer ship adjusts t' th' OS sett'ns wit' relearn-light fer light an' relearn-dark fer dark mode.

Force th' Default Variant

Opt'n Set forceDefaultThemeVariant t' true t' keep th' reader’s select'n 'n th' browser’s session storage instead o' its local storage, so every new visit starts wit' th' first variant o' themeVariant again, even if th' reader selected another one before. Default be false.

hugo.
params:
  forceDefaultThemeVariant: true
  themeVariant:
  - relearn-light
  - relearn-dark

If yer ship be opened from th' file system, this option has no effect.

Adjust t' OS Sett'ns

A variant wit' th' auto parameter matches th' OS light/dark sett'n. Th' first entry o' auto be th' variant fer light mode, th' second th' one fer dark mode. Usually it makes sense t' set it 'n th' first posit'n an' make it th' default. A ship can have several o' them.

hugo.
params:
  themeVariant:
  - auto:
    - zen-light
    - zen-dark
    identifier: zen-auto
  - identifier: red

Opt'n A miss'n entry o' auto be taken from th' themeVariantAuto option, or else from th' first two variants o' themeVariant that be neither auto mode nor scripted, or else it be relearn-light fer light an' relearn-dark fer dark mode. Th' identifier auto makes a variant an auto mode variant even without th' auto parameter.

hugo.
params:
  themeVariant:
  - auto
  - red
  themeVariantAuto:
  - learn
  - neon

Parameters

Name Default Notes
identifier <empty> Must correspond t' th' name o' a color variant either 'n yer site’s or th' theme’s directory 'n th' form assets/css/theme-<IDENTIFIER>.css. Wit' imports, th' file be optional.
imports <empty> Th' variants an' effects imported into this variant, as if its file started wit' an @import o' each. It can’t be combined wit' auto or script.
name see notes Th' name t' be displayed 'n th' variant selector. If not set, th' identifier be used 'n a human read'ble form. See th' parameter i18n if ye use multiple languages 'n yer ship.
i18n <empty> If set, th' name be taken from th' translat'n files by that key. If th' key has no translat'n, name be used.
auto <empty> If set, th' variant be an auto mode variant. Th' first entry be th' color variant fer light mode, th' second fer dark mode.
script <empty> If set, th' variant be chosen by a script o' this name an' needs no stylesheet o' its own. It can’t be combined wit' auto or print.
params <empty> Values o' th' site’s params that be overridden while this variant be active, see below. A scripted variant passes them t' its script instead.
hidden false If true, th' variant will not be shown 'n th' variant switcher but be still avail'ble fer internal use (e.g. t' override parameter when used as a sub-variant o' an auto mode variant, or t' be chosen by a script).
print see notes Th' print variant used instead o' this variant when print'n. If not set, th' one o' th' themeVariantPrint option be used. An auto mode variant ignores it an' prints wit' th' print variants o' its light an' dark variant.

Variant Parameters

Some o' th' site’s params can be given a different value fer a variant by sett'n it 'n th' variant’s params. While th' variant be active, it takes th' place o' th' site’s value. Th' most prominent example be th' logo, which ye can override fer each variant.

Name Notes
logo Logo o' th' variant, only its src
hugo.
params:
  themeVariant:
  - identifier: relearn-light
  - identifier: neon
    params:
      logo:
        src: /images/logo-neon.svg

Th' variant’s params may hold more, like th' options o' a scripted variant.

Dividers

T' group th' entries o' th' variant switcher, put an entry { type = 'divider' } between them. It draws a line 'n th' variant switcher an' be no variant itself.

Give th' divider a name t' label th' group follow'n it, like { type = 'divider', name = 'Classic' }. A named divider may also stand first t' label th' first group. As wit' variants, an i18n key takes th' name from th' translat'n files instead.

O' consecutive dividers only th' last one be kept. Trail'n dividers be dropped, as be lead'n ones without a name.

Example Configurat'n

hugo.
params:
  themeVariant:
  - name: Modern
    type: divider
  - auto: []
    identifier: relearn-auto
    name: Relearrrn Light/Dark
  - identifier: relearn-light
  - identifier: relearn-dark
  - type: divider
  - auto:
    - zen-light
    - zen-dark
    identifier: zen-auto
    name: Zen Light/Dark
  - identifier: zen-light
  - identifier: zen-dark
  - name: Classic
    type: divider
  - auto:
    - learn
    - neon
    identifier: retro-auto
    name: Retro Learn/Neon
  - identifier: neon
  - identifier: learn

Scripted Variants

A variant wit' a script lets a script choose th' variant t' show, fer example by th' current date or th' time o' day. Th' reader selects it 'n th' variant switcher like any other variant, while th' plank shows an' prints th' variant th' script chooses. Th' script be asked on every plank board.

Th' script be th' file assets/js/<SCRIPT>.js o' yer ship or th' theme. It must define a funct'n o' th' same name. Th' funct'n be called wit' th' configurat'n o' all variants an' th' configurat'n o' th' variant asked fer, an' returns th' identifier o' a variant without a script. Each configurat'n holds every option o' its variant as th' theme prepared it from yours, so a script may read options o' its own from th' params o' its variant. A script must not change them. It may choose hidden variants an' scripted variants, whose script be asked 'n turn, so a script choos'n by th' season can leave th' time o' day t' another.

​
funct'n myVariantByWeekday(variants, variant) {
  var weekday = new Date().getDay();
  return weekday == 0 || weekday == 6 ? 'zen-light' : 'relearn-light';
}
hugo.
params:
  themeVariant:
  - identifier: my-weekday
    name: Weekday/Weekend
    script: myVariantByWeekday
  - hidden: true
    identifier: relearn-light
  - hidden: true
    identifier: zen-light

If th' funct'n fails, returns someth'n else or a scripted variant that was already asked fer, th' first variant o' th' variant switcher that isn’t scripted be shown instead. If th' variant switcher has none, it be th' first variant o' themeVariant that isn’t scripted, even if it be hidden. If all variants o' themeVariant be scripted, th' build stops wit' an error.

Variant by Time

Th' theme ships wit' th' script themeVariantByTime, which chooses a variant by th' local time o' th' reader.

Th' themeVariantByTimeMapp'ns 'n th' params o' its variant map th' local time a variant starts, like 07:30, t' th' identifier o' th' variant t' show from then on. Before th' earliest time o' th' day, th' variant o' th' latest time be shown.

hugo.
params:
  themeVariant:
  - identifier: my-time
    name: Morning/Day/Night
    params:
      themeVariantByTimeMapp'ns:
        '06:00': relearn-light
        '09:00': zen-light
        '20:00': zen-dark
    script: themeVariantByTime
  - hidden: true
    identifier: relearn-light
  - hidden: true
    identifier: zen-light
  - hidden: true
    identifier: zen-dark

See it 'n action wit' Relearrrn Day/Night o' this documentat'n.

Variant by Occasion

Th' theme ships wit' th' script themeVariantByOccasion, which chooses a variant by th' festivals an' seasons o' th' current date.

Th' themeVariantByOccasionMapp'ns 'n th' params o' its variant list which variant t' show fer which occasion. Th' entries be checked 'n th' configured order an' th' first match wins, so put th' more specific ones first. An entry may also show a variant o' th' script by time, so th' occasion picks th' variant an' th' time o' day picks between its light an' dark version.

Name Notes
occasion Th' ID o' an occasion, a date like 2026-12-24 or a date o' every year like 12-24, which match on th' local date o' th' reader. A list o' two o' them matches from th' start o' th' first t' th' end o' th' second, like [ 'advent', 'epiphany' ] or [ '11-15', 'new-year' ]. Without it, th' entry always matches, which makes it a bloody last entry.
variant Th' identifier o' th' variant t' show.

A festival has an ID like christmas or new-year-lunar an' a season one like season-winter-north-meteorological, see th' avail'ble occasions.

hugo.
params:
  themeVariant:
  - identifier: my-occasion
    name: By Occasion
    params:
      themeVariantByOccasionMapp'ns:
      - occasion:
        - advent
        - epiphany
        variant: my-christmas
      - occasion: season-winter-north-meteorological
        variant: my-winter
      - variant: relearn-auto
    script: themeVariantByOccasion
  - auto: []
    identifier: relearn-auto
  - hidden: true
    identifier: my-christmas
  - hidden: true
    identifier: my-winter

See it 'n action wit' Season Day/Night o' this documentat'n, which shows another variant 'n each meteorological season o' th' northern hemisphere, light by day an' dark by night.

Avail'ble Occasions

ID Days
advent 1st Sunday o' Advent t' December 24
buddhas-birthday Buddha’s Birthday o' East Asia, 8th day o' th' 4th Chinese month
carnival Thursday t' Tuesday before Ash Wednesday
christmas December 24 t' 26
christmas-orthodox January 7
day-of-the-dead DĆ­a de los Muertos, November 1 t' 2
diwali Main day o' Diwali wit' two days before an' after
easter Good Friday t' Easter Monday
easter-orthodox Orthodox Good Friday t' Easter Monday
eid-al-adha Four days from th' 10th o' Dhu al-Hijjah
eid-al-fitr Three days from th' 1st o' Shawwal
epiphany January 6
halloween October 31
hanukkah Eight days from th' 25th o' Kislev
holi Holika Dahan an' Holi
mid-autumn Mid-Autumn Festival, 15th day o' th' 8th Chinese month
mid-summer June 19 t' 27, th' days th' celebrat'ns o' th' different countries fall on
new-year December 31 t' January 1
new-year-lunar Lunar New Year t' th' Lantern Festival
nowruz Nowruz t' Sizdah Bedar
pesach Eight days from th' 15th o' Nisan
ramadan Th' month o' Ramadan
rosh-hashanah Two days from th' 1st o' Tishri
thanksgiving-ca Thanksgiv'n o' Canada, 2nd Monday o' October
thanksgiving-us Thanksgiv'n o' th' US, 4th Thursday o' November
vesak First full moon o' May
yom-kippur 10th o' Tishri
season-<SEASON>-<HEMISPHERE>-<RECKONING> A season, like season-winter-north-meteorological, whar' <SEASON> be spr'n, summer, autumn or winter, <HEMISPHERE> be north or south an' <RECKONING> be astronomical, bounded by equinoxes an' solstices, or meteorological, o' whole months like December t' February fer th' northern winter

Random Variant

Th' theme ships wit' th' script themeVariantByRandom, which chooses one o' th' other variants o' themeVariant by chance, includ'n hidden an' scripted ones. As every script, it be asked on every plank board, so each plank may show another variant.

T' choose only from some o' them, list their identifiers 'n themeVariantByRandomVariants 'n th' params o' its variant.

hugo.
params:
  themeVariant:
  - identifier: relearn-light
  - identifier: zen-light
  - identifier: tome-light
  - identifier: my-random
    name: Random
    params:
      themeVariantByRandomVariants:
      - relearn-light
      - zen-light
    script: themeVariantByRandom

See it 'n action wit' Random Fun o' this documentat'n.

Print Variant

When a plank be printed or shown as its print version, it doesn’t use th' variant selected by th' reader but its print variant, wit' th' theme’s print variables on top.

Th' print variables set every color that depends on a light or dark background t' values made fer paper, wit' links, titles, code, boxes an' th' topbar 'n black on white. So th' print shows th' fonts o' th' print variant but th' colors o' paper. Th' print variables be 'n th' theme’s assets/css/format-print-variables.css. T' change them fer yer ship, copy th' file into yer site’s assets/css directory an' edit it. T' keep a single value o' a print variant on paper, mark it !important 'n th' variant.

​
:root {
  --MAIN-LINK-color: rgba( 0, 0, 255, 1 ) !important; /* blue links also on paper */
}

Opt'n Set themeVariantPrint t' th' print variant o' yer ship. Default be relearn-light.

hugo.
params:
  themeVariantPrint: zen-light

Each variant can name its own print variant wit' th' print parameter, which wins over themeVariantPrint. A variant nam'n itself prints wit' its own fonts.

If a print variant has a different print variant itself, by its print parameter or by themeVariantPrint, that one be used instead, an' so on, until a variant names itself. If this comes back t' a variant already visited, th' build stops wit' an error. An auto mode variant prints wit' th' print variants o' its light an' dark variant, follow'n th' reader’s OS sett'n.

In th' follow'n example, both variants print wit' th' fonts o' th' light variant.

hugo.
params:
  themeVariant:
  - auto:
    - my-light
    - my-dark
    identifier: my-auto
  - identifier: my-light
    print: my-light
  - identifier: my-dark
    print: my-light

A print variant doesn’t need t' be part o' themeVariant. If ye list it, set it hidden t' keep it out o' th' variant switcher.

Th' style rules o' a print variant apply t' th' print as well. Wrap rules meant fer th' screen only as shown fer screen-only rules.

Advanced Topics

Creat'n Variants

T' change a shipped variant, decorate it wit' effects or build one o' yer own, see custom variants.

Link'n t' a Variant

Ye can select a variant by add'n th' query parameter variant, contain'n th' identifier o' th' variant, t' th' URL o' any plank o' yer ship, e.g. https://example.com/my-page?variant=relearn-dark. This also works fer links 'n yer rrrambl'n.

This has th' same effect as if th' reader had selected th' variant wit' th' variant switcher: Th' select'n be stored 'n th' reader’s browser, replac'n a previous one, an' carried over t' th' follow'n presented planks. Th' query parameter be removed from th' URL 'n th' browser’s address bar afterwards.

Th' variant must be one o' yer configured variants an' must not be hidden. Otherwise th' query parameter be ignored.

React t' Variant Switches 'n JavaScript

Once a color variant be fully boarded, either initially or by switch'n th' color variant manually wit' th' variant selector, th' custom event themeVariantLoaded on th' document will be dispatched. Ye can add an event listener an' react t' changes.

​
document.addEventListener( 'themeVariantLoaded', funct'n( e ){
  console.log( e.detail.variant ); // `relearn-light`
});
Configurrrat'nĀ >Ā Brrrand'n

Custom Variants

Yer own color variants be configured 'n th' themeVariant option like th' shipped variants. They can build on a shipped variant, change its sett'ns an' add effects t' it.

Modify'n Variants

In case ye like a shipped variant but only want t' tweak some aspects, ye have two choices. Don’t edit th' file 'n th' theme’s directory! Ye will lose th' ability t' later easily upgrade yer theme t' a newer version.

Copy an' Change

Copy th' shipped variant file from th' theme’s themes/hugo-theme-relearn/assets/css directory t' th' site’s assets/css directory an' either store it wit' th' same name or give it a new name. Edit th' sett'ns an' save th' new file. Afterwards, ye can use it 'n yer project configurat'n by th' chosen name.

Import an' Change

Create a new variant file 'n th' site’s assets/css directory an' give it a new name. Import th' shipped variant, add th' sett'ns ye want t' change an' save th' new file. Afterwards, ye can use it 'n yer project configurat'n by th' chosen name.

For example, ye want t' use th' relearn-light variant but want t' change its primary color t' th' one o' yer brand. For that, create a new assets/css/theme-my-brand'n.css 'n yer site’s directory an' add th' follow'n lines:

​
@import "theme-relearn-light.css";

:root {
  --PRIMARY-color: rgba(0, 102, 204, 1); /* color o' yer brand */
  --PRIMARY-HOVER-color: rgba(0, 82, 163, 1); /* color o' yer brand when hovered */
}

Afterwards, put this 'n yer project configurat'n t' use yer new variant:

hugo.
params:
  themeVariant: my-brand'n

In comparison t' copy an' change, this has th' advantage that ye profit from any adjustments t' th' relearn-light variant while keep'n yer modificat'ns.

Imports

A variant can import other variants an' effects 'n two ways, which can be mixed:

  • wit' @import 'n its file assets/css/theme-<IDENTIFIER>.css, like @import "theme-zen-dark.css";
  • wit' th' imports parameter o' th' variant 'n yer project configurat'n, like imports = [ 'theme-zen-dark.css' ]

Both name a file o' yer site’s or th' theme’s assets/css directory, either a variant as theme-<IDENTIFIER>.css or an effect as effect-<NAME>.css. Th' files be imported 'n th' given order, so a later one wins over an earlier one. A variant must not import itself, not even through other variants.

Th' entries o' imports be taken as if they were written at th' start o' th' variant’s file, before its own imports an' sett'ns, also whar' another variant imports it. Wit' imports, th' variant’s file be optional.

As an alternative t' th' example o' import an' change, ye can keep only yer sett'ns 'n a file an' leave th' imports t' th' imports parameter. Such a file can br'n yer sett'ns t' several variants:

​
:root {
  --PRIMARY-color: rgba(0, 102, 204, 1); /* color o' yer brand */
  --PRIMARY-HOVER-color: rgba(0, 82, 163, 1); /* color o' yer brand when hovered */
}

Th' follow'n my-branding-light an' my-branding-dark apply yer sett'ns t' relearn-light an' relearn-dark, an' don’t need files o' their own:

hugo.
params:
  themeVariant:
  - identifier: my-branding-light
    imports:
    - theme-relearn-light.css
    - theme-my-brand'n.css
  - identifier: my-branding-dark
    imports:
    - theme-relearn-dark.css
    - theme-my-brand'n.css

An auto mode variant an' a scripted variant have no stylesheet o' their own an' can’t have imports. Give them t' their light an' dark variant or t' th' variants their script chooses instead.

Effects

Effects decorate a variant beyond its colors. Unless noted otherwise, they be shown on screen only an' don’t apply t' print.

Th' theme ships wit' th' follow'n effects

Name Notes
text-glow'n Makes titles, menu entries an' boxes glow. Set --TEXT-GLOWING-color fer th' color o' th' glow, default be th' text color. Made fer dark variants.
page-glow'n Lets a glow shine 'n from th' edges o' th' screen. Set --PAGE-GLOWING-color fer th' color o' th' glow, default be th' primary color.
corner-glow'n Lets a glow shine 'n from th' upper end corner o' th' screen, over th' rrrambl'n an' th' topbar, which it makes transparent. Set --CORNER-GLOWING-color fer th' color o' th' glow, default be th' primary color.
divider-ornamented Turns th' dividers o' th' rrrambl'n into a short line wit' an ornament 'n its middle an' puts one under every title o' th' rrrambl'n. Set --DIVIDER-ORNAMENTED-content fer th' ornament, default be 'ā–'. Also applies t' print, 'n th' color o' th' text.
callout-light Shows callouts light, wit' a bar 'n their color at th' start instead o' a filled box wit' a frame. Also applies t' print.
menu-marked Marks th' displayed entry o' th' menu wit' a rounded box an' a bar 'n th' primary color at its start.
menu-expander-start Shows th' expanders at th' start o' th' menu entries.
season-winter Decorates th' plank wit' a winter scene o' snow, trees, lights an' a lantern.
content-decorated Decorates th' rrrambl'n wit' a scene o' up t' four images o' yer own, mirrored fer right-to-left languages. Set --CONTENT-DECORATED-CORNER-image fer th' image grow'n 'n from th' upper end corner, --CONTENT-DECORATED-GROUND-END-image an' --CONTENT-DECORATED-GROUND-START-image fer th' images stand'n on th' bottom at th' end an' at th' start, an' --CONTENT-DECORATED-SCATTER-image fer th' image scattered over th' whole rrrambl'n, each like url('my-scene/corner.svg'), default be none. Set them 'n an effect o' yer own that imports content-decorated, as only an effect br'ns th' files it refers t' into yer ship.
backdrop-faded Fades th' scene behind th' rrrambl'n towards th' background color, t' keep th' rrrambl'n read'ble on top o' a scene. Set --BACKDROP-FADED-color fer th' color, default be th' background color o' th' rrrambl'n.
backdrop-milky Lays milky glass over th' scene behind th' rrrambl'n, blurr'n it an' fad'n it towards th' background color. Set --BACKDROP-MILKY-color fer th' color, default be th' background color o' th' rrrambl'n.

See th' effects 'n action wit' Powder or Winter Tome Dark o' this documentat'n.

Us'n Effects

T' use an effect, create yer own variant that imports a variant an' th' effects ye want, one after th' other. Effects that be alternatives t' each other, like backdrop-faded an' backdrop-milky, can’t be combined; choose one o' them.

For that, write th' imports into th' file o' yer variant

​
@import "theme-zen-dark.css";
@import "effect-season-winter.css";
@import "effect-backdrop-faded.css";

an' put this 'n yer project configurat'n t' use yer new variant:

hugo.
params:
  themeVariant: my-winter

Instead, ye can list them 'n th' imports parameter o' yer variant. As yer variant be made o' noth'n but imports, it then doesn’t need a file:

hugo.
params:
  themeVariant:
  - identifier: my-winter
    imports:
    - theme-zen-dark.css
    - effect-season-winter.css
    - effect-backdrop-faded.css

Writ'n Yer Own Effect

Ye can write yer own effect as assets/css/effect-<NAME>.css. An effect can import other effects wit' @import, like @import "effect-backdrop-faded.css";, but no variants. Files it refers t' wit' url() must be placed 'n yer assets directory an' given relative t' th' effect, like url('../images/my-effect/snow.svg'). Wrap its rules as shown fer screen-only rules.

Screen-only Rules

Th' style rules o' a variant also apply when it be used as a print variant. If yer variant contains style rules that be meant fer th' screen only, wrap them as follows. Th' print version o' a plank be shown on screen too, so @media screen alone be not enough.

​
:root:not([data-r-output-format='print']) {
  @media screen {
    h1 {
      text-shadow: 0 0 4px rgba( 255, 255, 255, 1 ); /* a glow, only fer th' screen */
    }
  }
}

Non-standard Modificat'ns

Ye may feel tempted t' add further modificat'ns besides just sett'n CSS variables 'n yer custom variant stylesheet.

While this be poss'ble, please note that due t' th' way th' theme uses th' variant files, th' follow'n will not work:

  • @font-face rules - they need t' be moved t' assets/css/fonts.css, assets/css/custom.css or layouts/partials/custom-header.html
  • rules select'n th' html element - replace html wit' :root
Configurrrat'nĀ >Ā Brrrand'n

Module Theming

Change Rules Highlight'n

If ye want t' switch th' rules highlight'n theme together wit' yer color variant, first ye need t' configure yer installat'n accord'n t' Hugo’s documentat'n t' provide a rules highlight'n stylesheet file.

hugo.
marrrkup:
  highlight:
    noClasses: false

Ye can use one o' th' shipped stylesheet files or use Cap'n Hugo t' generate a file fer ye.

hugo gen chromastyles --style=monokai > chroma-mycode.css

Th' file must be written t' assets/css/chroma-<NAME>.css. T' use it wit' yer color variant, ye have t' modify --CODE-theme: <NAME> 'n th' color variant stylesheet file.

​
@import "theme-relearn-light.css";
:root {
  --CODE-theme: mycode; /* name o' th' chroma stylesheet file */
}

Change 3rd-Party Libraries Them'n

Some o' th' shipped shorrrtcodes be us'n 3rd-party libraries. See th' individual shortcode documentat'n on how t' change their them'n.

Configurrrat'nĀ >Ā Brrrand'n

Stylesheet Generrrat'r

This interactive tool may help ye t' generate yer own color variant stylesheet.

Show usage instruct'ns

T' get started, first select a color variant from th' variant selector 'n th' lower left sidebar that fits ye best as a start'n point.

Th' graph be interactive an' reflects th' current colors. Ye can click on any o' th' colored boxes t' adjust th' respective color. Th' graph an' th' plank will update accordingly.

Th' arrowed lines reflect how colors be inherited through different parts o' th' theme if th' descendant isn’t overwritten. If ye want t' delete a color an' let it inherit from its parent, just delete th' value from th' input field. Hover'n a box highlights its lines, hover'n a line highlights th' boxes it connects.

T' better understand this, select th' neon variant an' modify th' different head'n colors. There, colors fer th' head'ns h2, h3 an' h4 be explicitly set. h5 be not set an' inherits its value from h4. h6 be also not set an' inherits its value from h5.

Once you’ve changed a color, th' variant selector will show a “My custom variant” entry an' yer changes be stored 'n th' browser. Ye can browse t' other planks an' even close th' browser without los'n yer changes.

Once ye be satisfied, ye can download th' new variants file an' copy it into yer site’s assets/css directory.

Opt'n Afterwards, ye have t' adjust th' themeVariant option 'n yer project configurat'n t' yer chosen file name. For example, if yer new variants file be named theme-my-zen-light.css, ye have t' set themeVariant t' my-zen-light t' use it.

See th' docs fer further configurat'n options.

Avast
Th' CODE-theme parameter can be changed 'n th' generator but th' change will not be reflected dynamically 'n th' plank preview.
Graph