Skip to content

Pick up the bundled code-highlighting palettes from site-commons #561

Closed

Description

@alexander-yevsyukov

SpineEventEngine/site-commons#35 decided to move the code-highlighting palettes into the theme's SCSS bundle (option B). The change is in SpineEventEngine/site-commons#37.

What changes for this site

Nothing in the templates:

  • site/layouts/_partials/head/head.html keeps including theme/head/code-theme.html. The partial now renders only the inline theme script, with no <link id="code-theme-css">.
  • site/assets/scss/main.scss already imports theme-main, so the palettes come with main.css.

After the update:

  • Pages no longer request /code-theme/dark.css and /code-theme/light.css. These files are no longer published.
  • <html data-theme> is set before the first paint on every page, including first visits. Until now it was set on DOM ready. site/static/libs/docsearch/variables.css keys off html[data-theme='dark'], but its dark values are the same as the light ones, so the search modal does not change.

To do

Once SpineEventEngine/site-commons#37 is merged:

  • Update the theme in site/ with hugo mod get -u github.com/SpineEventEngine/site-commons, then commit go.mod and go.sum.
    The current theme already requires Hugo v0.169.0, and CI uses v0.161.1. So this update goes with the Hugo upgrade (Upgrade Hugo to v0.169.0 documentation#89).
  • On a docs page with code blocks, check that:
    • the toggle above a code block switches the colors at once;
    • after reloading with the light theme selected, no dark token colors show while the page loads;
    • in a private window, code blocks are dark and have their background from the first paint.

Activity

  1. moved this to 📋 Backlog in v2.0on Oct 30, 2026
  2. alexander-yevsyukov commented on Nov 2, 2026

    @alexander-yevsyukov
    ContributorAuthor

    Done on master:

    • Move to Hugo v0.169.0 and the latest site-commons #562 (5630c93) updated the theme to b79100d, the merge commit of Bundle the code-highlighting palettes into the SCSS (option B of #35) site-commons#37, together with the move to Hugo v0.169.0. CI uses v0.169.0.
    • On the live docs (/docs/validation/user/03-built-in-options/field-level-options/), pages request no /code-theme/*.css, and those URLs return 404. The theme script runs in <head> before main.css.
    • The toggle switches the code colors in the same tick, without loading a stylesheet.
    • After reloading with the light theme selected, data-theme="light" is set before main.css applies, so no dark token colors show while the page loads.
    • With no themeColor cookie (as in a private window) and a light system preference, code blocks are dark from the start.

    🤖 Checked by Claude Code

  3. moved this from 📋 Backlog to ✅ Done in v2.0on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions