-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add additional-theme option #2059
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
base: master
Are you sure you want to change the base?
Conversation
80646e3
to
b335dbf
Compare
Is there anything that needs to be done before this can be merged upstream? Myself and a few people in the Catppuccin discord were curious as to the status of this since this PR would greatly help out our theming project for mdBook I am more than willing to help out where I can with anything that needs to be finished up. |
@ehuss forgot to ping you in my original comment. Please see #2059 (comment) |
Thanks, I think this would help with my use case. Since I thought about implementing this independently I'll leave some comments for the benefit of the maintainers.
I think this is fine for now. A theme inheritance mechanism would just add complexity and should be done later.
The highlight CSS is easy enough to override with selectors like The only thing this doesn't work for is the editor theme. Maybe there is a CSS-only way to style that or maybe we'll need to extend the configuration to specify whether the theme is light or dark. Either way since the editor is an optional feature, I think it's fine to merge this PR as-is. |
It would be ideal to decouple the theme name in the UI from the class name used for the theme. |
I opened #2594 with a smaller diff that requires no JS logic. |
Closes #2048
This allows users to specify additional themes without replacing the presets.
Example usage
book.toml
orange.css
Click to expand
Limitations
Can we figure out an easy way to derive the variable values from the presets?
What would be the most appropriate way for the theme class to declare itself as a dark-based or light-based theme and have the correct syntax highlight selected?