提交 8132b809 编写于 作者: C Christof Marti

Reduce number of colors used (#27497)

上级 179e7983
...@@ -23,7 +23,8 @@ import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/cont ...@@ -23,7 +23,8 @@ import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/cont
import { KeyCode } from 'vs/base/common/keyCodes'; import { KeyCode } from 'vs/base/common/keyCodes';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { registerColor, textPreformatForeground } from 'vs/platform/theme/common/colorRegistry'; import { textPreformatForeground, foreground } from 'vs/platform/theme/common/colorRegistry';
import { Color } from 'vs/base/common/color';
interface Key { interface Key {
id: string; id: string;
...@@ -238,15 +239,12 @@ Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions) ...@@ -238,15 +239,12 @@ Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions)
// theming // theming
const foreground = registerColor('welcomeOverlay.foreground', { dark: '#fff', light: '#000', hc: '#fff' }, localize('welcomeOverlay.foreground', 'Foreground color for the Interface Overview.'));
const background = registerColor('welcomeOverlay.background', { dark: '#00000085', light: '#FFFFFF85', hc: '#00000085' }, localize('welcomeOverlay.background', 'Background color for the Interface Overview.'));
registerThemingParticipant((theme, collector) => { registerThemingParticipant((theme, collector) => {
const key = theme.getColor(foreground); const key = theme.getColor(foreground);
if (key) { if (key) {
collector.addRule(`.monaco-workbench > .welcomeOverlay > .key { color: ${key}; }`); collector.addRule(`.monaco-workbench > .welcomeOverlay > .key { color: ${key}; }`);
} }
const backgroundColor = theme.getColor(background); const backgroundColor = Color.fromHex(theme.type === 'light' ? '#FFFFFF85' : '#00000085');
if (backgroundColor) { if (backgroundColor) {
collector.addRule(`.monaco-workbench > .welcomeOverlay { background: ${backgroundColor}; }`); collector.addRule(`.monaco-workbench > .welcomeOverlay { background: ${backgroundColor}; }`);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册