You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request] Extensions: ability to detect light/dark theme #7589
changed the title [-]Extensions: ability to detect light/dark theme[/-][+][Feature Request] Extensions: ability to detect light/dark theme[/+]on Jun 12, 2016
Nicolas Ramz (@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.
Nicolas Ramz (@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: vscode-light, vscode-dark, and vscode-high-contrast. Depending on the theme one of them is set on the document body.
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?
Reacted by Ruben Kälin, Hanyu Xiao and Jonas Hoehne
Activity
[-]Extensions: ability to detect light/dark theme[/-][+][Feature Request] Extensions: ability to detect light/dark theme[/+]rebornix commentedon Jun 13, 2016
Nicolas Ramz (@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.
jrieken commentedon Jun 13, 2016
Nicolas Ramz (@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?
jrieken commentedon Jun 15, 2016
With PR #7656 we will introduce these class names:
vscode-light,vscode-dark, andvscode-high-contrast. Depending on the theme one of them is set on the document body.warpdesign commentedon Jun 15, 2016
Johannes Rieken (@jrieken) that's perfect!
👍
jrieken commentedon Jun 25, 2016
We have this since merging the MD extension to master:
vscode-light,vscode-dark, orvscode-high-contrast(https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/html/browser/webview.ts#L46)jrieken commentedon Jun 27, 2016
jaime-olivares commentedon Aug 1, 2016
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?