-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add ability to derive from a base theme #2454
Comments
I want to so this, but would need some pointers where to begin ;) |
Another thing to consider: Should the derived theme be able to override or use palette variables from the base one, or are the palettes only valid within the same theme? |
I didn’t have the term « palette » but that’s what I wanted to say there If palette are not merged or overridable, we end up in pretty much the same situation as now, because colors will go out of sync again |
You could add an Lines 92 to 98 in af387e6
String which would be equal to the name of a theme.
Then you could look for the theme within Lines 38 to 56 in af387e6
There is already a function to merge Lines 114 to 168 in 2c7f770
Palette colors may need special handling so the palette doesn't completely overwrite the inherited palette. |
@kirawi hey thank you a lot, this will help me out! Also I was thinking this approach will only allow to completely overwrite some properties. But wont work if one only wants to remove ie. underlined style. |
So I played around a bit and decided to provide a solution which uses an intermediate inherit_from = "gruvbox"
[palette]
bg0 = "#ffffff" and his background will be white. |
This looks pretty good, would this work as well? inherit_from = "gruvbox"
ui.background = "#ffffff" |
@CptPotato Also, I will update this, because right now your custom theme needs to have another name than the theme you are inheriting from. But I like to name my theme |
It should now be possible to name the custom theme in user dir the same as the default dir one. |
My use case would be to inherit Will it be possible to inherit from multiple files? One could have different files for foreground, background and ruler themes and combine them, or : What about just overwriting variables by allowing to load more than one theme in a sequence? E.g.:
would become:
|
@getreu |
@kirawi would you mind to review the proposed solution? |
Describe your feature request
Currently if I want to experiment with changes to a theme, I need to copy the original theme file and modify this copy. If the original is updated from upstream, I don't get those updates. If I haven't made a copy and directly modified the original, it's either overwritten, losing my changes, or causes a merge conflict if I have it in a local branch of
helix
.I would like the ability to have something like
[fallback] name = "gruvbox"
(or[origin]
,[source]
, etc, name is bikeshedable) in theme files, so that I can modify only the keys that interest me while keeping the rest.This could work by merging the TOMLs, like for the user config and the default one. Merging the TOMLs would also let me use colors declared in the original or override them.
It could even be done recursively so that I can have
gv2 -> gv1 -> gruvbox
if necessary, but that's just a nice-to-have.The text was updated successfully, but these errors were encountered: