@motion-proto/live-tokens 0.19.1 → 0.20.1
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/dist-plugin/index.cjs +15 -2
- package/dist-plugin/index.js +15 -2
- package/package.json +1 -1
- package/src/editor/component-editor/scaffolding/ComponentFileManager.svelte +1 -7
- package/src/editor/component-editor/scaffolding/VariantGroup.svelte +4 -6
- package/src/editor/component-editor/scaffolding/linkedBlock.ts +4 -1
- package/src/editor/core/components/componentPersist.ts +1 -6
- package/src/editor/core/palettes/tokenRegistry.ts +2 -4
- package/src/editor/core/store/cssVarRef.ts +87 -0
- package/src/editor/core/store/editorStore.ts +2 -3
- package/src/editor/core/store/editorTypes.ts +5 -1
- package/src/editor/core/themes/parsers/colorOpacity.ts +41 -0
- package/src/editor/core/themes/slices/components.ts +2 -23
- package/src/editor/ui/UIPaletteSelector.svelte +7 -11
- package/src/editor/ui/UITokenSelector.svelte +7 -7
- package/src/live-tokens/data/tokens.generated.css +5 -99
- package/src/system/components/Button.svelte +22 -22
- package/src/system/components/Callout.svelte +17 -17
- package/src/system/components/Card.svelte +15 -7
- package/src/system/components/CodeSnippet.svelte +4 -4
- package/src/system/components/Image.svelte +1 -1
- package/src/system/components/ImageLightbox.svelte +1 -1
- package/src/system/components/Table.svelte +12 -12
- package/src/system/components/Tooltip.svelte +2 -2
package/dist-plugin/index.cjs
CHANGED
|
@@ -52,6 +52,14 @@ function extractGlobalRootBody(source) {
|
|
|
52
52
|
return bodies.join("\n");
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
// src/editor/core/themes/parsers/colorOpacity.ts
|
|
56
|
+
var COLOR_OPACITY_RE = /^color-mix\(in srgb,\s*var\((--[a-z0-9-]+)\)\s+(\d+)%,\s*transparent\)$/i;
|
|
57
|
+
function parseColorOpacity(value) {
|
|
58
|
+
const m = value.trim().match(COLOR_OPACITY_RE);
|
|
59
|
+
if (!m) return null;
|
|
60
|
+
return { name: m[1], opacity: parseInt(m[2], 10) };
|
|
61
|
+
}
|
|
62
|
+
|
|
55
63
|
// src/editor/core/storage/files/versionedFileResourceClient.ts
|
|
56
64
|
function sanitizeFileName(name) {
|
|
57
65
|
return name.toLowerCase().trim().replace(/\s+/g, "-").replace(/[^a-z0-9\-_]/g, "").replace(/-+/g, "-").replace(/^-|-$/g, "") || "unnamed";
|
|
@@ -1013,9 +1021,14 @@ function themeFileApi(opts) {
|
|
|
1013
1021
|
}
|
|
1014
1022
|
function extractAliasDeclarations(body) {
|
|
1015
1023
|
const aliases = {};
|
|
1016
|
-
const re = /(--[a-z0-9-]+)\s*:\s*
|
|
1024
|
+
const re = /(--[a-z0-9-]+)\s*:\s*([^;]+);/gi;
|
|
1017
1025
|
let m;
|
|
1018
|
-
while ((m = re.exec(body)) !== null)
|
|
1026
|
+
while ((m = re.exec(body)) !== null) {
|
|
1027
|
+
const value = m[2].trim();
|
|
1028
|
+
const plain = value.match(/^var\((--[a-z0-9-]+)\)$/i);
|
|
1029
|
+
if (plain) aliases[m[1]] = plain[1];
|
|
1030
|
+
else if (parseColorOpacity(value)) aliases[m[1]] = value;
|
|
1031
|
+
}
|
|
1019
1032
|
return aliases;
|
|
1020
1033
|
}
|
|
1021
1034
|
function componentNameFromFile(filePath) {
|
package/dist-plugin/index.js
CHANGED
|
@@ -10,6 +10,14 @@ import {
|
|
|
10
10
|
import fs2 from "fs";
|
|
11
11
|
import path2 from "path";
|
|
12
12
|
|
|
13
|
+
// src/editor/core/themes/parsers/colorOpacity.ts
|
|
14
|
+
var COLOR_OPACITY_RE = /^color-mix\(in srgb,\s*var\((--[a-z0-9-]+)\)\s+(\d+)%,\s*transparent\)$/i;
|
|
15
|
+
function parseColorOpacity(value) {
|
|
16
|
+
const m = value.trim().match(COLOR_OPACITY_RE);
|
|
17
|
+
if (!m) return null;
|
|
18
|
+
return { name: m[1], opacity: parseInt(m[2], 10) };
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
// src/editor/core/storage/files/versionedFileResourceClient.ts
|
|
14
22
|
function sanitizeFileName(name) {
|
|
15
23
|
return name.toLowerCase().trim().replace(/\s+/g, "-").replace(/[^a-z0-9\-_]/g, "").replace(/-+/g, "-").replace(/^-|-$/g, "") || "unnamed";
|
|
@@ -753,9 +761,14 @@ function themeFileApi(opts) {
|
|
|
753
761
|
}
|
|
754
762
|
function extractAliasDeclarations(body) {
|
|
755
763
|
const aliases = {};
|
|
756
|
-
const re = /(--[a-z0-9-]+)\s*:\s*
|
|
764
|
+
const re = /(--[a-z0-9-]+)\s*:\s*([^;]+);/gi;
|
|
757
765
|
let m;
|
|
758
|
-
while ((m = re.exec(body)) !== null)
|
|
766
|
+
while ((m = re.exec(body)) !== null) {
|
|
767
|
+
const value = m[2].trim();
|
|
768
|
+
const plain = value.match(/^var\((--[a-z0-9-]+)\)$/i);
|
|
769
|
+
if (plain) aliases[m[1]] = plain[1];
|
|
770
|
+
else if (parseColorOpacity(value)) aliases[m[1]] = value;
|
|
771
|
+
}
|
|
759
772
|
return aliases;
|
|
760
773
|
}
|
|
761
774
|
function componentNameFromFile(filePath) {
|
package/package.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
import { listManifests, saveAsManifest } from '../../core/manifests/manifestService';
|
|
27
27
|
import type { ManifestMeta } from '../../core/themes/themeTypes';
|
|
28
28
|
import { CURRENT_COMPONENT_SCHEMA_VERSION } from '../../core/themes/migrations';
|
|
29
|
-
import
|
|
29
|
+
import { refToDiskValue } from '../../core/store/cssVarRef';
|
|
30
30
|
import { safeFetch } from '../../core/storage/storage';
|
|
31
31
|
import { API_BASE } from '../../core/storage/apiBase';
|
|
32
32
|
import { flashStatus } from '../../core/flashStatus';
|
|
@@ -126,12 +126,6 @@
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
|
|
129
|
-
function refToDiskValue(ref: CssVarRef): AliasDiskValue {
|
|
130
|
-
if (ref.kind === 'token') return ref.name;
|
|
131
|
-
if (ref.kind === 'literal') return ref.value;
|
|
132
|
-
return { kind: 'gradient', value: ref.value };
|
|
133
|
-
}
|
|
134
|
-
|
|
135
129
|
function currentAliases(): Record<string, AliasDiskValue> {
|
|
136
130
|
const slice = get(editorState).components[component];
|
|
137
131
|
if (!slice) return {};
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { mutate } from '../../core/store/editorStore';
|
|
10
10
|
import { getDeclaredValue } from '../../core/palettes/tokenRegistry';
|
|
11
11
|
import type { CssVarRef } from '../../core/store/editorTypes';
|
|
12
|
+
import { cssStringToRef, refToCss } from '../../core/store/cssVarRef';
|
|
12
13
|
import { getEditorContext } from './editorContext';
|
|
13
14
|
import type { Token, TypeGroupConfig } from './types';
|
|
14
15
|
import type { Sibling } from './siblings';
|
|
@@ -112,9 +113,7 @@
|
|
|
112
113
|
instead of falling back to its own family's default. */
|
|
113
114
|
function declaredToRef(declared: string | null): CssVarRef | null {
|
|
114
115
|
if (!declared) return null;
|
|
115
|
-
|
|
116
|
-
if (m) return { kind: 'token', name: m[1] };
|
|
117
|
-
return { kind: 'literal', value: declared };
|
|
116
|
+
return cssStringToRef(declared.trim());
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
/** Extract a transparency percentage from a `color-mix(in srgb, var(--X) N%, transparent)`
|
|
@@ -179,9 +178,8 @@
|
|
|
179
178
|
const effectiveValue = (varName: string): string | null => {
|
|
180
179
|
const ref = slice.aliases[varName];
|
|
181
180
|
if (!ref) return getDeclaredValue(varName);
|
|
182
|
-
if (ref.kind === '
|
|
183
|
-
|
|
184
|
-
return null;
|
|
181
|
+
if (ref.kind === 'gradient') return null;
|
|
182
|
+
return refToCss(ref);
|
|
185
183
|
};
|
|
186
184
|
|
|
187
185
|
const apply = (srcVar: string, dstVar: string) => {
|
|
@@ -5,11 +5,14 @@ import {
|
|
|
5
5
|
editorState,
|
|
6
6
|
} from '../../core/store/editorStore';
|
|
7
7
|
import type { CssVarRef } from '../../core/store/editorTypes';
|
|
8
|
+
import { refToCss } from '../../core/store/cssVarRef';
|
|
8
9
|
import type { Token } from './types';
|
|
9
10
|
|
|
11
|
+
/** Stable per-ref identity key: refs that render to the same CSS share a key,
|
|
12
|
+
* so siblings with equal values bucket together regardless of ref kind. */
|
|
10
13
|
function aliasKey(ref: CssVarRef | undefined): string {
|
|
11
14
|
if (!ref) return '';
|
|
12
|
-
return ref
|
|
15
|
+
return refToCss(ref);
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
const TYPOGRAPHY_PROP_SUFFIXES = ['font-family', 'font-size', 'font-weight', 'line-height'] as const;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { get } from 'svelte/store';
|
|
2
2
|
import type { AliasDiskValue, ComponentConfig } from '../themes/themeTypes';
|
|
3
3
|
import { editorState, markComponentSaved } from '../store/editorStore';
|
|
4
|
-
import
|
|
4
|
+
import { refToDiskValue } from '../store/cssVarRef';
|
|
5
5
|
import { CURRENT_COMPONENT_SCHEMA_VERSION } from '../themes/migrations';
|
|
6
6
|
import {
|
|
7
7
|
listComponentConfigs,
|
|
@@ -24,11 +24,6 @@ export type SaveActiveComponentResult =
|
|
|
24
24
|
| { ok: true; fileName: string; displayName: string }
|
|
25
25
|
| { ok: false; reason: 'default' | 'no-state' | 'error'; error?: unknown };
|
|
26
26
|
|
|
27
|
-
function refToDiskValue(ref: CssVarRef): AliasDiskValue {
|
|
28
|
-
if (ref.kind === 'token') return ref.name;
|
|
29
|
-
if (ref.kind === 'literal') return ref.value;
|
|
30
|
-
return { kind: 'gradient', value: ref.value };
|
|
31
|
-
}
|
|
32
27
|
|
|
33
28
|
export async function saveActiveComponentConfig(
|
|
34
29
|
component: string,
|
|
@@ -23,7 +23,7 @@ import tokensCss from '../../../system/styles/tokens.css?raw';
|
|
|
23
23
|
import { editorState } from '../store/editorStore';
|
|
24
24
|
import type { EditorState } from '../store/editorTypes';
|
|
25
25
|
import { extractGlobalRootBody } from '../themes/parsers/globalRootBlock';
|
|
26
|
-
import {
|
|
26
|
+
import { refToCss } from '../store/cssVarRef';
|
|
27
27
|
|
|
28
28
|
// Re-exported for tests and downstream consumers that previously imported it
|
|
29
29
|
// from this module. The canonical implementation lives in `./parsers/globalRootBlock`
|
|
@@ -112,9 +112,7 @@ function buildOverlayRegistry(
|
|
|
112
112
|
const overrides = new Map<string, string>();
|
|
113
113
|
for (const slice of Object.values(components)) {
|
|
114
114
|
for (const [varName, ref] of Object.entries(slice.aliases)) {
|
|
115
|
-
|
|
116
|
-
else if (ref.kind === 'literal') overrides.set(varName, ref.value);
|
|
117
|
-
else overrides.set(varName, formatGradientValue(ref.value));
|
|
115
|
+
overrides.set(varName, refToCss(ref));
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
const getDeclared = (v: string): string | null =>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single classifier + renderer for `CssVarRef`. Every place that turns a
|
|
3
|
+
* CSS value string into a ref, or a ref back into CSS, routes through here so
|
|
4
|
+
* the three ref kinds (`token`, `literal`, `gradient`) are interpreted
|
|
5
|
+
* identically across the disk loader, the live-edit path, the registry, and the
|
|
6
|
+
* component renderer.
|
|
7
|
+
*
|
|
8
|
+
* A `token` may carry an optional `opacity` (a colour below 100%). Opacity
|
|
9
|
+
* serialization is delegated to `parsers/colorOpacity`, the one place that knows
|
|
10
|
+
* the `color-mix(in srgb, var(--token) NN%, transparent)` shape.
|
|
11
|
+
*/
|
|
12
|
+
import type { CssVarRef } from './editorTypes';
|
|
13
|
+
import type { AliasDiskValue } from '../themes/themeTypes';
|
|
14
|
+
import { formatGradientValue } from '../themes/slices/gradients';
|
|
15
|
+
import { formatColorOpacity, parseColorOpacity } from '../themes/parsers/colorOpacity';
|
|
16
|
+
|
|
17
|
+
/** True when a token carries a non-trivial opacity (a colour below 100%). */
|
|
18
|
+
function hasOpacity(opacity: number | undefined): opacity is number {
|
|
19
|
+
return opacity != null && opacity < 100;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Render a ref to the CSS value string written to a custom property. */
|
|
23
|
+
export function refToCss(ref: CssVarRef): string {
|
|
24
|
+
switch (ref.kind) {
|
|
25
|
+
case 'token':
|
|
26
|
+
return hasOpacity(ref.opacity) ? formatColorOpacity(ref.name, ref.opacity) : `var(${ref.name})`;
|
|
27
|
+
case 'literal':
|
|
28
|
+
return ref.value;
|
|
29
|
+
case 'gradient':
|
|
30
|
+
return formatGradientValue(ref.value);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Classify a CSS value string into a ref. Accepts a bare token name (`--x`,
|
|
36
|
+
* the disk convention), a wrapped alias (`var(--x)`, the declared-value form),
|
|
37
|
+
* a colour-opacity expression, or anything else (a raw literal). Never produces
|
|
38
|
+
* a gradient — gradients are stored as structured objects, not strings.
|
|
39
|
+
*/
|
|
40
|
+
export function cssStringToRef(value: string): CssVarRef {
|
|
41
|
+
const op = parseColorOpacity(value);
|
|
42
|
+
if (op) return { kind: 'token', name: op.name, opacity: op.opacity };
|
|
43
|
+
if (value.startsWith('--')) return { kind: 'token', name: value };
|
|
44
|
+
const wrapped = value.match(/^var\((--[a-z0-9-]+)\)$/);
|
|
45
|
+
if (wrapped) return { kind: 'token', name: wrapped[1] };
|
|
46
|
+
return { kind: 'literal', value };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Serialize a ref to its on-disk `AliasDiskValue`. Mirrors `refToCss` except a
|
|
51
|
+
* token is stored as its bare name (`--x`, not `var(--x)`) — the editor's disk
|
|
52
|
+
* convention — and a gradient is a structured object rather than a CSS string.
|
|
53
|
+
*/
|
|
54
|
+
export function refToDiskValue(ref: CssVarRef): AliasDiskValue {
|
|
55
|
+
switch (ref.kind) {
|
|
56
|
+
case 'token':
|
|
57
|
+
return hasOpacity(ref.opacity) ? formatColorOpacity(ref.name, ref.opacity) : ref.name;
|
|
58
|
+
case 'literal':
|
|
59
|
+
return ref.value;
|
|
60
|
+
case 'gradient':
|
|
61
|
+
return { kind: 'gradient', value: ref.value };
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Structural equality across all ref kinds. */
|
|
66
|
+
export function cssVarRefEqual(a: CssVarRef | undefined, b: CssVarRef | undefined): boolean {
|
|
67
|
+
if (!a || !b) return a === b;
|
|
68
|
+
if (a.kind !== b.kind) return false;
|
|
69
|
+
if (a.kind === 'token') {
|
|
70
|
+
const bt = b as { kind: 'token'; name: string; opacity?: number };
|
|
71
|
+
return a.name === bt.name && (a.opacity ?? 100) === (bt.opacity ?? 100);
|
|
72
|
+
}
|
|
73
|
+
if (a.kind === 'literal') return a.value === (b as { kind: 'literal'; value: string }).value;
|
|
74
|
+
const av = a.value;
|
|
75
|
+
const bv = (b as { kind: 'gradient'; value: typeof a.value }).value;
|
|
76
|
+
if (av.type !== bv.type || av.angle !== bv.angle || av.stops.length !== bv.stops.length) return false;
|
|
77
|
+
if ((av.aspectX ?? 1) !== (bv.aspectX ?? 1)) return false;
|
|
78
|
+
if ((av.aspectY ?? 1) !== (bv.aspectY ?? 1)) return false;
|
|
79
|
+
for (let i = 0; i < av.stops.length; i++) {
|
|
80
|
+
const sa = av.stops[i];
|
|
81
|
+
const sb = bv.stops[i];
|
|
82
|
+
if (sa.position !== sb.position || sa.color !== sb.color || (sa.opacity ?? 100) !== (sb.opacity ?? 100)) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
import type { CssVarRef, EditorState, GradientAliasValue } from './editorTypes';
|
|
22
22
|
import type { AliasDiskValue, Theme } from '../themes/themeTypes';
|
|
23
23
|
import { KNOWN_COMPONENT_CONFIG_KEYS } from '../components/componentConfigKeys';
|
|
24
|
+
import { cssStringToRef } from './cssVarRef';
|
|
24
25
|
import {
|
|
25
26
|
CURRENT_THEME_SCHEMA_VERSION,
|
|
26
27
|
CURRENT_COMPONENT_SCHEMA_VERSION,
|
|
@@ -421,9 +422,7 @@ function splitAliasesAndConfig(
|
|
|
421
422
|
if (config[key] === undefined) config[key] = value;
|
|
422
423
|
continue;
|
|
423
424
|
}
|
|
424
|
-
aliases[key] = value
|
|
425
|
-
? { kind: 'token', name: value }
|
|
426
|
-
: { kind: 'literal', value };
|
|
425
|
+
aliases[key] = cssStringToRef(value);
|
|
427
426
|
}
|
|
428
427
|
return { aliases, config };
|
|
429
428
|
}
|
|
@@ -100,7 +100,11 @@ export interface GradientAliasValue {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
export type CssVarRef =
|
|
103
|
-
|
|
103
|
+
/** An alias to a design token. `opacity` is an optional integer percent set
|
|
104
|
+
* only for a colour carried below 100% (serializes to
|
|
105
|
+
* `color-mix(in srgb, var(name) opacity%, transparent)`); absent means fully
|
|
106
|
+
* opaque, which also covers every non-colour alias (radius, spacing, font). */
|
|
107
|
+
| { kind: 'token'; name: string; opacity?: number }
|
|
104
108
|
| { kind: 'literal'; value: string }
|
|
105
109
|
| { kind: 'gradient'; value: GradientAliasValue };
|
|
106
110
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single source of truth for a design-token colour carried at reduced
|
|
3
|
+
* opacity. A colour token below 100% opacity serializes as:
|
|
4
|
+
*
|
|
5
|
+
* color-mix(in srgb, var(--token) NN%, transparent)
|
|
6
|
+
*
|
|
7
|
+
* 100% opacity is NOT represented here — a fully opaque colour collapses to a
|
|
8
|
+
* plain `var(--token)` alias (`CssVarRef` kind `'token'`). Everything that
|
|
9
|
+
* reads, writes, or validates this form must go through `parseColorOpacity` /
|
|
10
|
+
* `formatColorOpacity` so the canonical shape lives in exactly one place.
|
|
11
|
+
*
|
|
12
|
+
* This module is intentionally dependency-free so the dev-server vite plugin
|
|
13
|
+
* (a separate build) can import it the same way it imports `globalRootBlock`.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** `opacity` is an integer percentage in [0, 100). */
|
|
17
|
+
export interface ColorOpacity {
|
|
18
|
+
/** The design-token name, e.g. `--surface-neutral-lower`. */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Integer percentage, 0–99 (100 is not an opacity colour — it's a token). */
|
|
21
|
+
opacity: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const COLOR_OPACITY_RE =
|
|
25
|
+
/^color-mix\(in srgb,\s*var\((--[a-z0-9-]+)\)\s+(\d+)%,\s*transparent\)$/i;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Parse a `color-mix(in srgb, var(--token) NN%, transparent)` string into its
|
|
29
|
+
* token name and integer opacity. Returns null for any other value (plain
|
|
30
|
+
* aliases, raw literals, gradients).
|
|
31
|
+
*/
|
|
32
|
+
export function parseColorOpacity(value: string): ColorOpacity | null {
|
|
33
|
+
const m = value.trim().match(COLOR_OPACITY_RE);
|
|
34
|
+
if (!m) return null;
|
|
35
|
+
return { name: m[1], opacity: parseInt(m[2], 10) };
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** Serialize a token + integer opacity back to the canonical color-mix string. */
|
|
39
|
+
export function formatColorOpacity(name: string, opacity: number): string {
|
|
40
|
+
return `color-mix(in srgb, var(${name}) ${opacity}%, transparent)`;
|
|
41
|
+
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
import { writable, derived, get, type Readable } from 'svelte/store';
|
|
33
33
|
import type { CssVarRef, EditorState } from '../../store/editorTypes';
|
|
34
34
|
import { store, mutate } from '../../store/editorCore';
|
|
35
|
-
import {
|
|
35
|
+
import { refToCss, cssVarRefEqual } from '../../store/cssVarRef';
|
|
36
36
|
import { CASCADING_COMPONENT_CONFIG_KEYS } from '../../components/componentConfigKeys';
|
|
37
37
|
|
|
38
38
|
const EMPTY_COMPONENT_BASELINE = JSON.stringify({ aliases: {}, config: {} });
|
|
@@ -45,9 +45,7 @@ export function componentsToVars(components: EditorState['components']): Record<
|
|
|
45
45
|
const out: Record<string, string> = {};
|
|
46
46
|
for (const slice of Object.values(components)) {
|
|
47
47
|
for (const [varName, ref] of Object.entries(slice.aliases)) {
|
|
48
|
-
|
|
49
|
-
else if (ref.kind === 'literal') out[varName] = ref.value;
|
|
50
|
-
else out[varName] = formatGradientValue(ref.value);
|
|
48
|
+
out[varName] = refToCss(ref);
|
|
51
49
|
}
|
|
52
50
|
for (const [key, value] of Object.entries(slice.config)) {
|
|
53
51
|
if (CASCADING_COMPONENT_CONFIG_KEYS.has(key) && typeof value === 'string') {
|
|
@@ -248,25 +246,6 @@ export function getComponentPropertySiblings(component: string, varName: string)
|
|
|
248
246
|
return siblings;
|
|
249
247
|
}
|
|
250
248
|
|
|
251
|
-
function cssVarRefEqual(a: CssVarRef | undefined, b: CssVarRef | undefined): boolean {
|
|
252
|
-
if (!a || !b) return a === b;
|
|
253
|
-
if (a.kind !== b.kind) return false;
|
|
254
|
-
if (a.kind === 'token') return a.name === (b as { kind: 'token'; name: string }).name;
|
|
255
|
-
if (a.kind === 'literal') return a.value === (b as { kind: 'literal'; value: string }).value;
|
|
256
|
-
// gradient: structural compare on type, angle, aspect axes, and stops.
|
|
257
|
-
const av = a.value;
|
|
258
|
-
const bv = (b as { kind: 'gradient'; value: typeof a.value }).value;
|
|
259
|
-
if (av.type !== bv.type || av.angle !== bv.angle || av.stops.length !== bv.stops.length) return false;
|
|
260
|
-
if ((av.aspectX ?? 1) !== (bv.aspectX ?? 1)) return false;
|
|
261
|
-
if ((av.aspectY ?? 1) !== (bv.aspectY ?? 1)) return false;
|
|
262
|
-
for (let i = 0; i < av.stops.length; i++) {
|
|
263
|
-
const sa = av.stops[i];
|
|
264
|
-
const sb = bv.stops[i];
|
|
265
|
-
if (sa.position !== sb.position || sa.color !== sb.color || (sa.opacity ?? 100) !== (sb.opacity ?? 100)) return false;
|
|
266
|
-
}
|
|
267
|
-
return true;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
249
|
/** True iff `varName` is not individually opted out, has ≥2 declared siblings,
|
|
271
250
|
* and the linked siblings agree — either all sharing the same explicit alias,
|
|
272
251
|
* or all having no override (linked at the upstream default). */
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { resolveAliasChain } from '../core/palettes/tokenRegistry';
|
|
7
7
|
import { editorState } from '../core/store/editorStore';
|
|
8
8
|
import { formatGradientStops } from '../core/themes/slices/gradients';
|
|
9
|
+
import { formatColorOpacity, parseColorOpacity } from '../core/themes/parsers/colorOpacity';
|
|
9
10
|
import type { GradientToken } from '../core/store/editorTypes';
|
|
10
11
|
import UITokenSelector from './UITokenSelector.svelte';
|
|
11
12
|
|
|
@@ -249,24 +250,19 @@
|
|
|
249
250
|
return null;
|
|
250
251
|
}
|
|
251
252
|
|
|
252
|
-
function parseOpacity(raw: string): { inner: string; opacity: number } | null {
|
|
253
|
-
const m = raw.match(/^color-mix\(in srgb,\s*(var\(--[a-z0-9-]+\))\s+(\d+)%,\s*transparent\)$/);
|
|
254
|
-
if (!m) return null;
|
|
255
|
-
return { inner: m[1], opacity: parseInt(m[2]) };
|
|
256
|
-
}
|
|
257
|
-
|
|
258
253
|
function parseStatic(raw: string): { name: 'white' | 'black'; opacity: number } | null {
|
|
259
254
|
const direct = raw.match(/^var\(--color-(white|black)\)$/);
|
|
260
255
|
if (direct) return { name: direct[1] as 'white' | 'black', opacity: 100 };
|
|
261
|
-
const
|
|
262
|
-
|
|
256
|
+
const op = parseColorOpacity(raw);
|
|
257
|
+
const m = op?.name.match(/^--color-(white|black)$/);
|
|
258
|
+
if (op && m) return { name: m[1] as 'white' | 'black', opacity: op.opacity };
|
|
263
259
|
return null;
|
|
264
260
|
}
|
|
265
261
|
|
|
266
262
|
function buildValue(varName: string): string | null {
|
|
267
263
|
if (varName === variable && opacity >= 100) return null;
|
|
268
264
|
if (opacity >= 100) return varName;
|
|
269
|
-
return
|
|
265
|
+
return formatColorOpacity(varName, opacity);
|
|
270
266
|
}
|
|
271
267
|
|
|
272
268
|
function applyOpacity() {
|
|
@@ -399,9 +395,9 @@
|
|
|
399
395
|
}
|
|
400
396
|
chosenStatic = null;
|
|
401
397
|
|
|
402
|
-
const opacityParsed =
|
|
398
|
+
const opacityParsed = parseColorOpacity(raw);
|
|
403
399
|
if (opacityParsed) {
|
|
404
|
-
const parsed = parseRef(opacityParsed.
|
|
400
|
+
const parsed = parseRef(`var(${opacityParsed.name})`);
|
|
405
401
|
if (parsed) {
|
|
406
402
|
chosenCategory = parsed.category;
|
|
407
403
|
chosenFamily = parsed.family;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type { Snippet } from 'svelte';
|
|
4
4
|
import { setCssVar, removeCssVar, CSS_VAR_CHANGE_EVENT } from '../core/cssVarSync';
|
|
5
5
|
import type { CssVarRef } from '../core/store/editorTypes';
|
|
6
|
+
import { cssStringToRef } from '../core/store/cssVarRef';
|
|
6
7
|
import {
|
|
7
8
|
editorState,
|
|
8
9
|
setComponentAlias,
|
|
@@ -116,14 +117,13 @@
|
|
|
116
117
|
if (component) {
|
|
117
118
|
const useLinked = isLinkedDisplay;
|
|
118
119
|
if (semanticName) {
|
|
119
|
-
//
|
|
120
|
-
// (rendered as `var(name)`);
|
|
121
|
-
// `
|
|
122
|
-
//
|
|
120
|
+
// Same classifier as the disk loader (cssStringToRef): a `--…`
|
|
121
|
+
// reference becomes a token (rendered as `var(name)`); a
|
|
122
|
+
// `color-mix(... var(--token) NN%, transparent)` becomes a colour ref;
|
|
123
|
+
// anything else (`transparent`, a materialized gradient) is a literal
|
|
124
|
+
// emitted as-is. Storing complex CSS as a token would render
|
|
123
125
|
// `var(color-mix(...))`, which is invalid and breaks the preview.
|
|
124
|
-
const ref: CssVarRef = semanticName
|
|
125
|
-
? { kind: 'token', name: semanticName }
|
|
126
|
-
: { kind: 'literal', value: semanticName };
|
|
126
|
+
const ref: CssVarRef = cssStringToRef(semanticName);
|
|
127
127
|
if (useLinked) setComponentAliasLinked(component, variable, ref);
|
|
128
128
|
else setComponentAlias(component, variable, ref);
|
|
129
129
|
} else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* Generated by themeFileApi from the production theme and component configs. Do not edit. */
|
|
2
2
|
/* tokens.css holds developer-authored defaults; this file holds editor overrides. */
|
|
3
3
|
|
|
4
|
-
/* Production theme:
|
|
4
|
+
/* Production theme: default */
|
|
5
5
|
:root:root {
|
|
6
6
|
--gradient-1: linear-gradient(90deg, var(--color-brand-500) 0%, var(--color-accent-500) 100%);
|
|
7
7
|
--gradient-2: linear-gradient(135deg, var(--color-brand-500) 0%, var(--color-special-500) 100%);
|
|
@@ -54,10 +54,6 @@
|
|
|
54
54
|
--dialog-secondary-hover-border-width: var(--border-width-1);
|
|
55
55
|
--dialog-secondary-hover-radius: var(--radius-md);
|
|
56
56
|
--dialog-secondary-hover-padding: var(--space-8);
|
|
57
|
-
--columns-count: 12;
|
|
58
|
-
--columns-max-width: 1440px;
|
|
59
|
-
--columns-gutter: 32px;
|
|
60
|
-
--columns-margin: 0px;
|
|
61
57
|
--overlay-low: color-mix(in srgb, var(--surface-neutral-lowest) 38%, transparent);
|
|
62
58
|
--overlay: color-mix(in srgb, var(--surface-neutral-lowest) 51%, transparent);
|
|
63
59
|
--overlay-high: color-mix(in srgb, var(--surface-neutral-lowest) 64%, transparent);
|
|
@@ -69,6 +65,10 @@
|
|
|
69
65
|
--shadow-lg: 5px 5px 9px 0px hsla(237, 18%, 3%, 0.9);
|
|
70
66
|
--shadow-xl: 6px 7px 13px 0px hsla(237, 18%, 3%, 0.9);
|
|
71
67
|
--shadow-2xl: 8px 9px 16px 0px hsla(237, 18%, 3%, 0.9);
|
|
68
|
+
--columns-count: 12;
|
|
69
|
+
--columns-max-width: 1440px;
|
|
70
|
+
--columns-gutter: 32px;
|
|
71
|
+
--columns-margin: 0px;
|
|
72
72
|
--color-neutral-100: #dde6ec;
|
|
73
73
|
--color-neutral-200: #c4cdd3;
|
|
74
74
|
--color-neutral-300: #a8b1b7;
|
|
@@ -356,97 +356,3 @@
|
|
|
356
356
|
--font-serif: "GFS Didot", serif;
|
|
357
357
|
--font-mono: "fira-code", ui-monospace, "SF Mono", Menlo, Consolas, monospace, monospace;
|
|
358
358
|
}
|
|
359
|
-
|
|
360
|
-
/* Component aliases (production configs differing from defaults) */
|
|
361
|
-
:root:root {
|
|
362
|
-
/* button (my-button) */
|
|
363
|
-
--button-primary-text-font-size: var(--font-size-md);
|
|
364
|
-
--button-primary-text-font-weight: var(--font-weight-semibold);
|
|
365
|
-
--button-primary-radius: var(--radius-xl);
|
|
366
|
-
--button-secondary-text-font-size: var(--font-size-md);
|
|
367
|
-
--button-secondary-text-font-weight: var(--font-weight-semibold);
|
|
368
|
-
--button-secondary-radius: var(--radius-xl);
|
|
369
|
-
--button-outline-text-font-size: var(--font-size-md);
|
|
370
|
-
--button-outline-text-font-weight: var(--font-weight-semibold);
|
|
371
|
-
--button-outline-radius: var(--radius-xl);
|
|
372
|
-
--button-success-text-font-size: var(--font-size-md);
|
|
373
|
-
--button-success-text-font-weight: var(--font-weight-semibold);
|
|
374
|
-
--button-success-border-width: var(--border-width-1);
|
|
375
|
-
--button-success-radius: var(--radius-xl);
|
|
376
|
-
--button-danger-text-font-size: var(--font-size-md);
|
|
377
|
-
--button-danger-text-font-weight: var(--font-weight-semibold);
|
|
378
|
-
--button-danger-border-width: var(--border-width-1);
|
|
379
|
-
--button-danger-radius: var(--radius-xl);
|
|
380
|
-
--button-warning-text-font-size: var(--font-size-md);
|
|
381
|
-
--button-warning-text-font-weight: var(--font-weight-semibold);
|
|
382
|
-
--button-warning-border-width: var(--border-width-1);
|
|
383
|
-
--button-warning-radius: var(--radius-xl);
|
|
384
|
-
--button-small-text-font-size: var(--font-size-sm);
|
|
385
|
-
|
|
386
|
-
/* callout (my-callout) */
|
|
387
|
-
--callout-info-border: var(--border-info-medium);
|
|
388
|
-
--callout-info-label-font-family: var(--font-sans);
|
|
389
|
-
--callout-info-label-font-size: var(--font-size-lg);
|
|
390
|
-
--callout-info-text-font-family: var(--font-sans);
|
|
391
|
-
--callout-info-text-font-size: var(--font-size-lg);
|
|
392
|
-
--callout-success-label-font-family: var(--font-sans);
|
|
393
|
-
--callout-success-label-font-size: var(--font-size-lg);
|
|
394
|
-
--callout-success-text-font-family: var(--font-sans);
|
|
395
|
-
--callout-success-text-font-size: var(--font-size-lg);
|
|
396
|
-
--callout-warning-label-font-family: var(--font-sans);
|
|
397
|
-
--callout-warning-label-font-size: var(--font-size-lg);
|
|
398
|
-
--callout-warning-text-font-family: var(--font-sans);
|
|
399
|
-
--callout-warning-text-font-size: var(--font-size-lg);
|
|
400
|
-
--callout-danger-label-font-family: var(--font-sans);
|
|
401
|
-
--callout-danger-label-font-size: var(--font-size-lg);
|
|
402
|
-
--callout-danger-text-font-family: var(--font-sans);
|
|
403
|
-
--callout-danger-text-font-size: var(--font-size-lg);
|
|
404
|
-
|
|
405
|
-
/* card (my-card) */
|
|
406
|
-
--card-default-surface: color-mix(in srgb, var(--surface-neutral-lower) 70%, transparent);
|
|
407
|
-
--card-default-header-surface: color-mix(in srgb, var(--surface-neutral-lowest) 80%, transparent);
|
|
408
|
-
--card-default-title-font-size: var(--font-size-2xl);
|
|
409
|
-
--card-default-title-font-weight: var(--font-weight-medium);
|
|
410
|
-
--card-default-title-line-height: var(--line-height-md);
|
|
411
|
-
--card-default-icon-size: var(--icon-size-2xl);
|
|
412
|
-
--card-default-body-font-size: var(--font-size-xl);
|
|
413
|
-
--card-default-header-padding-top: var(--space-12);
|
|
414
|
-
--card-default-header-padding-right: var(--space-20);
|
|
415
|
-
--card-default-header-padding-bottom: var(--space-12);
|
|
416
|
-
--card-default-header-padding-left: var(--space-20);
|
|
417
|
-
--card-default-body-padding-top: var(--space-16);
|
|
418
|
-
--card-default-body-padding-right: var(--space-20);
|
|
419
|
-
--card-default-body-padding-bottom: var(--space-16);
|
|
420
|
-
--card-default-body-padding-left: var(--space-20);
|
|
421
|
-
|
|
422
|
-
/* codesnippet (my-code-snippet) */
|
|
423
|
-
--codesnippet-surface: color-mix(in srgb, var(--surface-neutral-lowest) 76%, transparent);
|
|
424
|
-
--codesnippet-border: var(--border-neutral);
|
|
425
|
-
--codesnippet-code-text: var(--text-brand-secondary);
|
|
426
|
-
--codesnippet-code-font-size: var(--font-size-md);
|
|
427
|
-
|
|
428
|
-
/* image (my-image) */
|
|
429
|
-
--image-default-radius: var(--radius-2xl);
|
|
430
|
-
|
|
431
|
-
/* imagelightbox (my-image-lightbox) */
|
|
432
|
-
--imagelightbox-tile-border: transparent;
|
|
433
|
-
--imagelightbox-overlay-surface: color-mix(in srgb, var(--color-neutral-950) 76%, transparent);
|
|
434
|
-
|
|
435
|
-
/* table (my-table) */
|
|
436
|
-
--table-default-surface: color-mix(in srgb, var(--surface-neutral-lower) 57%, transparent);
|
|
437
|
-
--table-default-border: var(--border-neutral);
|
|
438
|
-
--table-default-border-width: var(--border-width-2);
|
|
439
|
-
--table-default-header-surface: var(--surface-neutral-lowest);
|
|
440
|
-
--table-default-header-font-size: var(--font-size-lg);
|
|
441
|
-
--table-default-header-font-weight: var(--font-weight-semibold);
|
|
442
|
-
--table-default-header-border: var(--border-neutral);
|
|
443
|
-
--table-default-cell-font-size: var(--font-size-md);
|
|
444
|
-
--table-default-cell-font-weight: var(--font-weight-medium);
|
|
445
|
-
--table-default-row-divider: var(--border-neutral-subtle);
|
|
446
|
-
--table-default-column-divider: var(--border-neutral-faint);
|
|
447
|
-
--table-default-column-divider-width: var(--border-width-1);
|
|
448
|
-
|
|
449
|
-
/* tooltip (my-tooltip) */
|
|
450
|
-
--tooltip-surface: color-mix(in srgb, var(--surface-canvas-lowest) 75%, transparent);
|
|
451
|
-
--tooltip-border-width: var(--border-width-1);
|
|
452
|
-
}
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
--button-primary-surface: var(--surface-brand-high);
|
|
78
78
|
--button-primary-text: var(--text-primary);
|
|
79
79
|
--button-primary-text-font-family: var(--font-sans);
|
|
80
|
-
--button-primary-text-font-size: var(--font-size-
|
|
81
|
-
--button-primary-text-font-weight: var(--font-weight-
|
|
80
|
+
--button-primary-text-font-size: var(--font-size-md);
|
|
81
|
+
--button-primary-text-font-weight: var(--font-weight-semibold);
|
|
82
82
|
--button-primary-text-line-height: var(--line-height-sm);
|
|
83
83
|
--button-primary-border: var(--border-brand);
|
|
84
84
|
--button-primary-border-width: var(--border-width-1);
|
|
85
|
-
--button-primary-radius: var(--radius-
|
|
85
|
+
--button-primary-radius: var(--radius-xl);
|
|
86
86
|
--button-primary-padding: var(--space-8);
|
|
87
87
|
--button-primary-hover-surface: var(--surface-brand-higher);
|
|
88
88
|
--button-primary-hover-text: var(--text-primary);
|
|
@@ -96,12 +96,12 @@
|
|
|
96
96
|
--button-secondary-surface: var(--surface-neutral-high);
|
|
97
97
|
--button-secondary-text: var(--text-primary);
|
|
98
98
|
--button-secondary-text-font-family: var(--font-sans);
|
|
99
|
-
--button-secondary-text-font-size: var(--font-size-
|
|
100
|
-
--button-secondary-text-font-weight: var(--font-weight-
|
|
99
|
+
--button-secondary-text-font-size: var(--font-size-md);
|
|
100
|
+
--button-secondary-text-font-weight: var(--font-weight-semibold);
|
|
101
101
|
--button-secondary-text-line-height: var(--line-height-sm);
|
|
102
102
|
--button-secondary-border: var(--border-neutral);
|
|
103
103
|
--button-secondary-border-width: var(--border-width-1);
|
|
104
|
-
--button-secondary-radius: var(--radius-
|
|
104
|
+
--button-secondary-radius: var(--radius-xl);
|
|
105
105
|
--button-secondary-padding: var(--space-8);
|
|
106
106
|
--button-secondary-hover-surface: var(--surface-neutral-higher);
|
|
107
107
|
--button-secondary-hover-text: var(--text-primary);
|
|
@@ -115,12 +115,12 @@
|
|
|
115
115
|
--button-outline-surface: var(--color-transparent);
|
|
116
116
|
--button-outline-text: var(--text-primary);
|
|
117
117
|
--button-outline-text-font-family: var(--font-sans);
|
|
118
|
-
--button-outline-text-font-size: var(--font-size-
|
|
119
|
-
--button-outline-text-font-weight: var(--font-weight-
|
|
118
|
+
--button-outline-text-font-size: var(--font-size-md);
|
|
119
|
+
--button-outline-text-font-weight: var(--font-weight-semibold);
|
|
120
120
|
--button-outline-text-line-height: var(--line-height-sm);
|
|
121
121
|
--button-outline-border: var(--border-neutral);
|
|
122
122
|
--button-outline-border-width: var(--border-width-1);
|
|
123
|
-
--button-outline-radius: var(--radius-
|
|
123
|
+
--button-outline-radius: var(--radius-xl);
|
|
124
124
|
--button-outline-padding: var(--space-8);
|
|
125
125
|
--button-outline-hover-surface: var(--surface-neutral-lower);
|
|
126
126
|
--button-outline-hover-text: var(--text-primary);
|
|
@@ -135,12 +135,12 @@
|
|
|
135
135
|
--button-success-surface: var(--surface-success-low);
|
|
136
136
|
--button-success-text: var(--text-success);
|
|
137
137
|
--button-success-text-font-family: var(--font-sans);
|
|
138
|
-
--button-success-text-font-size: var(--font-size-
|
|
139
|
-
--button-success-text-font-weight: var(--font-weight-
|
|
138
|
+
--button-success-text-font-size: var(--font-size-md);
|
|
139
|
+
--button-success-text-font-weight: var(--font-weight-semibold);
|
|
140
140
|
--button-success-text-line-height: var(--line-height-sm);
|
|
141
141
|
--button-success-border: var(--border-success);
|
|
142
|
-
--button-success-border-width: var(--border-width-
|
|
143
|
-
--button-success-radius: var(--radius-
|
|
142
|
+
--button-success-border-width: var(--border-width-1);
|
|
143
|
+
--button-success-radius: var(--radius-xl);
|
|
144
144
|
--button-success-padding: var(--space-8);
|
|
145
145
|
--button-success-hover-surface: var(--surface-success-higher);
|
|
146
146
|
--button-success-hover-text: var(--text-primary);
|
|
@@ -154,12 +154,12 @@
|
|
|
154
154
|
--button-danger-surface: var(--surface-danger-low);
|
|
155
155
|
--button-danger-text: var(--text-danger);
|
|
156
156
|
--button-danger-text-font-family: var(--font-sans);
|
|
157
|
-
--button-danger-text-font-size: var(--font-size-
|
|
158
|
-
--button-danger-text-font-weight: var(--font-weight-
|
|
157
|
+
--button-danger-text-font-size: var(--font-size-md);
|
|
158
|
+
--button-danger-text-font-weight: var(--font-weight-semibold);
|
|
159
159
|
--button-danger-text-line-height: var(--line-height-sm);
|
|
160
160
|
--button-danger-border: var(--border-danger);
|
|
161
|
-
--button-danger-border-width: var(--border-width-
|
|
162
|
-
--button-danger-radius: var(--radius-
|
|
161
|
+
--button-danger-border-width: var(--border-width-1);
|
|
162
|
+
--button-danger-radius: var(--radius-xl);
|
|
163
163
|
--button-danger-padding: var(--space-8);
|
|
164
164
|
--button-danger-hover-surface: var(--surface-danger-high);
|
|
165
165
|
--button-danger-hover-text: var(--text-primary);
|
|
@@ -173,12 +173,12 @@
|
|
|
173
173
|
--button-warning-surface: var(--surface-warning-low);
|
|
174
174
|
--button-warning-text: var(--text-warning);
|
|
175
175
|
--button-warning-text-font-family: var(--font-sans);
|
|
176
|
-
--button-warning-text-font-size: var(--font-size-
|
|
177
|
-
--button-warning-text-font-weight: var(--font-weight-
|
|
176
|
+
--button-warning-text-font-size: var(--font-size-md);
|
|
177
|
+
--button-warning-text-font-weight: var(--font-weight-semibold);
|
|
178
178
|
--button-warning-text-line-height: var(--line-height-sm);
|
|
179
179
|
--button-warning-border: var(--border-warning);
|
|
180
|
-
--button-warning-border-width: var(--border-width-
|
|
181
|
-
--button-warning-radius: var(--radius-
|
|
180
|
+
--button-warning-border-width: var(--border-width-1);
|
|
181
|
+
--button-warning-radius: var(--radius-xl);
|
|
182
182
|
--button-warning-padding: var(--space-8);
|
|
183
183
|
--button-warning-hover-surface: var(--surface-warning-high);
|
|
184
184
|
--button-warning-hover-text: var(--text-primary);
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
currently looks the same regardless of variant). Per-side padding
|
|
194
194
|
overrides power split-padding edits at small. */
|
|
195
195
|
--button-small-padding: var(--space-6);
|
|
196
|
-
--button-small-text-font-size: var(--font-size-
|
|
196
|
+
--button-small-text-font-size: var(--font-size-sm);
|
|
197
197
|
--button-small-text-font-weight: var(--font-weight-normal);
|
|
198
198
|
--button-small-text-line-height: var(--line-height-sm);
|
|
199
199
|
--button-small-icon-size: var(--font-size-xs);
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
:global(:root) {
|
|
28
28
|
/* Info */
|
|
29
29
|
--callout-info-surface: var(--surface-info-lowest);
|
|
30
|
-
--callout-info-border: var(--border-info-
|
|
30
|
+
--callout-info-border: var(--border-info-medium);
|
|
31
31
|
--callout-info-border-width: var(--border-width-1);
|
|
32
32
|
--callout-info-accent-width: var(--border-width-4);
|
|
33
33
|
--callout-info-radius: var(--radius-lg);
|
|
34
34
|
--callout-info-padding: var(--space-12);
|
|
35
35
|
--callout-info-label: var(--text-primary);
|
|
36
|
-
--callout-info-label-font-family: var(--font-
|
|
37
|
-
--callout-info-label-font-size: var(--font-size-
|
|
36
|
+
--callout-info-label-font-family: var(--font-sans);
|
|
37
|
+
--callout-info-label-font-size: var(--font-size-lg);
|
|
38
38
|
--callout-info-label-font-weight: var(--font-weight-bold);
|
|
39
39
|
--callout-info-label-line-height: var(--line-height-md);
|
|
40
40
|
--callout-info-text: var(--text-info);
|
|
41
|
-
--callout-info-text-font-family: var(--font-
|
|
42
|
-
--callout-info-text-font-size: var(--font-size-
|
|
41
|
+
--callout-info-text-font-family: var(--font-sans);
|
|
42
|
+
--callout-info-text-font-size: var(--font-size-lg);
|
|
43
43
|
--callout-info-text-font-weight: var(--font-weight-normal);
|
|
44
44
|
--callout-info-text-line-height: var(--line-height-md);
|
|
45
45
|
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
--callout-success-radius: var(--radius-lg);
|
|
52
52
|
--callout-success-padding: var(--space-12);
|
|
53
53
|
--callout-success-label: var(--text-primary);
|
|
54
|
-
--callout-success-label-font-family: var(--font-
|
|
55
|
-
--callout-success-label-font-size: var(--font-size-
|
|
54
|
+
--callout-success-label-font-family: var(--font-sans);
|
|
55
|
+
--callout-success-label-font-size: var(--font-size-lg);
|
|
56
56
|
--callout-success-label-font-weight: var(--font-weight-bold);
|
|
57
57
|
--callout-success-label-line-height: var(--line-height-md);
|
|
58
58
|
--callout-success-text: var(--text-success);
|
|
59
|
-
--callout-success-text-font-family: var(--font-
|
|
60
|
-
--callout-success-text-font-size: var(--font-size-
|
|
59
|
+
--callout-success-text-font-family: var(--font-sans);
|
|
60
|
+
--callout-success-text-font-size: var(--font-size-lg);
|
|
61
61
|
--callout-success-text-font-weight: var(--font-weight-normal);
|
|
62
62
|
--callout-success-text-line-height: var(--line-height-md);
|
|
63
63
|
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
--callout-warning-radius: var(--radius-lg);
|
|
70
70
|
--callout-warning-padding: var(--space-12);
|
|
71
71
|
--callout-warning-label: var(--text-primary);
|
|
72
|
-
--callout-warning-label-font-family: var(--font-
|
|
73
|
-
--callout-warning-label-font-size: var(--font-size-
|
|
72
|
+
--callout-warning-label-font-family: var(--font-sans);
|
|
73
|
+
--callout-warning-label-font-size: var(--font-size-lg);
|
|
74
74
|
--callout-warning-label-font-weight: var(--font-weight-bold);
|
|
75
75
|
--callout-warning-label-line-height: var(--line-height-md);
|
|
76
76
|
--callout-warning-text: var(--text-warning);
|
|
77
|
-
--callout-warning-text-font-family: var(--font-
|
|
78
|
-
--callout-warning-text-font-size: var(--font-size-
|
|
77
|
+
--callout-warning-text-font-family: var(--font-sans);
|
|
78
|
+
--callout-warning-text-font-size: var(--font-size-lg);
|
|
79
79
|
--callout-warning-text-font-weight: var(--font-weight-normal);
|
|
80
80
|
--callout-warning-text-line-height: var(--line-height-md);
|
|
81
81
|
|
|
@@ -87,13 +87,13 @@
|
|
|
87
87
|
--callout-danger-radius: var(--radius-lg);
|
|
88
88
|
--callout-danger-padding: var(--space-12);
|
|
89
89
|
--callout-danger-label: var(--text-primary);
|
|
90
|
-
--callout-danger-label-font-family: var(--font-
|
|
91
|
-
--callout-danger-label-font-size: var(--font-size-
|
|
90
|
+
--callout-danger-label-font-family: var(--font-sans);
|
|
91
|
+
--callout-danger-label-font-size: var(--font-size-lg);
|
|
92
92
|
--callout-danger-label-font-weight: var(--font-weight-bold);
|
|
93
93
|
--callout-danger-label-line-height: var(--line-height-md);
|
|
94
94
|
--callout-danger-text: var(--text-danger);
|
|
95
|
-
--callout-danger-text-font-family: var(--font-
|
|
96
|
-
--callout-danger-text-font-size: var(--font-size-
|
|
95
|
+
--callout-danger-text-font-family: var(--font-sans);
|
|
96
|
+
--callout-danger-text-font-size: var(--font-size-lg);
|
|
97
97
|
--callout-danger-text-font-weight: var(--font-weight-normal);
|
|
98
98
|
--callout-danger-text-line-height: var(--line-height-md);
|
|
99
99
|
}
|
|
@@ -43,28 +43,36 @@
|
|
|
43
43
|
@use '../styles/padding' as *;
|
|
44
44
|
|
|
45
45
|
:global(:root) {
|
|
46
|
-
--card-default-surface: var(--surface-neutral-
|
|
46
|
+
--card-default-surface: color-mix(in srgb, var(--surface-neutral-lower) 70%, transparent);
|
|
47
47
|
--card-default-border: var(--border-neutral);
|
|
48
48
|
--card-default-border-width: var(--border-width-1);
|
|
49
49
|
--card-default-radius: var(--radius-lg);
|
|
50
50
|
--card-default-header-padding: var(--space-16);
|
|
51
|
+
--card-default-header-padding-top: var(--space-12);
|
|
52
|
+
--card-default-header-padding-right: var(--space-20);
|
|
53
|
+
--card-default-header-padding-bottom: var(--space-12);
|
|
54
|
+
--card-default-header-padding-left: var(--space-20);
|
|
51
55
|
--card-default-header-gap: var(--space-8);
|
|
52
56
|
--card-default-body-padding: var(--space-16);
|
|
57
|
+
--card-default-body-padding-top: var(--space-16);
|
|
58
|
+
--card-default-body-padding-right: var(--space-20);
|
|
59
|
+
--card-default-body-padding-bottom: var(--space-16);
|
|
60
|
+
--card-default-body-padding-left: var(--space-20);
|
|
53
61
|
--card-default-shadow: var(--shadow-sm);
|
|
54
62
|
--card-default-blur: var(--blur-none);
|
|
55
|
-
--card-default-header-surface: var(--
|
|
63
|
+
--card-default-header-surface: color-mix(in srgb, var(--surface-neutral-lowest) 80%, transparent);
|
|
56
64
|
|
|
57
65
|
--card-default-title: var(--text-primary);
|
|
58
66
|
--card-default-title-font-family: var(--font-sans);
|
|
59
|
-
--card-default-title-font-size: var(--font-size-
|
|
60
|
-
--card-default-title-font-weight: var(--font-weight-
|
|
61
|
-
--card-default-title-line-height: var(--line-height-
|
|
67
|
+
--card-default-title-font-size: var(--font-size-2xl);
|
|
68
|
+
--card-default-title-font-weight: var(--font-weight-medium);
|
|
69
|
+
--card-default-title-line-height: var(--line-height-md);
|
|
62
70
|
|
|
63
|
-
--card-default-icon-size: var(--icon-size-
|
|
71
|
+
--card-default-icon-size: var(--icon-size-2xl);
|
|
64
72
|
|
|
65
73
|
--card-default-body: var(--text-secondary);
|
|
66
74
|
--card-default-body-font-family: var(--font-sans);
|
|
67
|
-
--card-default-body-font-size: var(--font-size-
|
|
75
|
+
--card-default-body-font-size: var(--font-size-xl);
|
|
68
76
|
--card-default-body-font-weight: var(--font-weight-normal);
|
|
69
77
|
--card-default-body-line-height: var(--line-height-md);
|
|
70
78
|
|
|
@@ -53,17 +53,17 @@
|
|
|
53
53
|
<style>
|
|
54
54
|
:global(:root) {
|
|
55
55
|
/* Container. */
|
|
56
|
-
--codesnippet-surface: var(--surface-neutral-
|
|
57
|
-
--codesnippet-border: var(--border-neutral
|
|
56
|
+
--codesnippet-surface: color-mix(in srgb, var(--surface-neutral-lowest) 76%, transparent);
|
|
57
|
+
--codesnippet-border: var(--border-neutral);
|
|
58
58
|
--codesnippet-border-width: var(--border-width-1);
|
|
59
59
|
--codesnippet-radius: var(--radius-md);
|
|
60
60
|
--codesnippet-padding: var(--space-16);
|
|
61
61
|
--codesnippet-gap: var(--space-16);
|
|
62
62
|
|
|
63
63
|
/* Code text. */
|
|
64
|
-
--codesnippet-code-text: var(--text-
|
|
64
|
+
--codesnippet-code-text: var(--text-brand-secondary);
|
|
65
65
|
--codesnippet-code-font-family: var(--font-mono);
|
|
66
|
-
--codesnippet-code-font-size: var(--font-size-
|
|
66
|
+
--codesnippet-code-font-size: var(--font-size-md);
|
|
67
67
|
--codesnippet-code-font-weight: var(--font-weight-normal);
|
|
68
68
|
--codesnippet-code-line-height: var(--line-height-md);
|
|
69
69
|
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
<style>
|
|
31
31
|
:global(:root) {
|
|
32
|
-
--image-default-radius: var(--radius-
|
|
32
|
+
--image-default-radius: var(--radius-2xl);
|
|
33
33
|
--image-default-border: var(--border-neutral);
|
|
34
34
|
--image-default-border-width: var(--border-width-1);
|
|
35
35
|
--image-default-shadow: var(--shadow-md);
|
|
@@ -409,7 +409,7 @@
|
|
|
409
409
|
--imagelightbox-tile-shadow: var(--shadow-md);
|
|
410
410
|
|
|
411
411
|
/* overlay */
|
|
412
|
-
--imagelightbox-overlay-surface: var(--
|
|
412
|
+
--imagelightbox-overlay-surface: color-mix(in srgb, var(--color-neutral-950) 76%, transparent);
|
|
413
413
|
|
|
414
414
|
/* chrome (toolbar + close button) */
|
|
415
415
|
--imagelightbox-chrome-surface: var(--surface-neutral-low);
|
|
@@ -16,39 +16,39 @@
|
|
|
16
16
|
:global(:root) {
|
|
17
17
|
/* Wrapper */
|
|
18
18
|
--table-default-radius: var(--radius-md);
|
|
19
|
-
--table-default-surface: var(--
|
|
20
|
-
--table-default-border: var(--border-
|
|
21
|
-
--table-default-border-width: var(--border-width-
|
|
19
|
+
--table-default-surface: color-mix(in srgb, var(--surface-neutral-lower) 57%, transparent);
|
|
20
|
+
--table-default-border: var(--border-neutral);
|
|
21
|
+
--table-default-border-width: var(--border-width-2);
|
|
22
22
|
--table-default-shadow: var(--shadow-md);
|
|
23
23
|
|
|
24
24
|
/* Header */
|
|
25
|
-
--table-default-header-surface: var(--surface-
|
|
25
|
+
--table-default-header-surface: var(--surface-neutral-lowest);
|
|
26
26
|
--table-default-header-text: var(--text-primary);
|
|
27
27
|
--table-default-header-font-family: var(--font-sans);
|
|
28
|
-
--table-default-header-font-size: var(--font-size-
|
|
29
|
-
--table-default-header-font-weight: var(--font-weight-
|
|
28
|
+
--table-default-header-font-size: var(--font-size-lg);
|
|
29
|
+
--table-default-header-font-weight: var(--font-weight-semibold);
|
|
30
30
|
--table-default-header-line-height: var(--line-height-xs);
|
|
31
31
|
--table-default-header-padding: var(--space-12);
|
|
32
|
-
--table-default-header-border: var(--border-
|
|
32
|
+
--table-default-header-border: var(--border-neutral);
|
|
33
33
|
--table-default-header-border-width: var(--border-width-1);
|
|
34
34
|
|
|
35
35
|
/* Cell */
|
|
36
36
|
--table-default-cell-text: var(--text-secondary);
|
|
37
37
|
--table-default-cell-font-family: var(--font-sans);
|
|
38
|
-
--table-default-cell-font-size: var(--font-size-
|
|
39
|
-
--table-default-cell-font-weight: var(--font-weight-
|
|
38
|
+
--table-default-cell-font-size: var(--font-size-md);
|
|
39
|
+
--table-default-cell-font-weight: var(--font-weight-medium);
|
|
40
40
|
--table-default-cell-line-height: var(--line-height-md);
|
|
41
41
|
--table-default-cell-padding: var(--space-8);
|
|
42
42
|
|
|
43
43
|
/* Row */
|
|
44
44
|
--table-default-row-surface: var(--color-transparent);
|
|
45
|
-
--table-default-row-divider: var(--border-
|
|
45
|
+
--table-default-row-divider: var(--border-neutral-subtle);
|
|
46
46
|
--table-default-row-divider-width: var(--border-width-1);
|
|
47
47
|
--table-default-row-stripe-surface: var(--color-transparent);
|
|
48
48
|
|
|
49
49
|
/* Column */
|
|
50
|
-
--table-default-column-divider: var(--border-
|
|
51
|
-
--table-default-column-divider-width: var(--border-width-
|
|
50
|
+
--table-default-column-divider: var(--border-neutral-faint);
|
|
51
|
+
--table-default-column-divider-width: var(--border-width-1);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
.table-wrapper {
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
@use '../styles/padding' as *;
|
|
28
28
|
|
|
29
29
|
:global(:root) {
|
|
30
|
-
--tooltip-surface: var(--surface-
|
|
30
|
+
--tooltip-surface: color-mix(in srgb, var(--surface-canvas-lowest) 75%, transparent);
|
|
31
31
|
--tooltip-text: var(--text-primary);
|
|
32
32
|
--tooltip-text-font-family: var(--font-sans);
|
|
33
33
|
--tooltip-text-font-size: var(--font-size-sm);
|
|
34
34
|
--tooltip-text-font-weight: var(--font-weight-normal);
|
|
35
35
|
--tooltip-text-line-height: var(--line-height-md);
|
|
36
36
|
--tooltip-border: var(--border-neutral);
|
|
37
|
-
--tooltip-border-width: var(--border-width-
|
|
37
|
+
--tooltip-border-width: var(--border-width-1);
|
|
38
38
|
--tooltip-radius: var(--radius-md);
|
|
39
39
|
--tooltip-padding: var(--space-6);
|
|
40
40
|
--tooltip-shadow: var(--shadow-md);
|