-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Allow CSS variables in themes #2427
Comments
This would be nice, but problematic to implement because we render also the minimap based on those colors and in the minimap we use a |
You could get the resolved color via window.getComputedStyle(document.documentElement).getPropertyValue('--varname').trim() I think this method would only work for variables defined on CSS |
This feature would make maintaining our themes much easier as we could handle the colors in one place, instead of duplicating colors between CSS and the Monaco config. In our project we don't really use the minimap and don't care about it. |
You can get the computed style at the editor level. CSS variables cascade down no matter where they are declared. const monacoRoot = document.querySelector('.monaco-editor');
const varnameValue = getComputedStyle(monacoRoot).getPropertyValue('--varname'); |
+1 for that. |
We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider. If you wonder what we are up to, please see our roadmap and issue reporting guidelines. Thanks for your understanding, and happy coding! |
It would be awesome if Monaco would allow any valid CSS value to be used for theme colors:
This currently fails the validation with this error:
The text was updated successfully, but these errors were encountered: