-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
[theme] allow variables in the color theme definition file #105247
Comments
Your request is kind of similar to #56855. It asks for color variables but for the color configurations in the user settings. ( One can think of a solution that works for themes and settings, e.g. like in the snippet below, I'm a bit afraid that things get quite complex. So I wouldn't mind looking at a solution just for the color theme file, as you propose. If you have interest to look at it, I'd be open for a PR. But we first would need to agree on the syntax. Here's a attempt based on the proposals from #56855:
|
I have to agree with your syntax, separate object for variables does seem like a better approach, and having it as a string pattern for variables makes it much easier implementation-wise instead of using an object. |
Can I ask what the status on this is? Also I would humbly suggest to think about a syntax that is more like CSS custom properties, as I guess that most theme developers have a background in that:
It would maybe at some point in the future allow for more complex but very useful addition like hsl colors and separated lightness values or even transparency like CSS color palettes can do. But that's just an idea I would love to see the support for color palettes very much regardless of the syntax. |
@iDad5 Sorry, we currently have no plans to implement such a feature. But we're open for a PR. |
Ok, as I have admitted earlier, I do not have real experience in contribution to such a large project in that way, but I do consider trying it, as the task itself - at least from the outside seems doable and I like a challenge. How would we go about ist? |
Check out https://github.com/microsoft/vscode/wiki/How-to-Contribute on how to set up the repo |
@aeschli Thank you for your reply! Looks like a good starting point, I've already had a glance at How-to-Conrtibute and even though I'll have a learning curve, it seems doable. the colorThemeData.ts and the entry point you provided is very helpful. Thanks. I know that you are very busy and I hate to trouble you with questions, so if anyone else can help me out I would be grateful too: Before I would start giving it a try my questions would be:
Is that an acceptable way to go on? |
Thanks @iDad5, sounds good. Maybe name it On the variable syntax, I'm more in favor of the dollar syntax. Either |
I would propose to call it ColorPaletteParser then, if that is ok, as I would like to see (at some point) the option to define colors not only in rgb-hash notation but also in hsl wich is much more intuitive for use in color-themes. Provided that we are using json the $variable variant would be for me the way to go then. (Currently I'm testing out which way I would like to set up my environment for that development, so it'll take a little while before I actually will be starting programming...) |
Hello |
Support of using already defined colors in a theme's theming rule will make themes a much more pleasant and easier experience in my opinion, instead of having a bunch of hexes all over the place or having to change all the occurrences when changing a widely used color.
Example:
Can be achieved using:
Syntax for this feature is up for discussion,
Can work on a PR for this if its relevant.
The text was updated successfully, but these errors were encountered: