Skip to content

Commit

Permalink
Switch to baseline-grayscale theme
Browse files Browse the repository at this point in the history
  • Loading branch information
huntie committed May 2, 2024
1 parent b3db866 commit 141c8c9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions front_end/ui/legacy/theme_support/ThemeSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,8 @@ export class ThemeSupport extends EventTarget {
}

// Baseline is the name of Chrome's default color theme and there are two of these: default and grayscale.
// The collective name for the rest of the color themes is dynamic.
// In the baseline themes Chrome uses custom values for surface colors, whereas for dynamic themes these are color-mixed.
// To match Chrome we need to know if any of the baseline themes is currently active and assign specific values to surface colors.
const selectedTheme = getComputedStyle(document.body).getPropertyValue('--user-color-source');
document.documentElement.classList.toggle('baseline-default', selectedTheme === 'baseline-default');
document.documentElement.classList.toggle('baseline-grayscale', selectedTheme === 'baseline-grayscale');
// [RN] Force 'baseline-grayscale' theme for now.
document.documentElement.classList.add('baseline-grayscale');
}

static async fetchColors(document: Document|undefined): Promise<void> {
Expand Down

0 comments on commit 141c8c9

Please sign in to comment.