Skip to content

How to use custom color schemes #2340

Open
@newhinton

Description

@newhinton

Question

In the past i used to add two new items for "themes" to the index.hbs

...
<ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
    <li role="none"><button role="menuitem" class="theme" id="my-new-style">{{ theme_option "My Light Theme" }}</button></li>
...

Then i added custom css via book.toml to create the "style":

.my-new-style {
  --bg: hsl(210, 1.9%, 78.8%);
  ...
}

This seemed to work, but with newer versions it breaks like this issue: #2131
Is there an easy way to add custom styles? I still can use those changes, but they make it impossible to set new "styles" as default styles. Thanks for your help!

Version

Used to work:
mdbook v0.4.34

Current:
mdbook v0.4.36

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ThemeArea: ThemeC-questionCategory: A question on how to do something

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions