-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core/system-theme-extractor): refactor theme-manager to work asy…
…nchronously
- Loading branch information
Maxim Givanyan
committed
Jan 19, 2024
1 parent
22b9305
commit 73e3aa7
Showing
6 changed files
with
175 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/*! | ||
* V4Fire Client Core | ||
* https://github.com/V4Fire/Client | ||
* | ||
* Released under the MIT license | ||
* https://github.com/V4Fire/Client/blob/master/LICENSE | ||
*/ | ||
|
||
/** | ||
* Indicates whether the detection of the user's preferred color scheme is enabled. | ||
* Defaults to `false` if not specified in `DETECT_USER_PREFERENCES`. | ||
*/ | ||
export const prefersColorSchemeEnabled = | ||
Object.get<boolean>(DETECT_USER_PREFERENCES, 'prefersColorScheme.enabled') ?? false; | ||
|
||
/** | ||
* The name associated with the dark color scheme. | ||
* Defaults to 'dark' if not specified in `DETECT_USER_PREFERENCES`. | ||
*/ | ||
export const darkThemeName = | ||
Object.get<string>(DETECT_USER_PREFERENCES, 'prefersColorScheme.aliases.dark') ?? 'dark'; | ||
|
||
/** | ||
* The name associated with the light color scheme. | ||
* Defaults to 'light' if not specified in `DETECT_USER_PREFERENCES`. | ||
*/ | ||
export const lightThemeName = | ||
Object.get<string>(DETECT_USER_PREFERENCES, 'prefersColorScheme.aliases.light') ?? 'light'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/components/super/i-static-page/modules/theme/interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/*! | ||
* V4Fire Client Core | ||
* https://github.com/V4Fire/Client | ||
* | ||
* Released under the MIT license | ||
* https://github.com/V4Fire/Client/blob/master/LICENSE | ||
*/ | ||
|
||
/** | ||
* Represents a visual theme with its associated properties | ||
*/ | ||
export interface Theme { | ||
/** | ||
* The value representing the visual theme | ||
*/ | ||
value: string; | ||
|
||
/** | ||
* Indicates whether the current theme value is derived from system settings | ||
*/ | ||
isSystem: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters