提交 f8d858d1 编写于 作者: J Johannes Rieken

deco - enforce via css that selected/focused items inherit base color

上级 57013140
...@@ -55,3 +55,11 @@ ...@@ -55,3 +55,11 @@
text-align: right; text-align: right;
padding: 0 12px 0 5px; padding: 0 12px 0 5px;
} }
.focused .selected .monaco-icon-label, /* tree */
.focused .selected .monaco-icon-label::after,
.focused.selected .monaco-icon-label, /* list */
.focused.selected .monaco-icon-label::after
{
color: inherit !important;
}
...@@ -51,11 +51,9 @@ class DecorationRule { ...@@ -51,11 +51,9 @@ class DecorationRule {
const { color, letter } = data; const { color, letter } = data;
// label // label
createCSSRule(`.${this.labelClassName}`, `color: ${theme.getColor(color) || 'inherit'};`, element); createCSSRule(`.${this.labelClassName}`, `color: ${theme.getColor(color) || 'inherit'};`, element);
createCSSRule(`.focused .selected .${this.labelClassName}`, `color: inherit;`, element);
// letter // letter
if (letter) { if (letter) {
createCSSRule(`.${this.badgeClassName}::after`, `content: "${letter}"; color: ${theme.getColor(color) || 'inherit'};`, element); createCSSRule(`.${this.badgeClassName}::after`, `content: "${letter}"; color: ${theme.getColor(color) || 'inherit'};`, element);
createCSSRule(`.focused .selected .${this.badgeClassName}::after`, `color: inherit;`, element);
} }
} }
...@@ -63,12 +61,12 @@ class DecorationRule { ...@@ -63,12 +61,12 @@ class DecorationRule {
// label // label
const { color } = data[0]; const { color } = data[0];
createCSSRule(`.${this.labelClassName}`, `color: ${theme.getColor(color) || 'inherit'};`, element); createCSSRule(`.${this.labelClassName}`, `color: ${theme.getColor(color) || 'inherit'};`, element);
createCSSRule(`.focused .selected .${this.labelClassName}`, `color: inherit;`, element);
// badge // badge
let content = data.map(d => d.letter).join(', '); const letters = data.filter(d => Boolean(d)).map(d => d.letter);
createCSSRule(`.${this.badgeClassName}::after`, `content: "${content}"; color: ${theme.getColor(color) || 'inherit'};`, element); if (letters.length) {
createCSSRule(`.focused .selected .${this.badgeClassName}::after`, `color: inherit;`, element); createCSSRule(`.${this.badgeClassName}::after`, `content: "${letters.join(', ')}"; color: ${theme.getColor(color) || 'inherit'};`, element);
}
} }
removeCSSRules(element: HTMLStyleElement): void { removeCSSRules(element: HTMLStyleElement): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册