theme-vir 28.18.3 → 28.18.4
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { check } from '@augment-vir/assert';
|
|
1
|
+
import { assertWrap, check } from '@augment-vir/assert';
|
|
2
2
|
import { groupArrayBy } from '@augment-vir/common';
|
|
3
3
|
import { VirColorPair } from '@electrovir/color';
|
|
4
4
|
import { BookPageControlType, defineBookPage, definePageControl, } from 'element-book';
|
|
5
|
-
import { css, html, listen, nothing } from 'element-vir';
|
|
5
|
+
import { css, html, listen, nothing, onDomRendered } from 'element-vir';
|
|
6
6
|
import { generateThemeCode } from './color-theme-code.js';
|
|
7
|
+
import { applyColorTheme } from './color-theme.js';
|
|
7
8
|
const noneOverridesSelectionValue = 'None';
|
|
8
9
|
/**
|
|
9
10
|
* Create multiple element-book pages to showcase a theme its overrides (if any).
|
|
@@ -73,7 +74,14 @@ export function createColorThemeBookPages({ parent, title, theme, hideInverseCol
|
|
|
73
74
|
`
|
|
74
75
|
: nothing;
|
|
75
76
|
return html `
|
|
76
|
-
<div
|
|
77
|
+
<div
|
|
78
|
+
class="with-inverse"
|
|
79
|
+
${onDomRendered((element) => {
|
|
80
|
+
applyColorTheme(assertWrap.instanceOf(element, HTMLElement), theme);
|
|
81
|
+
})}
|
|
82
|
+
>
|
|
83
|
+
${normalTemplate}${inverseTemplate}
|
|
84
|
+
</div>
|
|
77
85
|
`;
|
|
78
86
|
}
|
|
79
87
|
function createThemePageExamples(defineExample, defaultTheme, overrides) {
|
|
@@ -144,12 +144,12 @@ export function defineColorTheme(defaultInit, allColorsInit) {
|
|
|
144
144
|
syntax: CssVarSyntaxName.Color,
|
|
145
145
|
};
|
|
146
146
|
accum[names.foregroundInverse] = {
|
|
147
|
-
default: `var(--${names.background}
|
|
147
|
+
default: `var(--${names.background})`,
|
|
148
148
|
initialValue: 'transparent',
|
|
149
149
|
syntax: CssVarSyntaxName.Color,
|
|
150
150
|
};
|
|
151
151
|
accum[names.backgroundInverse] = {
|
|
152
|
-
default: `var(--${names.foreground}
|
|
152
|
+
default: `var(--${names.foreground})`,
|
|
153
153
|
initialValue: 'transparent',
|
|
154
154
|
syntax: CssVarSyntaxName.Color,
|
|
155
155
|
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "theme-vir",
|
|
3
|
-
"version": "28.18.
|
|
3
|
+
"version": "28.18.4",
|
|
4
4
|
"description": "Create an entire web theme.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@augment-vir/assert": "^31.59.0",
|
|
47
47
|
"@augment-vir/common": "^31.59.0",
|
|
48
|
-
"@electrovir/color": "^1.7.
|
|
48
|
+
"@electrovir/color": "^1.7.5",
|
|
49
49
|
"apca-w3": "^0.1.9",
|
|
50
|
-
"lit-css-vars": "^3.2.
|
|
50
|
+
"lit-css-vars": "^3.2.2",
|
|
51
51
|
"type-fest": "^5.4.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"@web/test-runner-commands": "^0.9.0",
|
|
59
59
|
"@web/test-runner-playwright": "^0.11.1",
|
|
60
60
|
"@web/test-runner-visual-regression": "^0.10.0",
|
|
61
|
-
"element-book": "^26.15.
|
|
61
|
+
"element-book": "^26.15.3",
|
|
62
62
|
"element-vir": "^26.14.2",
|
|
63
63
|
"esbuild": "^0.27.2",
|
|
64
64
|
"istanbul-smart-text-reporter": "^1.1.5",
|
|
65
65
|
"markdown-code-example-inserter": "^3.0.3",
|
|
66
66
|
"typedoc": "^0.28.16",
|
|
67
67
|
"typescript": "5.9.3",
|
|
68
|
-
"vira": "^28.19.
|
|
68
|
+
"vira": "^28.19.7",
|
|
69
69
|
"vite": "^7.3.1",
|
|
70
70
|
"vite-tsconfig-paths": "^6.0.4"
|
|
71
71
|
},
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type CSSResult } from 'element-vir';
|
|
2
|
-
import { type ColorThemeColor } from './color-theme.js';
|
|
3
|
-
/**
|
|
4
|
-
* Creates foreground and background CSS code. The foreground color is applied to the CSS `color`
|
|
5
|
-
* property and the background color is applied to the CSS `background-color` property.
|
|
6
|
-
*
|
|
7
|
-
* @category Color Theme
|
|
8
|
-
*/
|
|
9
|
-
export declare function colorCss(color: Readonly<ColorThemeColor>): CSSResult;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { css } from 'element-vir';
|
|
2
|
-
/**
|
|
3
|
-
* Creates foreground and background CSS code. The foreground color is applied to the CSS `color`
|
|
4
|
-
* property and the background color is applied to the CSS `background-color` property.
|
|
5
|
-
*
|
|
6
|
-
* @category Color Theme
|
|
7
|
-
*/
|
|
8
|
-
export function colorCss(color) {
|
|
9
|
-
return css `
|
|
10
|
-
color: ${color.foreground.value};
|
|
11
|
-
background-color: ${color.background.value};
|
|
12
|
-
`;
|
|
13
|
-
}
|