1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 15:53:27 +00:00

[PM-14351] Migrate away from theme enum (#11812)

* update extension autofill concerns to use theme object and type over enum

* mark ThemeType enum as deprecated

* update theming service concerns to use theme object and type over enum
This commit is contained in:
Jonathan Prusik
2024-10-31 16:46:25 -04:00
committed by GitHub
parent eb67b73a09
commit eba1212e1c
10 changed files with 56 additions and 39 deletions

View File

@@ -1,3 +1,6 @@
/**
* @deprecated prefer the `ThemeTypes` constants and `Theme` type over unsafe enum types
**/
export enum ThemeType {
System = "system",
Light = "light",
@@ -5,3 +8,13 @@ export enum ThemeType {
Nord = "nord",
SolarizedDark = "solarizedDark",
}
export const ThemeTypes = {
System: "system",
Light: "light",
Dark: "dark",
Nord: "nord",
SolarizedDark: "solarizedDark",
} as const;
export type Theme = (typeof ThemeTypes)[keyof typeof ThemeTypes];