-
Notifications
You must be signed in to change notification settings - Fork 29.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
[Feature Request] Extensions: ability to detect light/dark theme #7589
Comments
@warpdesign we are extracting VS Code's markdown support to a separate extension and we've implemented the theme detection both in the extension and vscode side. Please keep an eye on #6106, once June release is out, you'll get what you want. |
@warpdesign The view your html is rendered in uses some css variables which hold values for the background and foreground colors. Would those be sufficient? |
With PR #7656 we will introduce these class names: |
@jrieken that's perfect! |
We have this since merging the MD extension to master: |
|
Relying on CSS class names won't help in all use-cases. Sometimes you need to know the theme "darkness" before generating the output html (bitmap, svg, etc.). From an extension, we are able to know almost every editor setting. Why the theme is an exception? Isn't it better to have an enumeration with light/dark/contrast values? or even access to every theme color for a precise matching? |
It seems there's no way to detect the if the current theme is dark or light.
This can be a problem if the extension has complex css, like this one http://stackoverflow.com/questions/37257911/detect-light-dark-theme-programatically-in-visual-studio-code
It would be great if there was a way to determine the kind of theme applied from the extension
The text was updated successfully, but these errors were encountered: