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

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

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