@latte-macchiat-io/latte-vanilla-components 0.0.187 → 0.0.189
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/src/components/Actions/Actions.css.ts +1 -1
- package/src/components/Button/Button.css.ts +1 -1
- package/src/components/Button/stories.tsx +9 -17
- package/src/components/Carousel/Carousel.css.ts +1 -1
- package/src/components/Columns/Columns.css.ts +1 -1
- package/src/components/ConsentCookie/ConsentCookie.css.ts +1 -1
- package/src/components/Footer/Footer.css.ts +1 -1
- package/src/components/Form/Form.css.ts +1 -1
- package/src/components/Form/Row/Row.css.ts +1 -1
- package/src/components/Form/TextField/Input/Input.css.ts +1 -1
- package/src/components/Form/TextField/Label/Label.css.ts +1 -1
- package/src/components/Form/TextField/TextField.css.ts +1 -1
- package/src/components/Form/TextField/Textarea/Textarea.css.ts +1 -1
- package/src/components/Header/Header.css.ts +1 -1
- package/src/components/Header/HeaderOverlay/index.tsx +1 -1
- package/src/components/Header/HeaderOverlay/styles.css.ts +7 -7
- package/src/components/Header/ToggleNav/index.tsx +2 -5
- package/src/components/Icon/Icon.css.ts +0 -1
- package/src/components/KeyNumber/KeyNumber.css.ts +1 -1
- package/src/components/LanguageSwitcher/LanguageSwitcher.css.ts +1 -1
- package/src/components/Logo/Logo.css.ts +1 -1
- package/src/components/Main/Main.css.ts +1 -1
- package/src/components/Modal/Modal.css.ts +1 -1
- package/src/components/Modal/stories.tsx +54 -89
- package/src/components/Nav/Nav.css.ts +1 -1
- package/src/components/Nav/Nav.tsx +1 -0
- package/src/components/NavLegal/NavLegal.css.ts +1 -1
- package/src/components/NavSocial/NavSocial.css.ts +1 -1
- package/src/components/Section/Section.css.ts +1 -1
- package/src/components/Section/stories.tsx +60 -61
- package/src/components/Video/Video.css.ts +1 -1
- package/src/components/VideoFullWidth/VideoFullWidth.css.ts +1 -1
- package/src/index.ts +5 -22
- package/src/styles/sprinkles.css.ts +1 -1
- package/src/themes/createTheme.ts +65 -0
- package/src/types/withClassName.ts +1 -0
- package/src/assets/styles/default-theme.ts +0 -312
- package/src/assets/styles/mediaqueries.tsx +0 -24
- package/src/components/ToRemove/ToRemove.tsx +0 -3
- package/src/theme/index.ts +0 -6
- package/src/theme/utils.ts +0 -76
- package/src/themes/dark.css.ts +0 -19
- package/src/themes/light.css.ts +0 -19
- package/src/types/theme.ts +0 -295
- package/src/utils/quickTheme.ts +0 -38
- package/src/utils/theme.ts +0 -131
- /package/src/{theme → themes}/baseThemeValues.ts +0 -0
- /package/src/{theme → themes}/contract.css.ts +0 -0
package/src/theme/index.ts
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
// Theme contract and values
|
2
|
-
export { themeContract } from './contract.css';
|
3
|
-
export { baseLightTheme, baseDarkTheme } from './baseThemeValues';
|
4
|
-
|
5
|
-
// Theme utilities
|
6
|
-
export { createThemeOverride, getThemeContract, getThemeValues, toggleTheme, setTheme, getCurrentTheme, type ThemeValues } from './utils';
|
package/src/theme/utils.ts
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
import { baseDarkTheme, baseLightTheme } from './baseThemeValues';
|
2
|
-
import { themeContract } from './contract.css';
|
3
|
-
|
4
|
-
export type ThemeValues = typeof baseLightTheme;
|
5
|
-
|
6
|
-
export const createThemeOverride = (overrides: Partial<ThemeValues>): ThemeValues => {
|
7
|
-
return {
|
8
|
-
...baseLightTheme,
|
9
|
-
...overrides,
|
10
|
-
colors: {
|
11
|
-
...baseLightTheme.colors,
|
12
|
-
...overrides.colors,
|
13
|
-
},
|
14
|
-
space: {
|
15
|
-
...baseLightTheme.space,
|
16
|
-
...overrides.space,
|
17
|
-
},
|
18
|
-
radii: {
|
19
|
-
...baseLightTheme.radii,
|
20
|
-
...overrides.radii,
|
21
|
-
},
|
22
|
-
fonts: {
|
23
|
-
...baseLightTheme.fonts,
|
24
|
-
...overrides.fonts,
|
25
|
-
},
|
26
|
-
fontSizes: {
|
27
|
-
...baseLightTheme.fontSizes,
|
28
|
-
...overrides.fontSizes,
|
29
|
-
},
|
30
|
-
lineHeights: {
|
31
|
-
...baseLightTheme.lineHeights,
|
32
|
-
...overrides.lineHeights,
|
33
|
-
},
|
34
|
-
shadows: {
|
35
|
-
...baseLightTheme.shadows,
|
36
|
-
...overrides.shadows,
|
37
|
-
},
|
38
|
-
};
|
39
|
-
};
|
40
|
-
|
41
|
-
export const getThemeContract = () => themeContract;
|
42
|
-
|
43
|
-
export const getThemeValues = (isDark = false): ThemeValues => {
|
44
|
-
return isDark ? baseDarkTheme : baseLightTheme;
|
45
|
-
};
|
46
|
-
|
47
|
-
export const toggleTheme = () => {
|
48
|
-
const html = document.documentElement;
|
49
|
-
const currentTheme = html.getAttribute('data-theme');
|
50
|
-
const newTheme = currentTheme === 'dark' ? null : 'dark';
|
51
|
-
|
52
|
-
if (newTheme) {
|
53
|
-
html.setAttribute('data-theme', newTheme);
|
54
|
-
} else {
|
55
|
-
html.removeAttribute('data-theme');
|
56
|
-
}
|
57
|
-
|
58
|
-
return newTheme === 'dark';
|
59
|
-
};
|
60
|
-
|
61
|
-
export const setTheme = (theme: 'light' | 'dark') => {
|
62
|
-
const html = document.documentElement;
|
63
|
-
|
64
|
-
if (theme === 'dark') {
|
65
|
-
html.setAttribute('data-theme', 'dark');
|
66
|
-
} else {
|
67
|
-
html.removeAttribute('data-theme');
|
68
|
-
}
|
69
|
-
};
|
70
|
-
|
71
|
-
export const getCurrentTheme = (): 'light' | 'dark' => {
|
72
|
-
if (typeof window === 'undefined') return 'light';
|
73
|
-
|
74
|
-
const html = document.documentElement;
|
75
|
-
return html.getAttribute('data-theme') === 'dark' ? 'dark' : 'light';
|
76
|
-
};
|
package/src/themes/dark.css.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
import { createGlobalTheme } from '@vanilla-extract/css';
|
2
|
-
import { themeContract } from '../theme/contract.css';
|
3
|
-
import { baseDarkTheme } from '../theme/baseThemeValues';
|
4
|
-
|
5
|
-
// Create the dark theme at module level so Vanilla Extract can process it
|
6
|
-
export const darkTheme = createGlobalTheme('html[data-theme="dark"]', themeContract, {
|
7
|
-
colors: baseDarkTheme.colors,
|
8
|
-
space: baseDarkTheme.space,
|
9
|
-
radii: baseDarkTheme.radii,
|
10
|
-
fonts: baseDarkTheme.fonts,
|
11
|
-
maxWidth: baseDarkTheme.maxWidth,
|
12
|
-
fontSizes: baseDarkTheme.fontSizes,
|
13
|
-
fontWeights: baseDarkTheme.fontWeights,
|
14
|
-
lineHeights: baseDarkTheme.lineHeights,
|
15
|
-
shadows: baseDarkTheme.shadows,
|
16
|
-
section: baseDarkTheme.section,
|
17
|
-
header: baseDarkTheme.header,
|
18
|
-
footer: baseDarkTheme.footer,
|
19
|
-
});
|
package/src/themes/light.css.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
import { createGlobalTheme } from '@vanilla-extract/css';
|
2
|
-
import { themeContract } from '../theme/contract.css';
|
3
|
-
import { baseLightTheme } from '../theme/baseThemeValues';
|
4
|
-
|
5
|
-
// Create the light theme at module level so Vanilla Extract can process it
|
6
|
-
export const lightTheme = createGlobalTheme(':root', themeContract, {
|
7
|
-
colors: baseLightTheme.colors,
|
8
|
-
space: baseLightTheme.space,
|
9
|
-
radii: baseLightTheme.radii,
|
10
|
-
fonts: baseLightTheme.fonts,
|
11
|
-
maxWidth: baseLightTheme.maxWidth,
|
12
|
-
fontSizes: baseLightTheme.fontSizes,
|
13
|
-
fontWeights: baseLightTheme.fontWeights,
|
14
|
-
lineHeights: baseLightTheme.lineHeights,
|
15
|
-
shadows: baseLightTheme.shadows,
|
16
|
-
section: baseLightTheme.section,
|
17
|
-
header: baseLightTheme.header,
|
18
|
-
footer: baseLightTheme.footer,
|
19
|
-
});
|
package/src/types/theme.ts
DELETED
@@ -1,295 +0,0 @@
|
|
1
|
-
export interface Theme {
|
2
|
-
global: {
|
3
|
-
maxWidth: number;
|
4
|
-
paddingLeft: number[];
|
5
|
-
paddingRight: number[];
|
6
|
-
|
7
|
-
brandFont: string;
|
8
|
-
defaultFont: string;
|
9
|
-
};
|
10
|
-
|
11
|
-
colors: {
|
12
|
-
defaultText: string;
|
13
|
-
defaultLightText: string;
|
14
|
-
defaultTitle: string;
|
15
|
-
defaultLink: string;
|
16
|
-
defaultIcon: string;
|
17
|
-
};
|
18
|
-
|
19
|
-
backgroundColors: {
|
20
|
-
modal: string;
|
21
|
-
modalOverlay: string;
|
22
|
-
cookieConsent: string;
|
23
|
-
};
|
24
|
-
|
25
|
-
borders: {
|
26
|
-
hr: string;
|
27
|
-
cookieConsent: string;
|
28
|
-
};
|
29
|
-
|
30
|
-
borderRadius: {
|
31
|
-
modal: number;
|
32
|
-
input: number;
|
33
|
-
cookieConsent: number;
|
34
|
-
};
|
35
|
-
|
36
|
-
widthSizes: {
|
37
|
-
modal: number;
|
38
|
-
cookieConsent: number;
|
39
|
-
};
|
40
|
-
|
41
|
-
transitions: {
|
42
|
-
global: string;
|
43
|
-
};
|
44
|
-
|
45
|
-
actions: {
|
46
|
-
gap: number[];
|
47
|
-
paddingTop: number[];
|
48
|
-
paddingBottom: number[];
|
49
|
-
};
|
50
|
-
|
51
|
-
button: {
|
52
|
-
minWidth: number;
|
53
|
-
fontWeight: number;
|
54
|
-
letterSpacing: number;
|
55
|
-
color: {
|
56
|
-
primary: string;
|
57
|
-
secondary: string;
|
58
|
-
disabled: string;
|
59
|
-
};
|
60
|
-
backgroundColor: {
|
61
|
-
primary: string;
|
62
|
-
secondary: string;
|
63
|
-
disabled: string;
|
64
|
-
};
|
65
|
-
border: {
|
66
|
-
width: number;
|
67
|
-
style: string;
|
68
|
-
color: {
|
69
|
-
primary: string;
|
70
|
-
secondary: string;
|
71
|
-
disabled: string;
|
72
|
-
};
|
73
|
-
};
|
74
|
-
borderRadius: number;
|
75
|
-
paddingTop: {
|
76
|
-
small: number[];
|
77
|
-
medium: number[];
|
78
|
-
large: number[];
|
79
|
-
};
|
80
|
-
paddingBottom: {
|
81
|
-
small: number[];
|
82
|
-
medium: number[];
|
83
|
-
large: number[];
|
84
|
-
};
|
85
|
-
paddingRight: {
|
86
|
-
small: number[];
|
87
|
-
medium: number[];
|
88
|
-
large: number[];
|
89
|
-
};
|
90
|
-
paddingLeft: {
|
91
|
-
small: number[];
|
92
|
-
medium: number[];
|
93
|
-
large: number[];
|
94
|
-
};
|
95
|
-
transition: string;
|
96
|
-
};
|
97
|
-
|
98
|
-
keyNumber: {
|
99
|
-
paddingBottom: number[];
|
100
|
-
};
|
101
|
-
|
102
|
-
columns: {
|
103
|
-
gap: number;
|
104
|
-
};
|
105
|
-
|
106
|
-
form: {
|
107
|
-
width: number;
|
108
|
-
backgroundColor: string;
|
109
|
-
padding: [string | number, string | number];
|
110
|
-
|
111
|
-
row: {
|
112
|
-
gap: [string | number, string | number];
|
113
|
-
padding: [string | number, string | number];
|
114
|
-
};
|
115
|
-
|
116
|
-
label: {
|
117
|
-
font: string;
|
118
|
-
color: string;
|
119
|
-
fontWeight: number;
|
120
|
-
paddingBottom: number;
|
121
|
-
};
|
122
|
-
|
123
|
-
input: {
|
124
|
-
font: string;
|
125
|
-
color: string;
|
126
|
-
border: string;
|
127
|
-
padding: number[];
|
128
|
-
borderRadius: number;
|
129
|
-
backgroundColor: string;
|
130
|
-
placeholder: {
|
131
|
-
color: string;
|
132
|
-
opacity: number;
|
133
|
-
};
|
134
|
-
};
|
135
|
-
|
136
|
-
textarea: {
|
137
|
-
font: string;
|
138
|
-
color: string;
|
139
|
-
border: string;
|
140
|
-
padding: number[];
|
141
|
-
borderRadius: number;
|
142
|
-
backgroundColor: string;
|
143
|
-
placeholder: {
|
144
|
-
color: string;
|
145
|
-
opacity: number;
|
146
|
-
};
|
147
|
-
};
|
148
|
-
|
149
|
-
error: {
|
150
|
-
color: string;
|
151
|
-
};
|
152
|
-
};
|
153
|
-
|
154
|
-
header: {
|
155
|
-
gap: number[];
|
156
|
-
height: number[];
|
157
|
-
backgroundColor: string;
|
158
|
-
|
159
|
-
paddingTop: number[];
|
160
|
-
paddingLeft: number[];
|
161
|
-
paddingRight: number[];
|
162
|
-
paddingBottom: number[];
|
163
|
-
|
164
|
-
overlayGap: number[];
|
165
|
-
overlayBackgroundColor: string;
|
166
|
-
|
167
|
-
toggleNavColor: string;
|
168
|
-
toggleNavOpenColor: string;
|
169
|
-
toggleNavBorderRadius: number;
|
170
|
-
};
|
171
|
-
|
172
|
-
main: {
|
173
|
-
minHeight: string;
|
174
|
-
backgroundColor: string;
|
175
|
-
};
|
176
|
-
|
177
|
-
section: {
|
178
|
-
paddingTop: number[];
|
179
|
-
paddingBottom: number[];
|
180
|
-
};
|
181
|
-
|
182
|
-
footer: {
|
183
|
-
gap: number[];
|
184
|
-
height: number[];
|
185
|
-
backgroundColor: string;
|
186
|
-
|
187
|
-
paddingTop: number[];
|
188
|
-
paddingBottom: number[];
|
189
|
-
};
|
190
|
-
|
191
|
-
modal: {
|
192
|
-
border: string;
|
193
|
-
width: number[];
|
194
|
-
borderRadius: number;
|
195
|
-
backgroundColor: string;
|
196
|
-
|
197
|
-
overlayBlur: number;
|
198
|
-
overlayOpacity: number;
|
199
|
-
overlayBackgroundColor: string;
|
200
|
-
|
201
|
-
paddingTop: number[];
|
202
|
-
paddingLeft: number[];
|
203
|
-
paddingRight: number[];
|
204
|
-
paddingBottom: number[];
|
205
|
-
};
|
206
|
-
|
207
|
-
languageSwitcher: {
|
208
|
-
color: string;
|
209
|
-
border: string;
|
210
|
-
width: number[];
|
211
|
-
borderRadius: number;
|
212
|
-
backgroundColor: string;
|
213
|
-
|
214
|
-
paddingTop: number[];
|
215
|
-
paddingLeft: number[];
|
216
|
-
paddingRight: number[];
|
217
|
-
paddingBottom: number[];
|
218
|
-
};
|
219
|
-
|
220
|
-
carousel: {
|
221
|
-
gap: number[];
|
222
|
-
bullet: {
|
223
|
-
width: number[];
|
224
|
-
height: number[];
|
225
|
-
borderRadius: number;
|
226
|
-
backgroundColor: string;
|
227
|
-
};
|
228
|
-
};
|
229
|
-
|
230
|
-
video: {
|
231
|
-
playButton: {
|
232
|
-
color: string;
|
233
|
-
border: string;
|
234
|
-
width: number[];
|
235
|
-
height: number[];
|
236
|
-
borderRadius: number;
|
237
|
-
backgroundColor: string;
|
238
|
-
};
|
239
|
-
pauseButton: {
|
240
|
-
color: string;
|
241
|
-
border: string;
|
242
|
-
width: number[];
|
243
|
-
height: number[];
|
244
|
-
borderRadius: number;
|
245
|
-
backgroundColor: string;
|
246
|
-
};
|
247
|
-
soundButton: {
|
248
|
-
color: string;
|
249
|
-
border: string;
|
250
|
-
width: number[];
|
251
|
-
height: number[];
|
252
|
-
borderRadius: number;
|
253
|
-
backgroundColor: string;
|
254
|
-
};
|
255
|
-
closeButton: {
|
256
|
-
color: string;
|
257
|
-
border: string;
|
258
|
-
width: number[];
|
259
|
-
height: number[];
|
260
|
-
borderRadius: number;
|
261
|
-
backgroundColor: string;
|
262
|
-
};
|
263
|
-
};
|
264
|
-
|
265
|
-
consentCookie: {
|
266
|
-
borders: number;
|
267
|
-
width: number[];
|
268
|
-
borderRadius: number;
|
269
|
-
backgroundColor: string;
|
270
|
-
|
271
|
-
overlayBlur: number;
|
272
|
-
overlayOpacity: number;
|
273
|
-
overlayBackgroundColor: string;
|
274
|
-
|
275
|
-
paddingTop: number[];
|
276
|
-
paddingLeft: number[];
|
277
|
-
paddingRight: number[];
|
278
|
-
paddingBottom: number[];
|
279
|
-
|
280
|
-
actionsGap: number;
|
281
|
-
actionsPaddingTop: number[];
|
282
|
-
};
|
283
|
-
|
284
|
-
nav: {
|
285
|
-
gap: number[];
|
286
|
-
};
|
287
|
-
|
288
|
-
navSocial: {
|
289
|
-
gap: number[];
|
290
|
-
};
|
291
|
-
|
292
|
-
navLegal: {
|
293
|
-
gap: number[];
|
294
|
-
};
|
295
|
-
}
|
package/src/utils/quickTheme.ts
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
import { createGlobalTheme } from '@vanilla-extract/css';
|
2
|
-
import { themeContract } from '../theme/contract.css';
|
3
|
-
import { baseLightTheme } from '../theme/baseThemeValues';
|
4
|
-
|
5
|
-
// Quick theme utility for RAD (Rapid Application Development)
|
6
|
-
// Just import this to get a working theme instantly
|
7
|
-
export const quickTheme = createGlobalTheme(':root', themeContract, {
|
8
|
-
colors: baseLightTheme.colors,
|
9
|
-
space: baseLightTheme.space,
|
10
|
-
radii: baseLightTheme.radii,
|
11
|
-
fonts: baseLightTheme.fonts,
|
12
|
-
maxWidth: baseLightTheme.maxWidth,
|
13
|
-
fontSizes: baseLightTheme.fontSizes,
|
14
|
-
fontWeights: baseLightTheme.fontWeights,
|
15
|
-
lineHeights: baseLightTheme.lineHeights,
|
16
|
-
shadows: baseLightTheme.shadows,
|
17
|
-
section: baseLightTheme.section,
|
18
|
-
header: baseLightTheme.header,
|
19
|
-
footer: baseLightTheme.footer,
|
20
|
-
});
|
21
|
-
|
22
|
-
// Helper function to create quick override themes
|
23
|
-
export const createQuickTheme = (overrides: Partial<typeof baseLightTheme> = {}) => {
|
24
|
-
return createGlobalTheme(':root', themeContract, {
|
25
|
-
colors: { ...baseLightTheme.colors, ...overrides.colors },
|
26
|
-
space: { ...baseLightTheme.space, ...overrides.space },
|
27
|
-
radii: { ...baseLightTheme.radii, ...overrides.radii },
|
28
|
-
fonts: { ...baseLightTheme.fonts, ...overrides.fonts },
|
29
|
-
maxWidth: overrides.maxWidth || baseLightTheme.maxWidth,
|
30
|
-
fontSizes: { ...baseLightTheme.fontSizes, ...overrides.fontSizes },
|
31
|
-
fontWeights: { ...baseLightTheme.fontWeights, ...overrides.fontWeights },
|
32
|
-
lineHeights: { ...baseLightTheme.lineHeights, ...overrides.lineHeights },
|
33
|
-
shadows: { ...baseLightTheme.shadows, ...overrides.shadows },
|
34
|
-
section: { ...baseLightTheme.section, ...overrides.section },
|
35
|
-
header: { ...baseLightTheme.header, ...overrides.header },
|
36
|
-
footer: { ...baseLightTheme.footer, ...overrides.footer },
|
37
|
-
});
|
38
|
-
};
|
package/src/utils/theme.ts
DELETED
@@ -1,131 +0,0 @@
|
|
1
|
-
import { createGlobalTheme } from '@vanilla-extract/css';
|
2
|
-
import { baseDarkTheme, baseLightTheme } from '../theme/baseThemeValues';
|
3
|
-
import { themeContract } from '../theme/contract.css';
|
4
|
-
|
5
|
-
// Type for partial theme overrides
|
6
|
-
export type ThemeOverrides = {
|
7
|
-
colors?: Partial<typeof baseLightTheme.colors>;
|
8
|
-
space?: Partial<typeof baseLightTheme.space>;
|
9
|
-
radii?: Partial<typeof baseLightTheme.radii>;
|
10
|
-
fonts?: Partial<typeof baseLightTheme.fonts>;
|
11
|
-
maxWidth?: Partial<typeof baseLightTheme.maxWidth>;
|
12
|
-
fontSizes?: Partial<typeof baseLightTheme.fontSizes>;
|
13
|
-
fontWeights?: Partial<typeof baseLightTheme.fontSizes>;
|
14
|
-
lineHeights?: Partial<typeof baseLightTheme.fontSizes>;
|
15
|
-
shadows?: Partial<typeof baseLightTheme.fontSizes>;
|
16
|
-
section?: Partial<typeof baseLightTheme.fontSizes>;
|
17
|
-
header?: Partial<typeof baseLightTheme.fontSizes>;
|
18
|
-
footer?: Partial<typeof baseLightTheme.fontSizes>;
|
19
|
-
};
|
20
|
-
|
21
|
-
// Utility to create a theme with partial overrides over light theme base
|
22
|
-
const createAppTheme = (selector: string, overrides: ThemeOverrides = {}) => {
|
23
|
-
return createGlobalTheme(selector, themeContract, {
|
24
|
-
colors: {
|
25
|
-
...baseLightTheme.colors,
|
26
|
-
...overrides.colors,
|
27
|
-
},
|
28
|
-
space: {
|
29
|
-
...baseLightTheme.space,
|
30
|
-
...overrides.space,
|
31
|
-
},
|
32
|
-
radii: {
|
33
|
-
...baseLightTheme.radii,
|
34
|
-
...overrides.radii,
|
35
|
-
},
|
36
|
-
fonts: {
|
37
|
-
...baseLightTheme.fonts,
|
38
|
-
...overrides.fonts,
|
39
|
-
},
|
40
|
-
maxWidth: `${baseLightTheme.maxWidth || overrides.maxWidth}`,
|
41
|
-
fontSizes: {
|
42
|
-
...baseLightTheme.fontSizes,
|
43
|
-
...overrides.fontSizes,
|
44
|
-
},
|
45
|
-
fontWeights: {
|
46
|
-
...baseLightTheme.fontWeights,
|
47
|
-
...overrides.fontWeights,
|
48
|
-
},
|
49
|
-
lineHeights: {
|
50
|
-
...baseLightTheme.lineHeights,
|
51
|
-
...overrides.lineHeights,
|
52
|
-
},
|
53
|
-
shadows: {
|
54
|
-
...baseLightTheme.shadows,
|
55
|
-
...overrides.shadows,
|
56
|
-
},
|
57
|
-
section: {
|
58
|
-
...baseLightTheme.section,
|
59
|
-
...overrides.section,
|
60
|
-
},
|
61
|
-
header: {
|
62
|
-
...baseLightTheme.header,
|
63
|
-
...overrides.header,
|
64
|
-
},
|
65
|
-
footer: {
|
66
|
-
...baseLightTheme.footer,
|
67
|
-
...overrides.footer,
|
68
|
-
},
|
69
|
-
});
|
70
|
-
};
|
71
|
-
|
72
|
-
// Utility to create a theme with partial overrides over dark theme base
|
73
|
-
const createAppDarkTheme = (selector: string, overrides: ThemeOverrides = {}) => {
|
74
|
-
return createGlobalTheme(selector, themeContract, {
|
75
|
-
colors: {
|
76
|
-
...baseDarkTheme.colors,
|
77
|
-
...overrides.colors,
|
78
|
-
},
|
79
|
-
space: {
|
80
|
-
...baseDarkTheme.space,
|
81
|
-
...overrides.space,
|
82
|
-
},
|
83
|
-
radii: {
|
84
|
-
...baseDarkTheme.radii,
|
85
|
-
...overrides.radii,
|
86
|
-
},
|
87
|
-
fonts: {
|
88
|
-
...baseDarkTheme.fonts,
|
89
|
-
...overrides.fonts,
|
90
|
-
},
|
91
|
-
maxWidth: overrides.maxWidth || `${baseDarkTheme.maxWidth}px`,
|
92
|
-
fontSizes: {
|
93
|
-
...baseDarkTheme.fontSizes,
|
94
|
-
...overrides.fontSizes,
|
95
|
-
},
|
96
|
-
fontWeights: {
|
97
|
-
...baseDarkTheme.fontWeights,
|
98
|
-
...overrides.fontWeights,
|
99
|
-
},
|
100
|
-
lineHeights: {
|
101
|
-
...baseDarkTheme.lineHeights,
|
102
|
-
...overrides.lineHeights,
|
103
|
-
},
|
104
|
-
shadows: {
|
105
|
-
...baseDarkTheme.shadows,
|
106
|
-
...overrides.shadows,
|
107
|
-
},
|
108
|
-
section: {
|
109
|
-
...baseDarkTheme.section,
|
110
|
-
...overrides.section,
|
111
|
-
},
|
112
|
-
header: {
|
113
|
-
...baseDarkTheme.header,
|
114
|
-
...overrides.header,
|
115
|
-
},
|
116
|
-
footer: {
|
117
|
-
...baseDarkTheme.footer,
|
118
|
-
...overrides.footer,
|
119
|
-
},
|
120
|
-
});
|
121
|
-
};
|
122
|
-
|
123
|
-
// Convenience function for light theme (extends base light theme)
|
124
|
-
export const createLightTheme = (overrides: ThemeOverrides = {}) => {
|
125
|
-
return createAppTheme('html', overrides);
|
126
|
-
};
|
127
|
-
|
128
|
-
// Convenience function for dark theme (extends base dark theme)
|
129
|
-
export const createDarkTheme = (overrides: ThemeOverrides = {}) => {
|
130
|
-
return createAppDarkTheme('html[data-theme="dark"]', overrides);
|
131
|
-
};
|
File without changes
|
File without changes
|