theme-vir 28.25.1 → 28.25.2
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.
|
@@ -229,11 +229,17 @@ export function buildColorTheme(colorPalette, { omittedColorValues = defaultOmit
|
|
|
229
229
|
};
|
|
230
230
|
});
|
|
231
231
|
/** Lightest palette color (least contrast against white). */
|
|
232
|
-
const lightestColorString = colorStrings.reduce((lightest, color) =>
|
|
233
|
-
|
|
234
|
-
|
|
232
|
+
const lightestColorString = colorStrings.reduce((lightest, color) => {
|
|
233
|
+
return (lightnessProxies[color] ?? 0) < (lightnessProxies[lightest] ?? 0)
|
|
234
|
+
? color
|
|
235
|
+
: lightest;
|
|
236
|
+
});
|
|
235
237
|
/** Darkest palette color (most contrast against white). */
|
|
236
|
-
const darkestColorString = colorStrings.reduce((darkest, color) =>
|
|
238
|
+
const darkestColorString = colorStrings.reduce((darkest, color) => {
|
|
239
|
+
return (lightnessProxies[color] ?? 0) > (lightnessProxies[darkest] ?? 0)
|
|
240
|
+
? color
|
|
241
|
+
: darkest;
|
|
242
|
+
});
|
|
237
243
|
/**
|
|
238
244
|
* On-self light mode: lightest fg achieving small-body contrast on the lightest palette
|
|
239
245
|
* bg. Fixed across all on-self contrast levels.
|
|
@@ -241,13 +241,15 @@ export function createColorPaletteBookPages({ colors, parent, title, includeCont
|
|
|
241
241
|
}
|
|
242
242
|
const blackWhiteContrastPage = createContrastPage('Contrast Black White', blackWhiteCells);
|
|
243
243
|
function createSelfContrastPage(fontWeight) {
|
|
244
|
-
return createContrastPage(`Contrast Self ${fontWeight}`, (colors) =>
|
|
245
|
-
return {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
return createContrastPage(`Contrast Self ${fontWeight}`, (colors) => {
|
|
245
|
+
return colors.map((color) => {
|
|
246
|
+
return {
|
|
247
|
+
fontWeight,
|
|
248
|
+
title: color.suffix || '',
|
|
249
|
+
foreground: color.definition,
|
|
250
|
+
};
|
|
251
|
+
});
|
|
252
|
+
});
|
|
251
253
|
}
|
|
252
254
|
function createThemePages() {
|
|
253
255
|
const generatedTheme = buildColorTheme(colors, options);
|
|
@@ -116,11 +116,13 @@ export function createColorThemeBookPages({ parent, title, theme, hideInverseCol
|
|
|
116
116
|
const currentTheme = selectedOverride?.asTheme || defaultTheme;
|
|
117
117
|
return html `
|
|
118
118
|
<div class="theme-wrapper">
|
|
119
|
-
${group.map((entry) =>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
${group.map((entry) => {
|
|
120
|
+
return buildThemeColorTemplate({
|
|
121
|
+
controls,
|
|
122
|
+
theme: currentTheme,
|
|
123
|
+
themeColorName: entry,
|
|
124
|
+
});
|
|
125
|
+
})}
|
|
124
126
|
</div>
|
|
125
127
|
`;
|
|
126
128
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "theme-vir",
|
|
3
|
-
"version": "28.25.
|
|
3
|
+
"version": "28.25.2",
|
|
4
4
|
"description": "Create an entire web theme.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design",
|
|
@@ -43,35 +43,35 @@
|
|
|
43
43
|
"test:update": "virmator test web update"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@augment-vir/assert": "^32.2.
|
|
47
|
-
"@augment-vir/common": "^32.2.
|
|
46
|
+
"@augment-vir/assert": "^32.2.3",
|
|
47
|
+
"@augment-vir/common": "^32.2.3",
|
|
48
48
|
"@electrovir/color": "^1.7.11",
|
|
49
49
|
"apca-w3": "^0.1.9",
|
|
50
50
|
"lit-css-vars": "^3.6.3",
|
|
51
51
|
"type-fest": "^5.8.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@augment-vir/test": "^32.2.
|
|
54
|
+
"@augment-vir/test": "^32.2.3",
|
|
55
55
|
"@types/apca-w3": "^0.1.3",
|
|
56
56
|
"@web/dev-server-esbuild": "^2.0.0",
|
|
57
57
|
"@web/test-runner": "^1.0.0",
|
|
58
58
|
"@web/test-runner-commands": "^1.0.1",
|
|
59
59
|
"@web/test-runner-playwright": "^1.0.0",
|
|
60
60
|
"@web/test-runner-visual-regression": "^1.0.1",
|
|
61
|
-
"element-book": "^26.17.
|
|
62
|
-
"element-vir": "^26.17.
|
|
63
|
-
"esbuild": "^0.28.
|
|
61
|
+
"element-book": "^26.17.4",
|
|
62
|
+
"element-vir": "^26.17.3",
|
|
63
|
+
"esbuild": "^0.28.2",
|
|
64
64
|
"istanbul-smart-text-reporter": "^1.1.5",
|
|
65
65
|
"markdown-code-example-inserter": "^3.0.6",
|
|
66
66
|
"typedoc": "^0.28.20",
|
|
67
67
|
"typescript": "5.9.3",
|
|
68
|
-
"vira": "^31.
|
|
69
|
-
"vite": "^8.
|
|
68
|
+
"vira": "^31.31.6",
|
|
69
|
+
"vite": "^8.2.2",
|
|
70
70
|
"vite-tsconfig-paths": "^6.1.1"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"element-book": ">=17",
|
|
74
|
-
"element-vir": "
|
|
74
|
+
"element-vir": "^26",
|
|
75
75
|
"vira": ">=28"
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|