Skip to content

Commit 165b64a

Browse files
authored
Modern UI: Update surface border color to use opaque defaults and add corresponding tests (#331177)
Update surface border color to use opaque defaults and add corresponding tests Co-authored-by: mrleemurray <mrleemurray@users.noreply.github.com>
1 parent ea32f80 commit 165b64a

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

src/vs/workbench/common/theme.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,8 @@ export const SURFACE_BACKGROUND = registerColor('surface.background', {
676676
export const SURFACE_FOREGROUND = registerColor('surface.foreground', SIDE_BAR_FOREGROUND, localize('surfaceForeground', "Foreground color of framed container surfaces (\"cards\"), such as the floating workbench panels in the modern layout."));
677677

678678
export const SURFACE_BORDER = registerColor('surface.border', {
679-
dark: transparent(foreground, 0.1),
680-
light: transparent(foreground, 0.1),
679+
dark: opaque(transparent(foreground, 0.1), SURFACE_BACKGROUND),
680+
light: opaque(transparent(foreground, 0.1), SURFACE_BACKGROUND),
681681
hcDark: contrastBorder,
682682
hcLight: contrastBorder
683683
}, localize('surfaceBorder', "Border color of framed container surfaces (\"cards\"), such as the floating workbench panels in the modern layout."));

src/vs/workbench/contrib/styleOverrides/test/browser/styleOverrides.contribution.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,31 @@ suite('StyleOverridesContribution', () => {
425425
});
426426
});
427427

428+
test('uses opaque surface border defaults', () => {
429+
const darkTheme = ColorThemeData.createUnloadedTheme('vs-dark');
430+
const lightTheme = ColorThemeData.createUnloadedTheme('vs');
431+
const darkSurfaceBorder = darkTheme.getColor(SURFACE_BORDER);
432+
const darkEditorBorder = darkTheme.getColor(EDITOR_BORDER);
433+
const lightSurfaceBorder = lightTheme.getColor(SURFACE_BORDER);
434+
const lightEditorBorder = lightTheme.getColor(EDITOR_BORDER);
435+
436+
assert.deepStrictEqual({
437+
darkSurfaceBorderIsOpaque: darkSurfaceBorder?.isOpaque(),
438+
darkEditorBorderIsOpaque: darkEditorBorder?.isOpaque(),
439+
darkEditorBorderMatchesSurface: darkEditorBorder?.equals(darkSurfaceBorder ?? null),
440+
lightSurfaceBorderIsOpaque: lightSurfaceBorder?.isOpaque(),
441+
lightEditorBorderIsOpaque: lightEditorBorder?.isOpaque(),
442+
lightEditorBorderMatchesSurface: lightEditorBorder?.equals(lightSurfaceBorder ?? null),
443+
}, {
444+
darkSurfaceBorderIsOpaque: true,
445+
darkEditorBorderIsOpaque: true,
446+
darkEditorBorderMatchesSurface: true,
447+
lightSurfaceBorderIsOpaque: true,
448+
lightEditorBorderIsOpaque: true,
449+
lightEditorBorderMatchesSurface: true,
450+
});
451+
});
452+
428453
test('hides collapsed primary side bar grips without hiding constrained auxiliary sash grips', () => {
429454
const root = document.createElement('div');
430455
root.className = 'monaco-workbench style-override nosidebar nopanel';

0 commit comments

Comments
 (0)