Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple colour themes #51

Open
dantownsend opened this issue Mar 27, 2023 · 4 comments
Open

Multiple colour themes #51

dantownsend opened this issue Mar 27, 2023 · 4 comments

Comments

@dantownsend
Copy link
Member

We could provide an option which sets the primary colour. It's currently blue, but we should be able to add green, orange etc.

The user can then specify the colour theme via html_theme_options.

html_theme_options = {
    "theme_color": "orange"
}

# Or let them specify an arbitrary colour primary colour
html_theme_options = {
    "theme_color": "#abc123"
}

This value will then be assigned to a CSS variable.

Screenshot 2023-03-27 at 18 17 35

@drneavin
Copy link

Any chance on this being implemented? I'm trying to change the banner and highlight text to another color. If not implemented, would you be able to let me know if I could alter than in a customs.css file? I've tried a few approaches but have come up empty handed (sorry I don't have lots of CSS or HTML experience so if you could provide an example would be greatly appreciated!)

@drneavin
Copy link

I worked out how to do it with a .css file - turned out that once I provided the html_static_path in the conf.py, it wasn't needed in the html_css_files so when trying to add the custom variables, it was calling a file from the wrong directory

@dantownsend
Copy link
Member Author

@drneavin Glad you got it sorted. Will try and get this issue resolved soon.

@diamuxin
Copy link

diamuxin commented Nov 19, 2024

Hi, I've tried your recommendation in conf.py but it doesn't work:

html_theme_options = {
    "theme_color": "#abc123"
}

How can I modify the style sheet from:
docs/_build/static/css/my_theme_piccolo.css

In conf.py I've already put:

html_static_path = ['_static']
html_style = 'css/my_theme_piccolo.css'

Content of my_theme_piccolo.css:

@import url("basic_mod.css");
/* Typography */
:root {
--mainNavColor: #2471a3;
--notificationBannerColor: #176bb0;
}

But it doesn't work. Please help?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants