@getflip/swirl-components 0.114.0 → 0.115.0
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/components.json +18 -18
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-theme-provider.cjs.entry.js +42 -285
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/swirl-theme-provider/swirl-theme-provider.js +72 -99
- package/dist/collection/components/swirl-theme-provider/swirl-theme-provider.spec.js +67 -18
- package/dist/collection/components/swirl-theme-provider/swirl-theme-provider.stories.js +371 -17
- package/dist/collection/components/swirl-theme-provider/swirl-theme-provider.types.js +1 -0
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-theme-provider.js +46 -289
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-theme-provider.entry.js +42 -285
- package/dist/swirl-components/p-bceafa56.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-theme-provider/swirl-theme-provider.d.ts +15 -34
- package/dist/types/components/swirl-theme-provider/swirl-theme-provider.types.d.ts +45 -0
- package/dist/types/components.d.ts +11 -11
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/swirl-components/p-1a4c6557.entry.js +0 -1
- package/dist/typings.d.ts +0 -1
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"./components/swirl-table-column/swirl-table-column.js",
|
|
43
43
|
"./components/swirl-tag/swirl-tag.js",
|
|
44
44
|
"./components/swirl-text/swirl-text.js",
|
|
45
|
-
"./components/swirl-theme-provider/swirl-theme-provider.js",
|
|
46
45
|
"./components/swirl-thumbnail/swirl-thumbnail.js",
|
|
47
46
|
"./components/swirl-toast/swirl-toast.js",
|
|
48
47
|
"./components/swirl-toast-provider/swirl-toast-provider.js",
|
|
@@ -299,6 +298,7 @@
|
|
|
299
298
|
"./components/swirl-table-row/swirl-table-row.js",
|
|
300
299
|
"./components/swirl-table-row-group/swirl-table-row-group.js",
|
|
301
300
|
"./components/swirl-tabs/swirl-tabs.js",
|
|
301
|
+
"./components/swirl-theme-provider/swirl-theme-provider.js",
|
|
302
302
|
"./components/swirl-time-input/swirl-time-input.js",
|
|
303
303
|
"./components/swirl-tree-navigation-item/swirl-tree-navigation-item.js",
|
|
304
304
|
"./components/swirl-video-thumbnail/swirl-video-thumbnail.js",
|
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
|
-
import { hsla, parseToHsla, toRgba } from "color2k";
|
|
3
2
|
const preferredThemeStorageKey = "swirl-preferred-theme";
|
|
4
|
-
const tenantColorMapping = {
|
|
5
|
-
"--s-action-primary-default": "primary",
|
|
6
|
-
"--s-action-primary-hovered": "primaryHovered",
|
|
7
|
-
"--s-action-primary-pressed": "primaryPressed",
|
|
8
|
-
"--s-text-on-action-primary": "primaryContrast",
|
|
9
|
-
"--s-icon-on-action-primary": "primaryContrast",
|
|
10
|
-
"--s-surface-highlight-default": "secondary",
|
|
11
|
-
"--s-surface-highlight-hovered": "secondaryHovered",
|
|
12
|
-
"--s-surface-highlight-pressed": "secondaryPressed",
|
|
13
|
-
"--s-on-surface-highlight-default": "secondaryHovered",
|
|
14
|
-
"--s-text-on-surface-highlight": "secondaryContrast",
|
|
15
|
-
"--s-icon-on-surface-highlight": "secondaryContrast",
|
|
16
|
-
"--s-text-highlight": "text",
|
|
17
|
-
"--s-interactive-primary-default": "text",
|
|
18
|
-
"--s-interactive-primary-hovered": "textHovered",
|
|
19
|
-
"--s-interactive-primary-pressed": "textPressed",
|
|
20
|
-
};
|
|
21
3
|
export class SwirlThemeProvider {
|
|
22
4
|
constructor() {
|
|
5
|
+
this.setDesignTokens = [];
|
|
23
6
|
this.config = undefined;
|
|
24
7
|
}
|
|
25
8
|
componentWillLoad() {
|
|
@@ -33,27 +16,27 @@ export class SwirlThemeProvider {
|
|
|
33
16
|
this.updateAppTheme();
|
|
34
17
|
}
|
|
35
18
|
/**
|
|
36
|
-
* Returns the active
|
|
19
|
+
* Returns the active OS theme.
|
|
37
20
|
* @returns SwirlTheme
|
|
38
21
|
*/
|
|
39
|
-
async
|
|
40
|
-
return this.
|
|
22
|
+
async getActiveOSTheme() {
|
|
23
|
+
return this.appOSTheme;
|
|
41
24
|
}
|
|
42
25
|
/**
|
|
43
|
-
* Returns the user's preferred theme stored in local storage.
|
|
26
|
+
* Returns the user's preferred OS theme stored in local storage.
|
|
44
27
|
* @returns SwirlTheme
|
|
45
28
|
*/
|
|
46
|
-
async
|
|
29
|
+
async getPreferredOSTheme() {
|
|
47
30
|
if (!Boolean(this.resolvedConfig.storage)) {
|
|
48
31
|
return;
|
|
49
32
|
}
|
|
50
33
|
return this.resolvedConfig.storage.getItem(preferredThemeStorageKey);
|
|
51
34
|
}
|
|
52
35
|
/**
|
|
53
|
-
* Sets the user's preferred theme and stores it in local storage. Overrides
|
|
54
|
-
* the
|
|
36
|
+
* Sets the user's preferred OS theme and stores it in local storage. Overrides
|
|
37
|
+
* the system theme.
|
|
55
38
|
*/
|
|
56
|
-
async
|
|
39
|
+
async setPreferredOSTheme(theme) {
|
|
57
40
|
if (!Boolean(this.resolvedConfig.storage)) {
|
|
58
41
|
return;
|
|
59
42
|
}
|
|
@@ -61,9 +44,9 @@ export class SwirlThemeProvider {
|
|
|
61
44
|
this.updateAppTheme();
|
|
62
45
|
}
|
|
63
46
|
/**
|
|
64
|
-
* Resets the user's preferred theme, using the
|
|
47
|
+
* Resets the user's preferred OS theme, using the system theme instead.
|
|
65
48
|
*/
|
|
66
|
-
async
|
|
49
|
+
async resetPreferredOSTheme() {
|
|
67
50
|
if (!Boolean(this.resolvedConfig.storage)) {
|
|
68
51
|
return;
|
|
69
52
|
}
|
|
@@ -90,8 +73,8 @@ export class SwirlThemeProvider {
|
|
|
90
73
|
});
|
|
91
74
|
}
|
|
92
75
|
async updateAppTheme() {
|
|
93
|
-
this.
|
|
94
|
-
if (this.
|
|
76
|
+
this.appOSTheme = (await this.getPreferredOSTheme()) || this.osTheme;
|
|
77
|
+
if (this.appOSTheme === "dark") {
|
|
95
78
|
document.documentElement.classList.remove("theme-light");
|
|
96
79
|
document.documentElement.classList.add("theme-dark");
|
|
97
80
|
}
|
|
@@ -100,59 +83,49 @@ export class SwirlThemeProvider {
|
|
|
100
83
|
document.documentElement.classList.add("theme-light");
|
|
101
84
|
}
|
|
102
85
|
this.updateTenantVariables();
|
|
86
|
+
this.updateTenantAssets();
|
|
103
87
|
const themeChangeEventData = {
|
|
104
|
-
activeTheme: await this.
|
|
105
|
-
preferredTheme: await this.
|
|
88
|
+
activeTheme: await this.getActiveOSTheme(),
|
|
89
|
+
preferredTheme: await this.getPreferredOSTheme(),
|
|
106
90
|
};
|
|
107
|
-
if (!Boolean(this.
|
|
91
|
+
if (!Boolean(this.recentOSThemeChangeEventData) ||
|
|
108
92
|
themeChangeEventData.activeTheme !==
|
|
109
|
-
this.
|
|
93
|
+
this.recentOSThemeChangeEventData.activeTheme ||
|
|
110
94
|
themeChangeEventData.preferredTheme !==
|
|
111
|
-
this.
|
|
112
|
-
this.
|
|
113
|
-
this.themeChange.emit(this.
|
|
95
|
+
this.recentOSThemeChangeEventData.preferredTheme) {
|
|
96
|
+
this.recentOSThemeChangeEventData = themeChangeEventData;
|
|
97
|
+
this.themeChange.emit(this.recentOSThemeChangeEventData);
|
|
114
98
|
}
|
|
115
99
|
}
|
|
100
|
+
updateTenantAssets() {
|
|
101
|
+
const theme = this.resolvedConfig?.themes?.[this.appOSTheme];
|
|
102
|
+
if (!Boolean(theme)) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
document.head
|
|
106
|
+
.querySelector('link[rel="icon"]')
|
|
107
|
+
?.setAttribute("href", theme.favicon.link);
|
|
108
|
+
}
|
|
116
109
|
updateTenantVariables() {
|
|
117
|
-
const
|
|
118
|
-
if (!Boolean(
|
|
110
|
+
const theme = this.resolvedConfig?.themes?.[this.appOSTheme];
|
|
111
|
+
if (!Boolean(theme)) {
|
|
119
112
|
this.resetTenantVariables();
|
|
120
113
|
return;
|
|
121
114
|
}
|
|
122
115
|
const rootElement = this.resolvedConfig.rootElement;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const secondaryHovered = toRgba(hsla(secondaryHsla[0], secondaryHsla[1], secondaryHsla[2] + 0.07, 1));
|
|
130
|
-
const secondaryPressed = toRgba(hsla(secondaryHsla[0], secondaryHsla[1], secondaryHsla[2] + 0.15, 1));
|
|
131
|
-
const textHovered = toRgba(hsla(textHsla[0], textHsla[1] - 0.34, textHsla[2] + 0.1, 1));
|
|
132
|
-
const textPressed = toRgba(hsla(textHsla[0], textHsla[1] - 0.48, textHsla[2] + 0.2, 1));
|
|
133
|
-
const tenantThemeWithGeneratedStateColors = {
|
|
134
|
-
...tenantTheme,
|
|
135
|
-
primaryHovered: primaryHovered,
|
|
136
|
-
primaryPressed: primaryPressed,
|
|
137
|
-
secondaryHovered: secondaryHovered,
|
|
138
|
-
secondaryPressed: secondaryPressed,
|
|
139
|
-
textHovered: textHovered,
|
|
140
|
-
textPressed: textPressed,
|
|
141
|
-
};
|
|
142
|
-
// set custom properties for tenant theme colors
|
|
143
|
-
Object.entries(tenantColorMapping).forEach(([key, value]) => rootElement.style.setProperty(key, tenantThemeWithGeneratedStateColors[value]));
|
|
116
|
+
this.setDesignTokens = [];
|
|
117
|
+
theme.design_tokens.forEach((token) => {
|
|
118
|
+
const propertyName = `--s-${token.id}`;
|
|
119
|
+
rootElement.style.setProperty(propertyName, `rgba(${token.color.r}, ${token.color.g}, ${token.color.b}, ${token.color.a})`);
|
|
120
|
+
this.setDesignTokens.push(propertyName);
|
|
121
|
+
});
|
|
144
122
|
}
|
|
145
123
|
resetTenantVariables() {
|
|
146
124
|
const rootElement = this.resolvedConfig.rootElement;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
"secondaryHovered",
|
|
152
|
-
"secondaryPressed",
|
|
153
|
-
"textHovered",
|
|
154
|
-
"textPressed",
|
|
155
|
-
].forEach((key) => rootElement.style.removeProperty(key));
|
|
125
|
+
this.setDesignTokens.forEach((property) => {
|
|
126
|
+
rootElement.style.removeProperty(property);
|
|
127
|
+
});
|
|
128
|
+
this.setDesignTokens = [];
|
|
156
129
|
}
|
|
157
130
|
render() {
|
|
158
131
|
return (h(Host, null, h("slot", null)));
|
|
@@ -176,11 +149,11 @@ export class SwirlThemeProvider {
|
|
|
176
149
|
"mutable": false,
|
|
177
150
|
"complexType": {
|
|
178
151
|
"original": "SwirlThemeProviderConfig",
|
|
179
|
-
"resolved": "{ rootElement?: HTMLElement; storage?: SwirlThemeProviderStorage;
|
|
152
|
+
"resolved": "{ rootElement?: HTMLElement; storage?: SwirlThemeProviderStorage; themes?: SwirlThemes; }",
|
|
180
153
|
"references": {
|
|
181
154
|
"SwirlThemeProviderConfig": {
|
|
182
|
-
"location": "
|
|
183
|
-
"path": "
|
|
155
|
+
"location": "import",
|
|
156
|
+
"path": "./swirl-theme-provider.types"
|
|
184
157
|
}
|
|
185
158
|
}
|
|
186
159
|
},
|
|
@@ -205,12 +178,12 @@ export class SwirlThemeProvider {
|
|
|
205
178
|
"text": ""
|
|
206
179
|
},
|
|
207
180
|
"complexType": {
|
|
208
|
-
"original": "
|
|
209
|
-
"resolved": "{ activeTheme:
|
|
181
|
+
"original": "SwirlOSThemeChangeEventData",
|
|
182
|
+
"resolved": "{ activeTheme: SwirlOSTheme; preferredTheme: SwirlOSTheme; }",
|
|
210
183
|
"references": {
|
|
211
|
-
"
|
|
212
|
-
"location": "
|
|
213
|
-
"path": "
|
|
184
|
+
"SwirlOSThemeChangeEventData": {
|
|
185
|
+
"location": "import",
|
|
186
|
+
"path": "./swirl-theme-provider.types"
|
|
214
187
|
}
|
|
215
188
|
}
|
|
216
189
|
}
|
|
@@ -218,55 +191,55 @@ export class SwirlThemeProvider {
|
|
|
218
191
|
}
|
|
219
192
|
static get methods() {
|
|
220
193
|
return {
|
|
221
|
-
"
|
|
194
|
+
"getActiveOSTheme": {
|
|
222
195
|
"complexType": {
|
|
223
|
-
"signature": "() => Promise<
|
|
196
|
+
"signature": "() => Promise<SwirlOSTheme>",
|
|
224
197
|
"parameters": [],
|
|
225
198
|
"references": {
|
|
226
199
|
"Promise": {
|
|
227
200
|
"location": "global"
|
|
228
201
|
},
|
|
229
|
-
"
|
|
230
|
-
"location": "
|
|
231
|
-
"path": "
|
|
202
|
+
"SwirlOSTheme": {
|
|
203
|
+
"location": "import",
|
|
204
|
+
"path": "./swirl-theme-provider.types"
|
|
232
205
|
}
|
|
233
206
|
},
|
|
234
|
-
"return": "Promise<
|
|
207
|
+
"return": "Promise<SwirlOSTheme>"
|
|
235
208
|
},
|
|
236
209
|
"docs": {
|
|
237
|
-
"text": "Returns the active
|
|
210
|
+
"text": "Returns the active OS theme.",
|
|
238
211
|
"tags": [{
|
|
239
212
|
"name": "returns",
|
|
240
213
|
"text": "SwirlTheme"
|
|
241
214
|
}]
|
|
242
215
|
}
|
|
243
216
|
},
|
|
244
|
-
"
|
|
217
|
+
"getPreferredOSTheme": {
|
|
245
218
|
"complexType": {
|
|
246
|
-
"signature": "() => Promise<
|
|
219
|
+
"signature": "() => Promise<SwirlOSTheme>",
|
|
247
220
|
"parameters": [],
|
|
248
221
|
"references": {
|
|
249
222
|
"Promise": {
|
|
250
223
|
"location": "global"
|
|
251
224
|
},
|
|
252
|
-
"
|
|
253
|
-
"location": "
|
|
254
|
-
"path": "
|
|
225
|
+
"SwirlOSTheme": {
|
|
226
|
+
"location": "import",
|
|
227
|
+
"path": "./swirl-theme-provider.types"
|
|
255
228
|
}
|
|
256
229
|
},
|
|
257
|
-
"return": "Promise<
|
|
230
|
+
"return": "Promise<SwirlOSTheme>"
|
|
258
231
|
},
|
|
259
232
|
"docs": {
|
|
260
|
-
"text": "Returns the user's preferred theme stored in local storage.",
|
|
233
|
+
"text": "Returns the user's preferred OS theme stored in local storage.",
|
|
261
234
|
"tags": [{
|
|
262
235
|
"name": "returns",
|
|
263
236
|
"text": "SwirlTheme"
|
|
264
237
|
}]
|
|
265
238
|
}
|
|
266
239
|
},
|
|
267
|
-
"
|
|
240
|
+
"setPreferredOSTheme": {
|
|
268
241
|
"complexType": {
|
|
269
|
-
"signature": "(theme:
|
|
242
|
+
"signature": "(theme: SwirlOSTheme) => Promise<void>",
|
|
270
243
|
"parameters": [{
|
|
271
244
|
"tags": [],
|
|
272
245
|
"text": ""
|
|
@@ -275,19 +248,19 @@ export class SwirlThemeProvider {
|
|
|
275
248
|
"Promise": {
|
|
276
249
|
"location": "global"
|
|
277
250
|
},
|
|
278
|
-
"
|
|
279
|
-
"location": "
|
|
280
|
-
"path": "
|
|
251
|
+
"SwirlOSTheme": {
|
|
252
|
+
"location": "import",
|
|
253
|
+
"path": "./swirl-theme-provider.types"
|
|
281
254
|
}
|
|
282
255
|
},
|
|
283
256
|
"return": "Promise<void>"
|
|
284
257
|
},
|
|
285
258
|
"docs": {
|
|
286
|
-
"text": "Sets the user's preferred theme and stores it in local storage. Overrides\nthe
|
|
259
|
+
"text": "Sets the user's preferred OS theme and stores it in local storage. Overrides\nthe system theme.",
|
|
287
260
|
"tags": []
|
|
288
261
|
}
|
|
289
262
|
},
|
|
290
|
-
"
|
|
263
|
+
"resetPreferredOSTheme": {
|
|
291
264
|
"complexType": {
|
|
292
265
|
"signature": "() => Promise<void>",
|
|
293
266
|
"parameters": [],
|
|
@@ -299,7 +272,7 @@ export class SwirlThemeProvider {
|
|
|
299
272
|
"return": "Promise<void>"
|
|
300
273
|
},
|
|
301
274
|
"docs": {
|
|
302
|
-
"text": "Resets the user's preferred theme, using the
|
|
275
|
+
"text": "Resets the user's preferred OS theme, using the system theme instead.",
|
|
303
276
|
"tags": []
|
|
304
277
|
}
|
|
305
278
|
}
|
|
@@ -24,21 +24,21 @@ describe("swirl-theme-provider", () => {
|
|
|
24
24
|
components: [SwirlThemeProvider],
|
|
25
25
|
html: `<swirl-theme-provider></swirl-theme-provider>`,
|
|
26
26
|
});
|
|
27
|
-
expect(await page.root.
|
|
27
|
+
expect(await page.root.getActiveOSTheme()).toBe("dark");
|
|
28
28
|
});
|
|
29
29
|
it("overrides the os theme with a preferred user theme", async () => {
|
|
30
30
|
const page = await newSpecPage({
|
|
31
31
|
components: [SwirlThemeProvider],
|
|
32
32
|
html: `<swirl-theme-provider></swirl-theme-provider>`,
|
|
33
33
|
});
|
|
34
|
-
expect(await page.root.
|
|
35
|
-
expect(await page.root.
|
|
36
|
-
await page.root.
|
|
37
|
-
expect(await page.root.
|
|
38
|
-
expect(await page.root.
|
|
39
|
-
await page.root.
|
|
40
|
-
expect(await page.root.
|
|
41
|
-
expect(await page.root.
|
|
34
|
+
expect(await page.root.getActiveOSTheme()).toBe("dark");
|
|
35
|
+
expect(await page.root.getPreferredOSTheme()).toBeNull();
|
|
36
|
+
await page.root.setPreferredOSTheme("light");
|
|
37
|
+
expect(await page.root.getActiveOSTheme()).toBe("light");
|
|
38
|
+
expect(await page.root.getPreferredOSTheme()).toBe("light");
|
|
39
|
+
await page.root.resetPreferredOSTheme();
|
|
40
|
+
expect(await page.root.getActiveOSTheme()).toBe("dark");
|
|
41
|
+
expect(await page.root.getPreferredOSTheme()).toBeNull();
|
|
42
42
|
});
|
|
43
43
|
it("adds custom tenant color properties", async () => {
|
|
44
44
|
const page = await newSpecPage({
|
|
@@ -46,17 +46,66 @@ describe("swirl-theme-provider", () => {
|
|
|
46
46
|
html: `<swirl-theme-provider></swirl-theme-provider>`,
|
|
47
47
|
});
|
|
48
48
|
page.root.config = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
themes: {
|
|
50
|
+
dark: {
|
|
51
|
+
favicon: {
|
|
52
|
+
id: "d3458010-97c6-40a7-896d-804ab6c33496",
|
|
53
|
+
link: "https://master.flip-app.dev/media/themes/d3458010-97c6-40a7-896d-804ab6c33496",
|
|
54
|
+
file_name: "dark-favIcon.png",
|
|
55
|
+
},
|
|
56
|
+
company_icon: {
|
|
57
|
+
id: "6d1c1da4-fa4b-4d77-b44d-b1fa58ed6337",
|
|
58
|
+
link: "https://master.flip-app.dev/media/themes/6d1c1da4-fa4b-4d77-b44d-b1fa58ed6337",
|
|
59
|
+
file_name: "dark-companyIcon.png",
|
|
60
|
+
},
|
|
61
|
+
company_logo: {
|
|
62
|
+
id: "618f411b-eaad-4c06-8834-54fce38fcbad",
|
|
63
|
+
link: "https://master.flip-app.dev/media/themes/618f411b-eaad-4c06-8834-54fce38fcbad",
|
|
64
|
+
file_name: "dark-companyLogo.png",
|
|
65
|
+
},
|
|
66
|
+
design_tokens: [
|
|
67
|
+
{
|
|
68
|
+
id: "text-highlight",
|
|
69
|
+
color: {
|
|
70
|
+
r: 255,
|
|
71
|
+
g: 0,
|
|
72
|
+
b: 0,
|
|
73
|
+
a: 255,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
light: {
|
|
79
|
+
favicon: {
|
|
80
|
+
id: "49ab1bb9-17d9-45c0-87b4-2247bb8c3648",
|
|
81
|
+
link: "https://master.flip-app.dev/media/themes/49ab1bb9-17d9-45c0-87b4-2247bb8c3648",
|
|
82
|
+
file_name: "light-favIcon.png",
|
|
83
|
+
},
|
|
84
|
+
company_icon: {
|
|
85
|
+
id: "0eaddd17-3468-4243-bdd8-6fae1222e032",
|
|
86
|
+
link: "https://master.flip-app.dev/media/themes/0eaddd17-3468-4243-bdd8-6fae1222e032",
|
|
87
|
+
file_name: "light-companyIcon.png",
|
|
88
|
+
},
|
|
89
|
+
company_logo: {
|
|
90
|
+
id: "b39cb0c9-9097-48c8-900b-6e24686aac5e",
|
|
91
|
+
link: "https://master.flip-app.dev/media/themes/b39cb0c9-9097-48c8-900b-6e24686aac5e",
|
|
92
|
+
file_name: "light-companyLogo.png",
|
|
93
|
+
},
|
|
94
|
+
design_tokens: [
|
|
95
|
+
{
|
|
96
|
+
id: "text-highlight",
|
|
97
|
+
color: {
|
|
98
|
+
r: 0,
|
|
99
|
+
g: 255,
|
|
100
|
+
b: 0,
|
|
101
|
+
a: 255,
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
55
106
|
},
|
|
56
107
|
};
|
|
57
108
|
await page.waitForChanges();
|
|
58
|
-
expect(page.doc.documentElement.style.getPropertyValue("--s-
|
|
59
|
-
expect(page.doc.documentElement.style.getPropertyValue("--s-surface-highlight-default")).toBe("green");
|
|
60
|
-
expect(page.doc.documentElement.style.getPropertyValue("--s-text-highlight")).toBe("purple");
|
|
109
|
+
expect(page.doc.documentElement.style.getPropertyValue("--s-text-highlight")).toBe("rgba(255, 0, 0, 255)");
|
|
61
110
|
});
|
|
62
111
|
});
|