Skip to content

Commit 9da7235

Browse files
committed
feat: re-add legacy colors
1 parent 14a3e52 commit 9da7235

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

web/store/theme.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ interface ThemeVariables {
2828
[key: string]: string | null;
2929
}
3030

31+
/**
32+
* Defines legacy colors that are kept for backwards compatibility
33+
*
34+
* Allows theme-engine to be updated without breaking existing themes
35+
*/
36+
const legacyColors = {
37+
'--color-alpha': 'var(--header-background-color)',
38+
'--color-beta': 'var(--header-text-primary)',
39+
'--color-gamma': 'var(--header-text-secondary)',
40+
'--color-gamma-opaque': 'rgba(153, 153, 153, .5)',
41+
'--color-customgradient-start': 'rgba(242, 242, 242, .0)',
42+
'--color-customgradient-end': 'rgba(242, 242, 242, .85)',
43+
'--shadow-beta': '0 25px 50px -12px rgba(242, 242, 242, .15)',
44+
};
45+
3146
const defaultLight = {
3247
'--background': '0 0% 3.9%',
3348
'--foreground': '0 0% 98%',
@@ -54,6 +69,7 @@ const defaultLight = {
5469
'--header-gradient-start': 'rgba(0, 0, 0, 0)',
5570
'--header-gradient-end': 'var(--header-background-color)',
5671
'--banner-gradient': null,
72+
...legacyColors,
5773
} as const;
5874

5975
const defaultDark = {
@@ -83,6 +99,7 @@ const defaultDark = {
8399
'--header-gradient-start': 'rgba(0, 0, 0, 0)',
84100
'--header-gradient-end': 'var(--header-background-color)',
85101
'--banner-gradient': null,
102+
...legacyColors,
86103
} as const;
87104

88105
/**

0 commit comments

Comments
 (0)