Skip to content

Commit 4440abd

Browse files
vscode: add hcLight support (eclipse-theia#11589)
The commit adds support for `hcLight` themes in the framework: - adds support for a builtin `hc-light` theme. - adds plugin support for `hcLight`. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
1 parent 85ca7ee commit 4440abd

File tree

16 files changed

+1057
-280
lines changed

16 files changed

+1057
-280
lines changed

packages/core/src/browser/common-frontend-contribution.ts

Lines changed: 234 additions & 141 deletions
Large diffs are not rendered by default.

packages/core/src/browser/theming.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,17 @@ export class BuiltinThemeProvider {
188188
editorTheme: 'hc-theia' // loaded in /packages/monaco/src/browser/textmate/monaco-theme-registry.ts
189189
};
190190

191+
static readonly hcLightTheme: Theme = {
192+
id: 'hc-theia-light',
193+
type: 'hcLight',
194+
label: 'High Contrast Light (Theia)',
195+
editorTheme: 'hc-theia-light' // loaded in /packages/monaco/src/browser/textmate/monaco-theme-registry.ts
196+
};
197+
191198
static readonly themes = [
192199
BuiltinThemeProvider.darkTheme,
193200
BuiltinThemeProvider.lightTheme,
194-
BuiltinThemeProvider.hcTheme
201+
BuiltinThemeProvider.hcTheme,
202+
BuiltinThemeProvider.hcLightTheme
195203
];
196204
}

packages/core/src/common/theme.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
1515
// *****************************************************************************
1616

17-
export type ThemeType = 'light' | 'dark' | 'hc';
17+
export type ThemeType = 'light' | 'dark' | 'hc' | 'hcLight';
1818

1919
export interface Theme {
2020
readonly id: string;
@@ -27,7 +27,7 @@ export interface Theme {
2727
}
2828

2929
export function isHighContrast(scheme: ThemeType): boolean {
30-
return scheme === 'hc';
30+
return scheme === 'hc' || scheme === 'hcLight';
3131
}
3232

3333
export interface ThemeChangeEvent {

packages/debug/src/browser/debug-frontend-application-contribution.ts

Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,37 +1251,42 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
12511251
defaults: {
12521252
dark: '#ffff0033',
12531253
light: '#ffff6673',
1254-
hc: '#fff600'
1254+
hcDark: '#fff600',
1255+
hcLight: '#ffff6673'
12551256
}, description: 'Background color for the highlight of line at the top stack frame position.'
12561257
},
12571258
{
12581259
id: 'editor.focusedStackFrameHighlightBackground',
12591260
defaults: {
12601261
dark: '#7abd7a4d',
12611262
light: '#cee7ce73',
1262-
hc: '#cee7ce'
1263+
hcDark: '#cee7ce',
1264+
hcLight: '#cee7ce73'
12631265
}, description: 'Background color for the highlight of line at focused stack frame position.'
12641266
},
12651267
// Status bar colors should be aligned with debugging colors from https://code.visualstudio.com/api/references/theme-color#status-bar-colors
12661268
{
12671269
id: 'statusBar.debuggingBackground', defaults: {
12681270
dark: '#CC6633',
12691271
light: '#CC6633',
1270-
hc: '#CC6633'
1272+
hcDark: '#CC6633',
1273+
hcLight: '#B5200D'
12711274
}, description: 'Status bar background color when a program is being debugged. The status bar is shown in the bottom of the window'
12721275
},
12731276
{
12741277
id: 'statusBar.debuggingForeground', defaults: {
12751278
dark: 'statusBar.foreground',
12761279
light: 'statusBar.foreground',
1277-
hc: 'statusBar.foreground'
1280+
hcDark: 'statusBar.foreground',
1281+
hcLight: 'statusBar.foreground'
12781282
}, description: 'Status bar foreground color when a program is being debugged. The status bar is shown in the bottom of the window'
12791283
},
12801284
{
12811285
id: 'statusBar.debuggingBorder', defaults: {
12821286
dark: 'statusBar.border',
12831287
light: 'statusBar.border',
1284-
hc: 'statusBar.border'
1288+
hcDark: 'statusBar.border',
1289+
hcLight: 'statusBar.border'
12851290
}, description: 'Status bar border color separating to the sidebar and editor when a program is being debugged. The status bar is shown in the bottom of the window'
12861291
},
12871292
// Debug Exception Widget colors should be aligned with
@@ -1290,14 +1295,16 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
12901295
id: 'debugExceptionWidget.border', defaults: {
12911296
dark: '#a31515',
12921297
light: '#a31515',
1293-
hc: '#a31515'
1298+
hcDark: '#a31515',
1299+
hcLight: '#a31515'
12941300
}, description: 'Exception widget border color.',
12951301
},
12961302
{
12971303
id: 'debugExceptionWidget.background', defaults: {
12981304
dark: '#420b0d',
12991305
light: '#f1dfde',
1300-
hc: '#420b0d'
1306+
hcDark: '#420b0d',
1307+
hcLight: '#f1dfde'
13011308
}, description: 'Exception widget background color.'
13021309
},
13031310
// Debug Icon colors should be aligned with
@@ -1306,148 +1313,168 @@ export class DebugFrontendApplicationContribution extends AbstractViewContributi
13061313
id: 'debugIcon.breakpointForeground', defaults: {
13071314
dark: '#E51400',
13081315
light: '#E51400',
1309-
hc: '#E51400'
1316+
hcDark: '#E51400',
1317+
hcLight: '#E51400'
13101318
},
13111319
description: 'Icon color for breakpoints.'
13121320
},
13131321
{
13141322
id: 'debugIcon.breakpointDisabledForeground', defaults: {
13151323
dark: '#848484',
13161324
light: '#848484',
1317-
hc: '#848484'
1325+
hcDark: '#848484',
1326+
hcLight: '#848484'
13181327
},
13191328
description: 'Icon color for disabled breakpoints.'
13201329
},
13211330
{
13221331
id: 'debugIcon.breakpointUnverifiedForeground', defaults: {
13231332
dark: '#848484',
13241333
light: '#848484',
1325-
hc: '#848484'
1334+
hcDark: '#848484',
1335+
hcLight: '#848484'
13261336
},
13271337
description: 'Icon color for unverified breakpoints.'
13281338
},
13291339
{
13301340
id: 'debugIcon.breakpointCurrentStackframeForeground', defaults: {
13311341
dark: '#FFCC00',
1332-
light: '#FFCC00',
1333-
hc: '#FFCC00'
1342+
light: '#BE8700',
1343+
hcDark: '#FFCC00',
1344+
hcLight: '#BE8700'
13341345
},
13351346
description: 'Icon color for the current breakpoint stack frame.'
13361347
},
13371348
{
13381349
id: 'debugIcon.breakpointStackframeForeground', defaults: {
13391350
dark: '#89D185',
13401351
light: '#89D185',
1341-
hc: '#89D185'
1352+
hcDark: '#89D185',
1353+
hcLight: '#89D185'
13421354
},
13431355
description: 'Icon color for all breakpoint stack frames.'
13441356
},
13451357
{
13461358
id: 'debugIcon.startForeground', defaults: {
13471359
dark: '#89D185',
13481360
light: '#388A34',
1349-
hc: '#89D185'
1361+
hcDark: '#89D185',
1362+
hcLight: '#388A34'
13501363
}, description: 'Debug toolbar icon for start debugging.'
13511364
},
13521365
{
13531366
id: 'debugIcon.pauseForeground', defaults: {
13541367
dark: '#75BEFF',
13551368
light: '#007ACC',
1356-
hc: '#75BEFF'
1369+
hcDark: '#75BEFF',
1370+
hcLight: '#007ACC'
13571371
}, description: 'Debug toolbar icon for pause.'
13581372
},
13591373
{
13601374
id: 'debugIcon.stopForeground', defaults: {
13611375
dark: '#F48771',
13621376
light: '#A1260D',
1363-
hc: '#F48771'
1377+
hcDark: '#F48771',
1378+
hcLight: '#A1260D'
13641379
}, description: 'Debug toolbar icon for stop.'
13651380
},
13661381
{
13671382
id: 'debugIcon.disconnectForeground', defaults: {
13681383
dark: '#F48771',
13691384
light: '#A1260D',
1370-
hc: '#F48771'
1385+
hcDark: '#F48771',
1386+
hcLight: '#A1260D'
13711387
}, description: 'Debug toolbar icon for disconnect.'
13721388
},
13731389
{
13741390
id: 'debugIcon.restartForeground', defaults: {
13751391
dark: '#89D185',
13761392
light: '#388A34',
1377-
hc: '#89D185'
1393+
hcDark: '#89D185',
1394+
hcLight: '#388A34'
13781395
}, description: 'Debug toolbar icon for restart.'
13791396
},
13801397
{
13811398
id: 'debugIcon.stepOverForeground', defaults: {
13821399
dark: '#75BEFF',
13831400
light: '#007ACC',
1384-
hc: '#75BEFF'
1401+
hcDark: '#75BEFF',
1402+
hcLight: '#007ACC',
13851403
}, description: 'Debug toolbar icon for step over.'
13861404
},
13871405
{
13881406
id: 'debugIcon.stepIntoForeground', defaults: {
13891407
dark: '#75BEFF',
13901408
light: '#007ACC',
1391-
hc: '#75BEFF'
1409+
hcDark: '#75BEFF',
1410+
hcLight: '#007ACC'
13921411
}, description: 'Debug toolbar icon for step into.'
13931412
},
13941413
{
13951414
id: 'debugIcon.stepOutForeground', defaults: {
13961415
dark: '#75BEFF',
13971416
light: '#007ACC',
1398-
hc: '#75BEFF'
1417+
hcDark: '#75BEFF',
1418+
hcLight: '#007ACC',
13991419
}, description: 'Debug toolbar icon for step over.'
14001420
},
14011421
{
14021422
id: 'debugIcon.continueForeground', defaults: {
14031423
dark: '#75BEFF',
14041424
light: '#007ACC',
1405-
hc: '#75BEFF'
1425+
hcDark: '#75BEFF',
1426+
hcLight: '#007ACC'
14061427
}, description: 'Debug toolbar icon for continue.'
14071428
},
14081429
{
14091430
id: 'debugIcon.stepBackForeground', defaults: {
14101431
dark: '#75BEFF',
14111432
light: '#007ACC',
1412-
hc: '#75BEFF'
1433+
hcDark: '#75BEFF',
1434+
hcLight: '#007ACC'
14131435
}, description: 'Debug toolbar icon for step back.'
14141436
},
14151437
{
14161438
id: 'debugConsole.infoForeground', defaults: {
14171439
dark: 'editorInfo.foreground',
14181440
light: 'editorInfo.foreground',
1419-
hc: 'foreground'
1441+
hcDark: 'foreground',
1442+
hcLight: 'foreground'
14201443
}, description: 'Foreground color for info messages in debug REPL console.'
14211444
},
14221445
{
14231446
id: 'debugConsole.warningForeground', defaults: {
14241447
dark: 'editorWarning.foreground',
14251448
light: 'editorWarning.foreground',
1426-
hc: '#008000'
1449+
hcDark: '#008000',
1450+
hcLight: 'editorWarning.foreground'
14271451
},
14281452
description: 'Foreground color for warning messages in debug REPL console.'
14291453
},
14301454
{
14311455
id: 'debugConsole.errorForeground', defaults: {
14321456
dark: 'errorForeground',
14331457
light: 'errorForeground',
1434-
hc: 'errorForeground'
1458+
hcDark: 'errorForeground',
1459+
hcLight: 'errorForeground'
14351460
},
14361461
description: 'Foreground color for error messages in debug REPL console.',
14371462
},
14381463
{
14391464
id: 'debugConsole.sourceForeground', defaults: {
14401465
dark: 'foreground',
14411466
light: 'foreground',
1442-
hc: 'foreground'
1467+
hcDark: 'foreground',
1468+
hcLight: 'foreground'
14431469
},
14441470
description: 'Foreground color for source filenames in debug REPL console.',
14451471
},
14461472
{
14471473
id: 'debugConsoleInputIcon.foreground', defaults: {
14481474
dark: 'foreground',
14491475
light: 'foreground',
1450-
hc: 'foreground'
1476+
hcDark: 'foreground',
1477+
hcLight: 'foreground'
14511478
},
14521479
description: 'Foreground color for debug console input marker icon.'
14531480
}

0 commit comments

Comments
 (0)