-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Very unclear how to edit other (non-default) themes or add new themes #605
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
Comments
Hello! All of the themes are in The stylus files are simply used to help generate
There isn't currently a specific configuration for adding a theme, but it's not that hard:
var theme_list = document.getElementById('theme-list');
var theme = document.createElement('li');
theme.innerHTML = '<button class="theme" id="YOUR THEME NAME HERE">And here</button>';
theme_list.appendChild(theme); |
Thanks. That helps clear it up a lot. |
@mattico, would it be worth adding these instructions to the user guide? |
Yes, of course. Also theme support wouldn't be that hard. |
I'm trying to use mdBook and am finding it extremely unclear how to edit other themes (aside from the default light theme) or add entirely new themes. I've read through the user guide but I don't feel like it addresses this at all.
I understand that you can run
mdbook init --theme
to generate the "theme" directory. I understand that you can edit files in this directory, and whatever is in here will override what mdBook uses. I can for example edit book.js to edit the theme pop-up menu, and can edit book.css to change some colours - but it only changes the default light theme.I don't want to change the default light theme. I want to leave that as it is. What I want to do is override one of the other themes, e.g. the Rust theme. Or otherwise add a new theme entirely. And there appears to be no documentation on how to do this, or if there is then I'm missing it entirely.
I've tried adding a "theme/stylus" directory, and copying in / adding files there (e.g. "rust.styl" or "custom-theme.styl"), but it appears that any files in there are just ignored and don't override what mdBook uses. I don't know what I'm doing here.
Could I get any help with this? Thanks.
The text was updated successfully, but these errors were encountered: