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

[themes] Allow custom variables and references in workbench color customizations section #56855

Open
yuval-gilboa opened this issue Aug 20, 2018 · 8 comments
Assignees
Labels
feature-request Request for new features or functionality themes Color theme issues
Milestone

Comments

@yuval-gilboa
Copy link

This is a feature request to allow defining custom color variables in the workbench color customizations section. It would allow creating a small palette of colors and reusing it across the workbench color definitions, saving many repetitions and making it much easier to maintain.

This is just simple text substitution based on some naming convention like the .less @variable convention. For example, see the @PaletteXXX variables in the sample below:

"workbench.colorCustomizations": {

      // custom colors
      "@Palette000": "#FFFFFF",
      "@Palette050": "#ECEFF1",
      "@Palette100": "#CFD8DC",
      "@Palette200": "#B0BEC5",
      "@Palette300": "#90A4AE",
      "@Palette700": "#455A64",

      // input control
      "input.background": "@Palette000",
      "input.foreground": "@Palette700",
      "input.placeholderForeground": "@Palette200",
      "inputOption.activeBorder": "@Palette300",
      "input.border": "@Palette100",

      // list views
      "list.activeSelectionBackground": "@Palette200",
      "list.activeSelectionForeground": "@Palette700",
      "list.inactiveSelectionBackground": "@Palette100",
      "list.hoverBackground": "@Palette100",
      "list.dropBackground": "@Palette100",
      "list.focusBackground": "@Palette100",

@vscodebot vscodebot bot added the themes Color theme issues label Aug 20, 2018
@aeschli aeschli changed the title Allow custom variables in workbench color customizations section [themes] Allow custom variables in workbench color customizations section Aug 22, 2018
@aeschli aeschli added the feature-request Request for new features or functionality label Aug 22, 2018
@aeschli aeschli added this to the Backlog milestone Aug 22, 2018
@aeschli
Copy link
Contributor

aeschli commented Aug 22, 2018

Interesting idea!

@angelhdzdev
Copy link

angelhdzdev commented Mar 18, 2019

Was this implemented or not yet? I also need to define custom variables in workspaces not to repeat myself.

@kanlukasz
Copy link

It should be implemented.

Why:

  • When creating themes (and / or scope colors) with many colors, it is difficult to manage them

An example of how the theme is created in Sublime Text:

obraz

@runxel
Copy link

runxel commented Dec 30, 2019

I'm really astonished how this could be forgotten. VS Code is great so far, but this is a real big oversight, imho.
Also not supporting HSL(A) is a pain. :D

@videopilot
Copy link

videopilot commented Apr 8, 2020

This is something that Atom does really well. It allows creating variables as well as having other variables based on modifications to those. So for example, and overall blue theme could really just specify one blue color and lighter and darker elements would be based on that.

image

@muuvmuuv
Copy link
Contributor

Would even take it further and say that this should also be modifiable by user settings. So for example I use the ayu-light theme and I don't like the orange highlighting, in my settings I would then override theme variables and tokens that are defined by the author:

{
  "workbench.colorCustomizations": {
    "teabyii.ayu": {
      "@primary": "hsl(40, 40%, 20%)"
      "input.background": "#2cbe4f", // previously `@primary`
    }
  },
}

This would allow modifying themes differently, since VS Code now has a dark and night theme switch.

@memeplex
Copy link

#73069 was closed as dup of this although I believe the intention was different: to refer to colors already defined by themes, not to variables defined by the end user. For example, if I want the base foreground color for markdown emphasis, instead of the more colorful variants many themes apply, I would like to express "for this use what this theme defines as the default foreground color" without having to hardcode colors for each theme.

@aeschli aeschli changed the title [themes] Allow custom variables in workbench color customizations section [themes] Allow custom variables and references in workbench color customizations section Jan 19, 2022
@aeschli
Copy link
Contributor

aeschli commented Jan 19, 2022

I'm expanding the issue to 'variables' and 'references'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality themes Color theme issues
Projects
None yet
Development

No branches or pull requests

8 participants