theme.ts 23.2 KB
Newer Older
1 2 3 4 5 6
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import nls = require('vs/nls');
7
import { registerColor, editorBackground, contrastBorder, transparent, editorWidgetBackground, textLinkForeground, lighten, darken } from 'vs/platform/theme/common/colorRegistry';
B
Benjamin Pasero 已提交
8
import { IDisposable, Disposable, dispose } from 'vs/base/common/lifecycle';
9
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
B
Benjamin Pasero 已提交
10
import { Color } from 'vs/base/common/color';
11

12 13 14 15 16 17 18 19 20 21 22 23 24
// < --- Workbench (not customizable) --- >

export function WORKBENCH_BACKGROUND(theme: ITheme): Color {
	switch (theme.type) {
		case 'dark':
			return Color.fromHex('#252526');
		case 'light':
			return Color.fromHex('#F3F3F3');
		default:
			return Color.fromHex('#000000');
	}
}

25 26
// < --- Tabs --- >

27
export const TAB_ACTIVE_BACKGROUND = registerColor('tab.activeBackground', {
28 29 30
	dark: editorBackground,
	light: editorBackground,
	hc: editorBackground
B
Benjamin Pasero 已提交
31
}, nls.localize('tabActiveBackground', "Active tab background color. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));
32

33
export const TAB_INACTIVE_BACKGROUND = registerColor('tab.inactiveBackground', {
34 35
	dark: '#2D2D2D',
	light: '#ECECEC',
B
Benjamin Pasero 已提交
36
	hc: null
B
Benjamin Pasero 已提交
37
}, nls.localize('tabInactiveBackground', "Inactive tab background color. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));
38

39 40 41 42 43 44 45 46 47 48 49 50
export const TAB_HOVER_BACKGROUND = registerColor('tab.hoverBackground', {
	dark: null,
	light: null,
	hc: null
}, nls.localize('tabHoverBackground', "Tab background color when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));

export const TAB_UNFOCUSED_HOVER_BACKGROUND = registerColor('tab.unfocusedHoverBackground', {
	dark: transparent(TAB_HOVER_BACKGROUND, 0.5),
	light: transparent(TAB_HOVER_BACKGROUND, 0.7),
	hc: null
}, nls.localize('tabUnfocusedHoverBackground', "Tab background color in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));

51
export const TAB_BORDER = registerColor('tab.border', {
B
Benjamin Pasero 已提交
52 53
	dark: '#252526',
	light: '#F3F3F3',
54
	hc: contrastBorder
B
Benjamin Pasero 已提交
55 56
}, nls.localize('tabBorder', "Border to separate tabs from each other. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));

57 58 59 60 61 62 63 64 65 66 67 68
export const TAB_ACTIVE_BORDER = registerColor('tab.activeBorder', {
	dark: null,
	light: null,
	hc: null
}, nls.localize('tabActiveBorder', "Border to highlight active tabs. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));

export const TAB_UNFOCUSED_ACTIVE_BORDER = registerColor('tab.unfocusedActiveBorder', {
	dark: transparent(TAB_ACTIVE_BORDER, 0.5),
	light: transparent(TAB_ACTIVE_BORDER, 0.7),
	hc: null
}, nls.localize('tabActiveUnfocusedBorder', "Border to highlight active tabs in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));

69 70 71 72 73 74 75 76 77 78 79 80
export const TAB_HOVER_BORDER = registerColor('tab.hoverBorder', {
	dark: null,
	light: null,
	hc: null
}, nls.localize('tabHoverBorder', "Border to highlight tabs when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));

export const TAB_UNFOCUSED_HOVER_BORDER = registerColor('tab.unfocusedHoverBorder', {
	dark: transparent(TAB_HOVER_BORDER, 0.5),
	light: transparent(TAB_HOVER_BORDER, 0.7),
	hc: null
}, nls.localize('tabUnfocusedHoverBorder', "Border to highlight tabs in an unfocused group when hovering. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));

81
export const TAB_ACTIVE_FOREGROUND = registerColor('tab.activeForeground', {
82
	dark: Color.white,
B
Benjamin Pasero 已提交
83
	light: '#333333',
84
	hc: Color.white
85
}, nls.localize('tabActiveForeground', "Active tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));
86

87
export const TAB_INACTIVE_FOREGROUND = registerColor('tab.inactiveForeground', {
B
Benjamin Pasero 已提交
88 89
	dark: transparent(TAB_ACTIVE_FOREGROUND, 0.5),
	light: transparent(TAB_ACTIVE_FOREGROUND, 0.5),
90
	hc: Color.white
91 92 93 94 95 96
}, nls.localize('tabInactiveForeground', "Inactive tab foreground color in an active group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));

export const TAB_UNFOCUSED_ACTIVE_FOREGROUND = registerColor('tab.unfocusedActiveForeground', {
	dark: transparent(TAB_ACTIVE_FOREGROUND, 0.5),
	light: transparent(TAB_ACTIVE_FOREGROUND, 0.7),
	hc: Color.white
97
}, nls.localize('tabUnfocusedActiveForeground', "Active tab foreground color in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));
98 99 100 101 102

export const TAB_UNFOCUSED_INACTIVE_FOREGROUND = registerColor('tab.unfocusedInactiveForeground', {
	dark: transparent(TAB_INACTIVE_FOREGROUND, 0.5),
	light: transparent(TAB_INACTIVE_FOREGROUND, 0.5),
	hc: Color.white
103
}, nls.localize('tabUnfocusedInactiveForeground', "Inactive tab foreground color in an unfocused group. Tabs are the containers for editors in the editor area. Multiple tabs can be opened in one editor group. There can be multiple editor groups."));
104

105 106 107

// < --- Editors --- >

108
export const EDITOR_GROUP_BACKGROUND = registerColor('editorGroup.background', {
109 110 111 112 113
	dark: '#2D2D2D',
	light: '#ECECEC',
	hc: null
}, nls.localize('editorGroupBackground', "Background color of an editor group. Editor groups are the containers of editors. The background color shows up when dragging editor groups around."));

B
Benjamin Pasero 已提交
114 115 116 117 118 119
export const EDITOR_GROUP_HEADER_TABS_BACKGROUND = registerColor('editorGroupHeader.tabsBackground', {
	dark: '#252526',
	light: '#F3F3F3',
	hc: null
}, nls.localize('tabsContainerBackground', "Background color of the editor group title header when tabs are enabled. Editor groups are the containers of editors."));

120 121 122 123 124 125
export const EDITOR_GROUP_HEADER_TABS_BORDER = registerColor('editorGroupHeader.tabsBorder', {
	dark: null,
	light: null,
	hc: contrastBorder
}, nls.localize('tabsContainerBorder', "Border color of the editor group title header when tabs are enabled. Editor groups are the containers of editors."));

B
Benjamin Pasero 已提交
126
export const EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND = registerColor('editorGroupHeader.noTabsBackground', {
B
Benjamin Pasero 已提交
127 128 129
	dark: editorBackground,
	light: editorBackground,
	hc: editorBackground
130
}, nls.localize('editorGroupHeaderBackground', "Background color of the editor group title header when tabs are disabled (`\"workbench.editor.showTabs\": false`). Editor groups are the containers of editors."));
B
Benjamin Pasero 已提交
131

132
export const EDITOR_GROUP_BORDER = registerColor('editorGroup.border', {
133 134
	dark: '#444444',
	light: '#E7E7E7',
135
	hc: contrastBorder
136 137
}, nls.localize('editorGroupBorder', "Color to separate multiple editor groups from each other. Editor groups are the containers of editors."));

138
export const EDITOR_DRAG_AND_DROP_BACKGROUND = registerColor('editorGroup.dropBackground', {
B
Benjamin Pasero 已提交
139 140
	dark: Color.fromHex('#53595D').transparent(0.5),
	light: Color.fromHex('#3399FF').transparent(0.18),
B
Benjamin Pasero 已提交
141
	hc: null
B
Benjamin Pasero 已提交
142
}, nls.localize('editorDragAndDropBackground', "Background color when dragging editors around. The color should have transparency so that the editor contents can still shine through."));
143

144

145 146 147

// < --- Panels --- >

148 149 150 151 152 153
export const PANEL_BACKGROUND = registerColor('panel.background', {
	dark: editorBackground,
	light: editorBackground,
	hc: editorBackground
}, nls.localize('panelBackground', "Panel background color. Panels are shown below the editor area and contain views like output and integrated terminal."));

154
export const PANEL_BORDER = registerColor('panel.border', {
B
Benjamin Pasero 已提交
155 156
	dark: Color.fromHex('#808080').transparent(0.35),
	light: Color.fromHex('#808080').transparent(0.35),
157
	hc: contrastBorder
B
Benjamin Pasero 已提交
158
}, nls.localize('panelBorder', "Panel border color to separate the panel from the editor. Panels are shown below the editor area and contain views like output and integrated terminal."));
B
Benjamin Pasero 已提交
159

160
export const PANEL_ACTIVE_TITLE_FOREGROUND = registerColor('panelTitle.activeForeground', {
161 162 163
	dark: '#E7E7E7',
	light: '#424242',
	hc: Color.white
164
}, nls.localize('panelActiveTitleForeground', "Title color for the active panel. Panels are shown below the editor area and contain views like output and integrated terminal."));
165

166 167 168
export const PANEL_INACTIVE_TITLE_FOREGROUND = registerColor('panelTitle.inactiveForeground', {
	dark: transparent(PANEL_ACTIVE_TITLE_FOREGROUND, 0.5),
	light: transparent(PANEL_ACTIVE_TITLE_FOREGROUND, 0.75),
169
	hc: Color.white
170
}, nls.localize('panelInactiveTitleForeground', "Title color for the inactive panel. Panels are shown below the editor area and contain views like output and integrated terminal."));
171

172
export const PANEL_ACTIVE_TITLE_BORDER = registerColor('panelTitle.activeBorder', {
173 174
	dark: PANEL_BORDER,
	light: PANEL_BORDER,
175
	hc: contrastBorder
176 177
}, nls.localize('panelActiveTitleBorder', "Border color for the active panel title. Panels are shown below the editor area and contain views like output and integrated terminal."));

I
isidor 已提交
178 179 180 181 182
export const PANEL_DRAG_AND_DROP_BACKGROUND = registerColor('panel.dropBackground', {
	dark: Color.white.transparent(0.12),
	light: Color.fromHex('#3399FF').transparent(0.18),
	hc: Color.white.transparent(0.12)
}, nls.localize('panelDragAndDropBackground', "Drag and drop feedback color for the panel title items. The color should have transparency so that the panel entries can still shine through. Panels are shown below the editor area and contain views like output and integrated terminal."));
I
isidor 已提交
183

184

185 186
// < --- Status --- >

187
export const STATUS_BAR_FOREGROUND = registerColor('statusBar.foreground', {
188 189 190
	dark: '#FFFFFF',
	light: '#FFFFFF',
	hc: '#FFFFFF'
191
}, nls.localize('statusBarForeground', "Status bar foreground color when a workspace is opened. The status bar is shown in the bottom of the window."));
192

193 194 195 196 197 198
export const STATUS_BAR_NO_FOLDER_FOREGROUND = registerColor('statusBar.noFolderForeground', {
	dark: STATUS_BAR_FOREGROUND,
	light: STATUS_BAR_FOREGROUND,
	hc: STATUS_BAR_FOREGROUND
}, nls.localize('statusBarNoFolderForeground', "Status bar foreground color when no folder is opened. The status bar is shown in the bottom of the window."));

199
export const STATUS_BAR_BACKGROUND = registerColor('statusBar.background', {
200 201
	dark: '#007ACC',
	light: '#007ACC',
B
Benjamin Pasero 已提交
202
	hc: null
203
}, nls.localize('statusBarBackground', "Status bar background color when a workspace is opened. The status bar is shown in the bottom of the window."));
204

205
export const STATUS_BAR_NO_FOLDER_BACKGROUND = registerColor('statusBar.noFolderBackground', {
206 207
	dark: '#68217A',
	light: '#68217A',
B
Benjamin Pasero 已提交
208
	hc: null
209
}, nls.localize('statusBarNoFolderBackground', "Status bar background color when no folder is opened. The status bar is shown in the bottom of the window."));
B
Benjamin Pasero 已提交
210

211 212 213 214 215
export const STATUS_BAR_BORDER = registerColor('statusBar.border', {
	dark: null,
	light: null,
	hc: contrastBorder
}, nls.localize('statusBarBorder', "Status bar border color separating to the sidebar and editor. The status bar is shown in the bottom of the window."));
216

217 218 219 220 221
export const STATUS_BAR_NO_FOLDER_BORDER = registerColor('statusBar.noFolderBorder', {
	dark: STATUS_BAR_BORDER,
	light: STATUS_BAR_BORDER,
	hc: STATUS_BAR_BORDER
}, nls.localize('statusBarNoFolderBorder', "Status bar border color separating to the sidebar and editor when no folder is opened. The status bar is shown in the bottom of the window."));
222

223
export const STATUS_BAR_ITEM_ACTIVE_BACKGROUND = registerColor('statusBarItem.activeBackground', {
B
Benjamin Pasero 已提交
224 225 226
	dark: Color.white.transparent(0.18),
	light: Color.white.transparent(0.18),
	hc: Color.white.transparent(0.18)
227
}, nls.localize('statusBarItemActiveBackground', "Status bar item background color when clicking. The status bar is shown in the bottom of the window."));
B
Benjamin Pasero 已提交
228

229
export const STATUS_BAR_ITEM_HOVER_BACKGROUND = registerColor('statusBarItem.hoverBackground', {
B
Benjamin Pasero 已提交
230 231 232
	dark: Color.white.transparent(0.12),
	light: Color.white.transparent(0.12),
	hc: Color.white.transparent(0.12)
233
}, nls.localize('statusBarItemHoverBackground', "Status bar item background color when hovering. The status bar is shown in the bottom of the window."));
B
Benjamin Pasero 已提交
234

235
export const STATUS_BAR_PROMINENT_ITEM_BACKGROUND = registerColor('statusBarItem.prominentBackground', {
236 237 238
	dark: '#388A34',
	light: '#388A34',
	hc: '#3883A4'
239
}, nls.localize('statusBarProminentItemBackground', "Status bar prominent items background color. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."));
B
Benjamin Pasero 已提交
240

241
export const STATUS_BAR_PROMINENT_ITEM_HOVER_BACKGROUND = registerColor('statusBarItem.prominentHoverBackground', {
B
Benjamin Pasero 已提交
242 243 244
	dark: '#369432',
	light: '#369432',
	hc: '#369432'
245
}, nls.localize('statusBarProminentItemHoverBackground', "Status bar prominent items background color when hovering. Prominent items stand out from other status bar entries to indicate importance. Change mode `Toggle Tab Key Moves Focus` from command palette to see an example. The status bar is shown in the bottom of the window."));
B
Benjamin Pasero 已提交
246

247 248 249 250


// < --- Activity Bar --- >

251
export const ACTIVITY_BAR_BACKGROUND = registerColor('activityBar.background', {
252
	dark: '#333333',
253
	light: '#2C2C2C',
254 255
	hc: '#000000'
}, nls.localize('activityBarBackground', "Activity bar background color. The activity bar is showing on the far left or right and allows to switch between views of the side bar."));
256

257
export const ACTIVITY_BAR_FOREGROUND = registerColor('activityBar.foreground', {
258 259 260
	dark: Color.white,
	light: Color.white,
	hc: Color.white
261
}, nls.localize('activityBarForeground', "Activity bar foreground color (e.g. used for the icons). The activity bar is showing on the far left or right and allows to switch between views of the side bar."));
262

263 264 265 266 267 268
export const ACTIVITY_BAR_BORDER = registerColor('activityBar.border', {
	dark: null,
	light: null,
	hc: contrastBorder
}, nls.localize('activityBarBorder', "Activity bar border color separating to the side bar. The activity bar is showing on the far left or right and allows to switch between views of the side bar."));

269

I
isidor 已提交
270 271 272 273 274
export const ACTIVITY_BAR_DRAG_AND_DROP_BACKGROUND = registerColor('activityBar.dropBackground', {
	dark: Color.white.transparent(0.12),
	light: Color.white.transparent(0.12),
	hc: Color.white.transparent(0.12),
}, nls.localize('activityBarDragAndDropBackground', "Drag and drop feedback color for the activity bar items. The color should have transparency so that the activity bar entries can still shine through. The activity bar is showing on the far left or right and allows to switch between views of the side bar."));
B
Benjamin Pasero 已提交
275

I
isidor 已提交
276 277 278 279 280
export const ACTIVITY_BAR_BADGE_BACKGROUND = registerColor('activityBarBadge.background', {
	dark: '#007ACC',
	light: '#007ACC',
	hc: '#000000'
}, nls.localize('activityBarBadgeBackground', "Activity notification badge background color. The activity bar is showing on the far left or right and allows to switch between views of the side bar."));
B
Benjamin Pasero 已提交
281

I
isidor 已提交
282 283 284 285 286
export const ACTIVITY_BAR_BADGE_FOREGROUND = registerColor('activityBarBadge.foreground', {
	dark: Color.white,
	light: Color.white,
	hc: Color.white
}, nls.localize('activityBarBadgeForeground', "Activity notification badge foreground color. The activity bar is showing on the far left or right and allows to switch between views of the side bar."));
287 288 289 290


// < --- Side Bar --- >

291
export const SIDE_BAR_BACKGROUND = registerColor('sideBar.background', {
292 293 294 295 296
	dark: '#252526',
	light: '#F3F3F3',
	hc: '#000000'
}, nls.localize('sideBarBackground', "Side bar background color. The side bar is the container for views like explorer and search."));

297 298 299 300 301 302
export const SIDE_BAR_FOREGROUND = registerColor('sideBar.foreground', {
	dark: null,
	light: null,
	hc: null
}, nls.localize('sideBarForeground', "Side bar foreground color. The side bar is the container for views like explorer and search."));

303 304 305 306 307 308
export const SIDE_BAR_BORDER = registerColor('sideBar.border', {
	dark: null,
	light: null,
	hc: contrastBorder
}, nls.localize('sideBarBorder', "Side bar border color on the side separating to the editor. The side bar is the container for views like explorer and search."));

309
export const SIDE_BAR_TITLE_FOREGROUND = registerColor('sideBarTitle.foreground', {
B
Benjamin Pasero 已提交
310 311 312
	dark: SIDE_BAR_FOREGROUND,
	light: SIDE_BAR_FOREGROUND,
	hc: SIDE_BAR_FOREGROUND
313 314
}, nls.localize('sideBarTitleForeground', "Side bar title foreground color. The side bar is the container for views like explorer and search."));

315 316 317 318 319 320
export const SIDE_BAR_DRAG_AND_DROP_BACKGROUND = registerColor('sideBar.dropBackground', {
	dark: Color.white.transparent(0.12),
	light: Color.white.transparent(0.12),
	hc: Color.white.transparent(0.12),
}, nls.localize('sideBarDragAndDropBackground', "Drag and drop feedback color for the side bar sections. The color should have transparency so that the side bar sections can still shine through. The side bar is the container for views like explorer and search."));

321
export const SIDE_BAR_SECTION_HEADER_BACKGROUND = registerColor('sideBarSectionHeader.background', {
322 323 324 325 326
	dark: Color.fromHex('#808080').transparent(0.2),
	light: Color.fromHex('#808080').transparent(0.2),
	hc: null
}, nls.localize('sideBarSectionHeaderBackground', "Side bar section header background color. The side bar is the container for views like explorer and search."));

327 328 329 330 331 332
export const SIDE_BAR_SECTION_HEADER_FOREGROUND = registerColor('sideBarSectionHeader.foreground', {
	dark: SIDE_BAR_FOREGROUND,
	light: SIDE_BAR_FOREGROUND,
	hc: SIDE_BAR_FOREGROUND
}, nls.localize('sideBarSectionHeaderForeground', "Side bar section header foreground color. The side bar is the container for views like explorer and search."));

B
Benjamin Pasero 已提交
333 334 335 336


// < --- Title Bar --- >

337
export const TITLE_BAR_ACTIVE_FOREGROUND = registerColor('titleBar.activeForeground', {
B
Benjamin Pasero 已提交
338 339 340
	dark: '#CCCCCC',
	light: '#333333',
	hc: '#FFFFFF'
N
Nicolas Ramz 已提交
341
}, nls.localize('titleBarActiveForeground', "Title bar foreground when the window is active. Note that this color is currently only supported on macOS."));
B
Benjamin Pasero 已提交
342

343
export const TITLE_BAR_INACTIVE_FOREGROUND = registerColor('titleBar.inactiveForeground', {
B
Benjamin Pasero 已提交
344 345
	dark: transparent(TITLE_BAR_ACTIVE_FOREGROUND, 0.6),
	light: transparent(TITLE_BAR_ACTIVE_FOREGROUND, 0.6),
B
Benjamin Pasero 已提交
346
	hc: null
N
Nicolas Ramz 已提交
347
}, nls.localize('titleBarInactiveForeground', "Title bar foreground when the window is inactive. Note that this color is currently only supported on macOS."));
B
Benjamin Pasero 已提交
348

349
export const TITLE_BAR_ACTIVE_BACKGROUND = registerColor('titleBar.activeBackground', {
B
Benjamin Pasero 已提交
350 351 352
	dark: '#3C3C3C',
	light: '#DDDDDD',
	hc: '#000000'
N
Nicolas Ramz 已提交
353
}, nls.localize('titleBarActiveBackground', "Title bar background when the window is active. Note that this color is currently only supported on macOS."));
B
Benjamin Pasero 已提交
354

355
export const TITLE_BAR_INACTIVE_BACKGROUND = registerColor('titleBar.inactiveBackground', {
B
Benjamin Pasero 已提交
356 357
	dark: transparent(TITLE_BAR_ACTIVE_BACKGROUND, 0.6),
	light: transparent(TITLE_BAR_ACTIVE_BACKGROUND, 0.6),
B
Benjamin Pasero 已提交
358
	hc: null
N
Nicolas Ramz 已提交
359
}, nls.localize('titleBarInactiveBackground', "Title bar background when the window is inactive. Note that this color is currently only supported on macOS."));
B
Benjamin Pasero 已提交
360

361 362 363 364 365 366
export const TITLE_BAR_BORDER = registerColor('titleBar.border', {
	dark: null,
	light: null,
	hc: null
}, nls.localize('titleBarBorder', "Title bar border color. Note that this color is currently only supported on macOS."));

367 368
// < --- Notifications --- >

369 370 371 372 373 374 375 376 377 378 379 380
export const NOTIFICATIONS_CENTER_BORDER = registerColor('notificationsCenter.border', {
	dark: null,
	light: null,
	hc: contrastBorder
}, nls.localize('notificationsCenterBorder', "Notifications center border color. Notifications slide in from the bottom right of the window."));

export const NOTIFICATIONS_TOAST_BORDER = registerColor('notificationsToast.border', {
	dark: null,
	light: null,
	hc: contrastBorder
}, nls.localize('notificationsToastBorder', "Notification toast border color. Notifications slide in from the bottom right of the window."));

381 382 383
export const NOTIFICATIONS_FOREGROUND = registerColor('notifications.foreground', {
	dark: null,
	light: null,
384
	hc: null
385
}, nls.localize('notificationsForeground', "Notifications foreground color. Notifications slide in from the bottom right of the window."));
386

387 388 389 390 391
export const NOTIFICATIONS_BACKGROUND = registerColor('notifications.background', {
	dark: editorWidgetBackground,
	light: editorWidgetBackground,
	hc: editorWidgetBackground
}, nls.localize('notificationsBackground', "Notifications background color. Notifications slide in from the bottom right of the window."));
392

393 394 395 396 397
export const NOTIFICATIONS_LINKS = registerColor('notificationLink.foreground', {
	dark: textLinkForeground,
	light: textLinkForeground,
	hc: textLinkForeground
}, nls.localize('notificationsLink', "Notification links foreground color. Notifications slide in from the bottom right of the window."));
398 399 400 401 402 403 404 405 406 407

export const NOTIFICATIONS_CENTER_HEADER_FOREGROUND = registerColor('notificationsCenterHeader.foreground', {
	dark: null,
	light: null,
	hc: null
}, nls.localize('notificationsCenterHeaderForeground', "Notifications center header foreground color. Notifications slide in from the bottom right of the window."));

export const NOTIFICATIONS_CENTER_HEADER_BACKGROUND = registerColor('notificationsCenterHeader.background', {
	dark: lighten(NOTIFICATIONS_BACKGROUND, 0.3),
	light: darken(NOTIFICATIONS_BACKGROUND, 0.05),
408
	hc: NOTIFICATIONS_BACKGROUND
409
}, nls.localize('notificationsCenterHeaderBackground', "Notifications center header background color. Notifications slide in from the bottom right of the window."));
410 411 412 413 414 415

export const NOTIFICATIONS_BORDER = registerColor('notifications.border', {
	dark: NOTIFICATIONS_CENTER_HEADER_BACKGROUND,
	light: NOTIFICATIONS_CENTER_HEADER_BACKGROUND,
	hc: NOTIFICATIONS_CENTER_HEADER_BACKGROUND
}, nls.localize('notificationsBorder', "Notifications border color separating from other notifications in the notifications center. Notifications slide in from the bottom right of the window."));
416

B
Benjamin Pasero 已提交
417 418 419 420 421
/**
 * Base class for all themable workbench components.
 */
export class Themable extends Disposable {
	private _toUnbind: IDisposable[];
B
Benjamin Pasero 已提交
422
	private theme: ITheme;
B
Benjamin Pasero 已提交
423 424 425 426 427 428 429

	constructor(
		protected themeService: IThemeService
	) {
		super();

		this._toUnbind = [];
B
Benjamin Pasero 已提交
430
		this.theme = themeService.getTheme();
B
Benjamin Pasero 已提交
431 432

		// Hook up to theme changes
433
		this._toUnbind.push(this.themeService.onThemeChange(theme => this.onThemeChange(theme)));
B
Benjamin Pasero 已提交
434 435 436 437 438 439
	}

	protected get toUnbind() {
		return this._toUnbind;
	}

440
	protected onThemeChange(theme: ITheme): void {
B
Benjamin Pasero 已提交
441
		this.theme = theme;
B
Benjamin Pasero 已提交
442

443
		this.updateStyles();
B
Benjamin Pasero 已提交
444 445
	}

446
	protected updateStyles(): void {
B
Benjamin Pasero 已提交
447 448 449
		// Subclasses to override
	}

450 451 452 453 454 455
	protected getColor(id: string, modify?: (color: Color, theme: ITheme) => Color): string {
		let color = this.theme.getColor(id);

		if (color && modify) {
			color = modify(color, this.theme);
		}
456 457

		return color ? color.toString() : null;
B
Benjamin Pasero 已提交
458 459 460 461 462 463 464
	}

	public dispose(): void {
		this._toUnbind = dispose(this._toUnbind);

		super.dispose();
	}
465
}