AboutSupportDeveloper GuideVersion 44.144.100.59

Represents the native theme of the operating system. This is used to determine how the application should render its UI based on the system's theme settings. Defer to CSS properties whenever possible.

Re-exported from Electron's NativeTheme type.

interface NativeTheme {
    inForcedColorsMode: boolean;
    prefersReducedTransparency: boolean;
    shouldUseDarkColors: boolean;
    shouldUseDarkColorsForSystemIntegratedUI: boolean;
    shouldUseHighContrastColors: boolean;
    shouldUseInvertedColorScheme: boolean;
    themeSource: "system" | "light" | "dark";
}

Properties

inForcedColorsMode: boolean

A boolean indicating whether Chromium is in forced colors mode, controlled by system accessibility settings. Currently, Windows high contrast is the only system setting that triggers forced colors mode.

win32

prefersReducedTransparency: boolean

A boolean that indicates the whether the user has chosen via system accessibility settings to reduce transparency at the OS level.

shouldUseDarkColors: boolean

A boolean for if the OS / Chromium currently has a dark mode enabled or is being instructed to show a dark-style UI. If you want to modify this value you should use themeSource below.

shouldUseDarkColorsForSystemIntegratedUI: boolean

A boolean property indicating whether or not the system theme has been set to dark or light.

On Windows this property distinguishes between system and app light/dark theme, returning true if the system theme is set to dark theme and false otherwise. On macOS the return value will be the same as nativeTheme.shouldUseDarkColors.

darwin,win32

shouldUseHighContrastColors: boolean

A boolean for if the OS / Chromium currently has high-contrast mode enabled or is being instructed to show a high-contrast UI.

darwin,win32

shouldUseInvertedColorScheme: boolean

A boolean for if the OS / Chromium currently has an inverted color scheme or is being instructed to use an inverted color scheme.

darwin,win32

themeSource: "system" | "light" | "dark"

A string property that can be system, light or dark. It is used (via `setTheme) to override and supersede the value that Chromium has chosen to use internally.