提交 86f27d88 编写于 作者: A Alex Dima

Fixes #3642: Generate dynamic CSS for decorations also for high contrast

上级 0de53e09
......@@ -107,6 +107,7 @@ class DecorationRenderOptions implements IModelDecorationOptions {
public dispose(): void {
dom.removeCSSRulesWithPrefix(CSSNameHelper.getDeletionPrefixFor(ThemeType.Light, this._key), this._styleSheet);
dom.removeCSSRulesWithPrefix(CSSNameHelper.getDeletionPrefixFor(ThemeType.Dark, this._key), this._styleSheet);
dom.removeCSSRulesWithPrefix(CSSNameHelper.getDeletionPrefixFor(ThemeType.HighContrastBlack, this._key), this._styleSheet);
}
private static _CSS_MAP = {
......@@ -221,6 +222,7 @@ class DecorationRenderOptions implements IModelDecorationOptions {
}
if (darkCSS.length > 0) {
this._createCSSSelector(styleSheet, ThemeType.Dark, key, ruleType, darkCSS);
this._createCSSSelector(styleSheet, ThemeType.HighContrastBlack, key, ruleType, darkCSS);
}
return CSSNameHelper.getClassName(key, ruleType);
}
......@@ -234,7 +236,8 @@ class DecorationRenderOptions implements IModelDecorationOptions {
enum ThemeType {
Light = 0,
Dark = 1
Dark = 1,
HighContrastBlack = 2
}
enum ModelDecorationCSSRuleType {
ClassName = 0,
......@@ -247,7 +250,10 @@ class CSSNameHelper {
if (theme === ThemeType.Light) {
return '.monaco-editor.vs';
}
return '.monaco-editor.vs-dark';
if (theme === ThemeType.Dark) {
return '.monaco-editor.vs-dark';
}
return '.monaco-editor.hc-black';
}
public static getClassName(key:string, type:ModelDecorationCSSRuleType): string {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册