Allow CSS variables in themes
See original GitHub issueIt would be awesome if Monaco would allow any valid CSS value to be used for theme colors:
monaco.editor.defineTheme('mytheme', {
colors: {
'editor.background': 'var(--color-code-bg)',
}
}
This currently fails the validation with this error:
Error: Illegal value for token color: var(--color-code-bg)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to create better themes with CSS variables
CSS variables differ from preprocessor variables in a number of ways. CSS variables are dynamic variables: Once set, their value is not fixed....
Read more >The simplest CSS variable dark mode theme - Luke Lowrey
Using CSS variables for themes. CSS variables are properties you can set in your stylesheets that can be used in later styles. They...
Read more >Dynamic theme with CSS Variables - Medium
Customize the theme with CSS variables. Enable theming with CSS variables is extremely simple and straightforward, with the following steps:.
Read more >How to Create a Themes Engine Using CSS Variables and ...
To get a value defined on an element: const primary = getComputedStyle(element).
Read more >Theming With CSS Variables - Prototypr
The easiest way is to use CSS variables — manage hundreds of places where you implemented different styles much better with a small...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@silverwind
You can get the computed style at the editor level. CSS variables cascade down no matter where they are declared.
+1 for that. It would be very helpful to be able to manage all colors from one place