@motion-proto/live-tokens 0.6.2 → 0.7.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/README.md +14 -13
- package/dist-plugin/index.cjs +147 -136
- package/dist-plugin/index.d.cts +1 -1
- package/dist-plugin/index.d.ts +1 -1
- package/dist-plugin/index.js +145 -135
- package/package.json +25 -40
- package/src/{component-editor → editor/component-editor}/BadgeEditor.svelte +8 -82
- package/src/{component-editor → editor/component-editor}/CalloutEditor.svelte +4 -4
- package/src/{component-editor → editor/component-editor}/CardEditor.svelte +28 -76
- package/src/{component-editor → editor/component-editor}/CollapsibleSectionEditor.svelte +3 -3
- package/src/{component-editor → editor/component-editor}/CornerBadgeEditor.svelte +31 -93
- package/src/{component-editor → editor/component-editor}/DialogEditor.svelte +60 -57
- package/src/editor/component-editor/ImageEditor.svelte +30 -0
- package/src/{component-editor → editor/component-editor}/InlineEditActionsEditor.svelte +6 -4
- package/src/editor/component-editor/MenuSelectEditor.svelte +160 -0
- package/src/{component-editor → editor/component-editor}/NotificationEditor.svelte +64 -37
- package/src/{component-editor → editor/component-editor}/ProgressBarEditor.svelte +5 -4
- package/src/{component-editor → editor/component-editor}/RadioButtonEditor.svelte +3 -3
- package/src/{component-editor → editor/component-editor}/SectionDividerEditor.svelte +57 -84
- package/src/{component-editor → editor/component-editor}/SegmentedControlEditor.svelte +2 -2
- package/src/{component-editor → editor/component-editor}/StandardButtonsEditor.svelte +16 -20
- package/src/{component-editor → editor/component-editor}/TabBarEditor.svelte +9 -14
- package/src/{component-editor → editor/component-editor}/TableEditor.svelte +9 -18
- package/src/{component-editor → editor/component-editor}/TooltipEditor.svelte +11 -47
- package/src/{component-editor → editor/component-editor}/registry.ts +28 -18
- package/src/{component-editor → editor/component-editor}/scaffolding/AngleDial.svelte +2 -2
- package/src/{component-editor → editor/component-editor}/scaffolding/ComponentEditorBase.svelte +3 -51
- package/src/{component-editor → editor/component-editor}/scaffolding/ComponentFileManager.svelte +144 -416
- package/src/{component-editor → editor/component-editor}/scaffolding/ComponentFileMenu.svelte +18 -170
- package/src/{component-editor → editor/component-editor}/scaffolding/ComponentsTab.svelte +2 -2
- package/src/{component-editor → editor/component-editor}/scaffolding/CopyFromMenu.svelte +44 -4
- package/src/{component-editor → editor/component-editor}/scaffolding/DividerEditor.svelte +1 -1
- package/src/{component-editor → editor/component-editor}/scaffolding/FieldsetWrapper.svelte +1 -1
- package/src/{component-editor → editor/component-editor}/scaffolding/GradientCard.svelte +6 -6
- package/src/{component-editor → editor/component-editor}/scaffolding/LinkageChart.svelte +6 -6
- package/src/{component-editor → editor/component-editor}/scaffolding/LinkedBlock.svelte +6 -11
- package/src/editor/component-editor/scaffolding/NonStylableConfig.svelte +38 -0
- package/src/{component-editor → editor/component-editor}/scaffolding/SaveAsDialog.svelte +66 -12
- package/src/editor/component-editor/scaffolding/ShadowBackdrop.svelte +72 -0
- package/src/editor/component-editor/scaffolding/ShadowBackdropControls.svelte +132 -0
- package/src/editor/component-editor/scaffolding/StateBlock.svelte +257 -0
- package/src/{component-editor → editor/component-editor}/scaffolding/TokenLayout.svelte +9 -7
- package/src/editor/component-editor/scaffolding/VariantGroup.svelte +644 -0
- package/src/{component-editor → editor/component-editor}/scaffolding/editorContext.ts +19 -9
- package/src/{component-editor → editor/component-editor}/scaffolding/linkedBlock.ts +2 -2
- package/src/{component-editor → editor/component-editor}/scaffolding/types.ts +14 -0
- package/src/{lib → editor/core/components}/componentConfigService.ts +2 -2
- package/src/{lib → editor/core/components}/componentPersist.ts +5 -5
- package/src/editor/core/flashStatus.ts +30 -0
- package/src/{lib → editor/core/fonts}/fontLoader.ts +2 -2
- package/src/{lib → editor/core/fonts}/fontMigration.ts +4 -4
- package/src/{lib → editor/core/fonts}/fontParse.ts +1 -1
- package/src/editor/core/manifests/manifestService.ts +116 -0
- package/src/{lib → editor/core/palettes}/paletteDerivation.ts +2 -2
- package/src/{lib → editor/core/palettes}/tokenRegistry.ts +5 -5
- package/src/editor/core/productionPulse.ts +37 -0
- package/src/{lib → editor/core/routing}/router.ts +1 -1
- package/src/{lib/files/versionedFileResource.ts → editor/core/storage/files/versionedFileResourceClient.ts} +8 -1
- package/src/{lib → editor/core/store}/editorCore.ts +24 -8
- package/src/{lib → editor/core/store}/editorPersistence.ts +3 -3
- package/src/{lib → editor/core/store}/editorRenderer.ts +2 -2
- package/src/{lib → editor/core/store}/editorStore.ts +17 -17
- package/src/{lib → editor/core/store}/editorTypes.ts +1 -1
- package/src/{lib → editor/core/themes}/slices/columns.ts +2 -2
- package/src/{lib → editor/core/themes}/slices/components.ts +2 -2
- package/src/{lib → editor/core/themes}/slices/fonts.ts +1 -1
- package/src/{lib → editor/core/themes}/slices/gradients.ts +2 -2
- package/src/{lib → editor/core/themes}/slices/overlays.ts +1 -1
- package/src/{lib → editor/core/themes}/slices/palettes.ts +1 -1
- package/src/{lib → editor/core/themes}/slices/shadows.ts +3 -3
- package/src/{lib → editor/core/themes}/themeInit.ts +6 -6
- package/src/{lib → editor/core/themes}/themeService.ts +6 -6
- package/src/{lib → editor/core/themes}/themeTypes.ts +11 -7
- package/src/editor/index.ts +69 -0
- package/src/{lib → editor/overlay}/LiveEditorOverlay.svelte +79 -125
- package/src/{lib → editor/overlay}/columnsOverlay.ts +2 -2
- package/src/{pages → editor/pages}/ComponentEditorPage.svelte +12 -12
- package/src/{pages → editor/pages}/Editor.svelte +4 -4
- package/src/{pages → editor/pages}/EditorShell.svelte +18 -36
- package/src/{styles → editor/styles}/ui-editor.css +41 -21
- package/src/{styles → editor/styles}/ui-form-controls.css +8 -8
- package/src/{ui → editor/ui}/BezierCurveEditor.svelte +8 -8
- package/src/{ui → editor/ui}/ColorEditPanel.svelte +13 -13
- package/src/{ui → editor/ui}/EditorViewSwitcher.svelte +8 -6
- package/src/editor/ui/FileLoadList.svelte +350 -0
- package/src/editor/ui/FilePill.svelte +80 -0
- package/src/{ui → editor/ui}/FontStackEditor.svelte +7 -7
- package/src/{ui → editor/ui}/GradientEditor.svelte +11 -11
- package/src/{ui → editor/ui}/GradientStopPicker.svelte +1 -1
- package/src/editor/ui/ManifestFileManager.svelte +371 -0
- package/src/{ui → editor/ui}/PaletteEditor.svelte +132 -598
- package/src/{ui → editor/ui}/ProjectFontsSection.svelte +102 -144
- package/src/{ui → editor/ui}/SurfacesTab.svelte +3 -3
- package/src/{ui → editor/ui}/TextTab.svelte +3 -3
- package/src/{ui → editor/ui}/ThemeFileManager.svelte +286 -519
- package/src/{ui → editor/ui}/UICopyPopover.svelte +4 -4
- package/src/{ui → editor/ui}/UIFontFamilySelector.svelte +6 -6
- package/src/{ui → editor/ui}/UIFontSizeSelector.svelte +1 -1
- package/src/editor/ui/UIInfoPopover.svelte +244 -0
- package/src/{ui → editor/ui}/UILineHeightSelector.svelte +5 -5
- package/src/{ui → editor/ui}/UILinkToggle.svelte +2 -2
- package/src/{ui → editor/ui}/UIPaddingSelector.svelte +6 -6
- package/src/{ui → editor/ui}/UIPaletteSelector.svelte +26 -26
- package/src/editor/ui/UIPillButton.svelte +138 -0
- package/src/{ui → editor/ui}/UIRadio.svelte +2 -2
- package/src/{ui → editor/ui}/UIRelinkConfirmPopover.svelte +4 -4
- package/src/editor/ui/UISquareButton.svelte +172 -0
- package/src/{ui → editor/ui}/UITokenSelector.svelte +10 -10
- package/src/{ui → editor/ui}/UIVariantSelector.svelte +1 -1
- package/src/{ui → editor/ui}/VariablesTab.svelte +31 -8
- package/src/{ui → editor/ui}/palette/GradientStopEditor.svelte +13 -13
- package/src/{ui → editor/ui}/palette/OverridesPanel.svelte +13 -13
- package/src/{ui → editor/ui}/palette/PaletteBase.svelte +8 -5
- package/src/{ui → editor/ui}/palette/paletteEditorState.ts +1 -1
- package/src/editor/ui/palette/paletteMath.ts +275 -0
- package/src/{ui → editor/ui}/sections/ColumnsSection.svelte +137 -17
- package/src/{ui → editor/ui}/sections/GradientsSection.svelte +7 -7
- package/src/{ui → editor/ui}/sections/OverlaysSection.svelte +17 -17
- package/src/{ui → editor/ui}/sections/ShadowsSection.svelte +22 -22
- package/src/{ui → editor/ui}/sections/TokenScaleTable.svelte +3 -3
- package/src/{components → system/components}/Badge.svelte +0 -36
- package/src/{components → system/components}/Card.svelte +8 -62
- package/src/{components → system/components}/CornerBadge.svelte +8 -24
- package/src/{components → system/components}/Dialog.svelte +1 -1
- package/src/system/components/FloatingTokenTags.css +256 -0
- package/src/system/components/FloatingTokenTags.svelte +592 -0
- package/src/{components → system/components}/InlineEditActions.svelte +6 -4
- package/src/system/components/MenuSelect.svelte +229 -0
- package/src/{components → system/components}/ProgressBar.svelte +29 -11
- package/src/{components → system/components}/SegmentedControl.svelte +49 -43
- package/src/{components → system/components}/TabBar.svelte +81 -65
- package/src/{components → system/components}/Table.svelte +17 -3
- package/src/{components → system/components}/Tooltip.svelte +6 -4
- package/src/system/styles/CONVENTIONS.md +178 -0
- package/src/{styles → system/styles}/fonts.css +6 -3
- package/src/{styles → system/styles}/tokens.css +149 -29
- package/src/component-editor/ImageEditor.svelte +0 -74
- package/src/component-editor/scaffolding/NonStylableConfig.svelte +0 -62
- package/src/component-editor/scaffolding/ShadowBackdrop.svelte +0 -37
- package/src/component-editor/scaffolding/ShadowBackdropControls.svelte +0 -61
- package/src/component-editor/scaffolding/StateBlock.svelte +0 -132
- package/src/component-editor/scaffolding/VariantGroup.svelte +0 -310
- package/src/data/google-fonts.json +0 -75
- package/src/lib/index.ts +0 -68
- package/src/lib/presetService.ts +0 -214
- package/src/lib/productionPulse.ts +0 -32
- package/src/ui/PresetFileManager.svelte +0 -1116
- package/src/ui/UnsavedComponentsDialog.svelte +0 -315
- /package/src/{styles → app}/site.css +0 -0
- /package/src/{component-editor → editor/component-editor}/index.ts +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/DemoHeader.svelte +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/TypeEditor.svelte +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/buildTypeGroupTokens.ts +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/componentSectionType.ts +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/componentSources.ts +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/defaultSections.ts +0 -0
- /package/src/{component-editor → editor/component-editor}/scaffolding/siblings.ts +0 -0
- /package/src/{lib → editor/core/components}/componentConfigKeys.ts +0 -0
- /package/src/{lib → editor/core}/cssVarSync.ts +0 -0
- /package/src/{lib → editor/core/palettes}/oklch.ts +0 -0
- /package/src/{lib → editor/core/routing}/navLinkTypes.ts +0 -0
- /package/src/{lib → editor/core/routing}/parentRouteStore.ts +0 -0
- /package/src/{lib → editor/core/storage}/storage.ts +0 -0
- /package/src/{lib → editor/core/store}/editorConfig.ts +0 -0
- /package/src/{lib → editor/core/store}/editorConfigStore.ts +0 -0
- /package/src/{lib → editor/core/store}/editorKeybindings.ts +0 -0
- /package/src/{lib → editor/core/store}/editorViewStore.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-04-24-component-prefix-and-suffix-renames.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-04-24-legacy-keys-and-bg-to-canvas.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-04-27-segmentedcontrol-disabled-flatten.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-05-08-collapsiblesection-frame-and-cleanup.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-05-08-collapsiblesection-variant-namespace.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-05-10-sectiondivider-gradient-stops.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/2026-05-13-primary-to-brand.ts +0 -0
- /package/src/{lib → editor/core/themes}/migrations/index.ts +0 -0
- /package/src/{lib → editor/core/themes}/parsers/globalRootBlock.ts +0 -0
- /package/src/{lib → editor/core/themes}/slices/domainVars.ts +0 -0
- /package/src/{lib → editor/overlay}/ColumnsOverlay.svelte +0 -0
- /package/src/{lib → editor/overlay}/overlayState.ts +0 -0
- /package/src/{pages → editor/pages}/ComponentEditorPage.svelte.d.ts +0 -0
- /package/src/{pages → editor/pages}/Editor.svelte.d.ts +0 -0
- /package/src/{ui → editor/ui}/Toggle.svelte +0 -0
- /package/src/{ui → editor/ui}/UIDialog.svelte +0 -0
- /package/src/{ui → editor/ui}/UIFontWeightSelector.svelte +0 -0
- /package/src/{ui → editor/ui}/UIOptionItem.svelte +0 -0
- /package/src/{ui → editor/ui}/UIOptionList.svelte +0 -0
- /package/src/{ui → editor/ui}/UIRadioGroup.svelte +0 -0
- /package/src/{lib → editor/ui}/copyPopover.ts +0 -0
- /package/src/{ui → editor/ui}/curveEngine.ts +0 -0
- /package/src/{ui → editor/ui}/index.ts +0 -0
- /package/src/{ui → editor/ui}/keepInViewport.ts +0 -0
- /package/src/{ui → editor/ui}/palette/ScaleCurveEditor.svelte +0 -0
- /package/src/{lib → editor/ui}/scrollSection.ts +0 -0
- /package/src/{ui → editor/ui}/sections/tokenScales.ts +0 -0
- /package/src/{ui → editor/ui}/variantScales.ts +0 -0
- /package/src/{assets → system/assets}/newspaper.webp +0 -0
- /package/src/{assets → system/assets}/offering.webp +0 -0
- /package/src/{components → system/components}/Button.svelte +0 -0
- /package/src/{components → system/components}/Callout.svelte +0 -0
- /package/src/{components → system/components}/CollapsibleSection.svelte +0 -0
- /package/src/{components → system/components}/Image.svelte +0 -0
- /package/src/{components → system/components}/Notification.svelte +0 -0
- /package/src/{components → system/components}/RadioButton.svelte +0 -0
- /package/src/{components → system/components}/SectionDivider.svelte +0 -0
- /package/src/{components → system/components}/types.ts +0 -0
- /package/src/{styles → system/styles}/_padding.scss +0 -0
- /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-italic-latin-ext.woff2 +0 -0
- /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-italic-latin.woff2 +0 -0
- /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-roman-latin-ext.woff2 +0 -0
- /package/src/{styles → system/styles}/fonts/Fraunces/Fraunces-roman-latin.woff2 +0 -0
- /package/src/{styles → system/styles}/fonts/Manrope/Manrope-latin-ext.woff2 +0 -0
- /package/src/{styles → system/styles}/fonts/Manrope/Manrope-latin.woff2 +0 -0
|
@@ -11,9 +11,12 @@
|
|
|
11
11
|
</div>
|
|
12
12
|
|
|
13
13
|
<style lang="scss">
|
|
14
|
+
@use '../styles/padding' as *;
|
|
15
|
+
|
|
14
16
|
:global(:root) {
|
|
15
17
|
/* Wrapper */
|
|
16
18
|
--table-default-radius: var(--radius-md);
|
|
19
|
+
--table-default-surface: var(--color-transparent);
|
|
17
20
|
--table-default-border: var(--border-canvas-subtle);
|
|
18
21
|
--table-default-border-width: var(--border-width-1);
|
|
19
22
|
--table-default-shadow: var(--shadow-md);
|
|
@@ -38,9 +41,10 @@
|
|
|
38
41
|
--table-default-cell-padding: var(--space-8);
|
|
39
42
|
|
|
40
43
|
/* Row */
|
|
44
|
+
--table-default-row-surface: var(--color-transparent);
|
|
41
45
|
--table-default-row-divider: var(--border-canvas-faint);
|
|
42
46
|
--table-default-row-divider-width: var(--border-width-1);
|
|
43
|
-
--table-default-row-stripe-surface: var(--
|
|
47
|
+
--table-default-row-stripe-surface: var(--color-transparent);
|
|
44
48
|
|
|
45
49
|
/* Column */
|
|
46
50
|
--table-default-column-divider: var(--border-canvas-faint);
|
|
@@ -51,6 +55,7 @@
|
|
|
51
55
|
overflow-x: auto;
|
|
52
56
|
margin: var(--space-12) 0;
|
|
53
57
|
-webkit-overflow-scrolling: touch;
|
|
58
|
+
background: var(--table-default-surface);
|
|
54
59
|
border: var(--table-default-border-width) solid var(--table-default-border);
|
|
55
60
|
border-radius: var(--table-default-radius);
|
|
56
61
|
box-shadow: var(--table-default-shadow);
|
|
@@ -70,7 +75,7 @@
|
|
|
70
75
|
font-size: var(--table-default-header-font-size);
|
|
71
76
|
font-weight: var(--table-default-header-font-weight);
|
|
72
77
|
line-height: var(--table-default-header-line-height);
|
|
73
|
-
padding
|
|
78
|
+
@include themed-padding(--table-default-header-padding);
|
|
74
79
|
text-align: left;
|
|
75
80
|
border-bottom: var(--table-default-header-border-width) solid var(--table-default-header-border);
|
|
76
81
|
border-right: var(--table-default-column-divider-width) solid var(--table-default-column-divider);
|
|
@@ -78,6 +83,7 @@
|
|
|
78
83
|
}
|
|
79
84
|
|
|
80
85
|
.table-wrapper :global(td) {
|
|
86
|
+
background: var(--table-default-row-surface);
|
|
81
87
|
color: var(--table-default-cell-text);
|
|
82
88
|
font-family: var(--table-default-cell-font-family);
|
|
83
89
|
font-size: var(--table-default-cell-font-size);
|
|
@@ -97,8 +103,16 @@
|
|
|
97
103
|
border-right: none;
|
|
98
104
|
}
|
|
99
105
|
|
|
106
|
+
/* Stripe is layered over the base row surface as a background-image, so a
|
|
107
|
+
translucent stripe color blends with the base instead of replacing it.
|
|
108
|
+
An opaque stripe still covers the base (visually identical to the old
|
|
109
|
+
replacement behavior); a fully transparent stripe leaves the base
|
|
110
|
+
untouched, which is the default out of the box. */
|
|
100
111
|
.table-wrapper :global(tr:nth-child(even) td) {
|
|
101
|
-
background:
|
|
112
|
+
background-image: linear-gradient(
|
|
113
|
+
var(--table-default-row-stripe-surface),
|
|
114
|
+
var(--table-default-row-stripe-surface)
|
|
115
|
+
);
|
|
102
116
|
}
|
|
103
117
|
|
|
104
118
|
.table-wrapper :global(tr:last-child td) {
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
{/if}
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
|
-
<style>
|
|
26
|
+
<style lang="scss">
|
|
27
|
+
@use '../styles/padding' as *;
|
|
28
|
+
|
|
27
29
|
:global(:root) {
|
|
28
30
|
--tooltip-surface: var(--surface-neutral-highest);
|
|
29
31
|
--tooltip-text: var(--text-primary);
|
|
@@ -50,7 +52,7 @@
|
|
|
50
52
|
transform: translateX(-50%);
|
|
51
53
|
background: var(--tooltip-surface);
|
|
52
54
|
color: var(--tooltip-text);
|
|
53
|
-
|
|
55
|
+
@include themed-padding(--tooltip-padding, $h: 2);
|
|
54
56
|
border: var(--tooltip-border-width) solid var(--tooltip-border);
|
|
55
57
|
border-radius: var(--tooltip-radius);
|
|
56
58
|
font-family: var(--tooltip-text-font-family);
|
|
@@ -68,7 +70,7 @@
|
|
|
68
70
|
.tooltip::after {
|
|
69
71
|
content: '';
|
|
70
72
|
position: absolute;
|
|
71
|
-
bottom: calc(-4px - var(--tooltip-border-width)
|
|
73
|
+
bottom: calc(-4px - var(--tooltip-border-width));
|
|
72
74
|
left: 50%;
|
|
73
75
|
width: 8px;
|
|
74
76
|
height: 8px;
|
|
@@ -86,7 +88,7 @@
|
|
|
86
88
|
|
|
87
89
|
.tooltip.bottom::after {
|
|
88
90
|
bottom: auto;
|
|
89
|
-
top: calc(-4px - var(--tooltip-border-width)
|
|
91
|
+
top: calc(-4px - var(--tooltip-border-width));
|
|
90
92
|
border-right: none;
|
|
91
93
|
border-bottom: none;
|
|
92
94
|
border-left: var(--tooltip-border-width) solid var(--tooltip-border);
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Token naming conventions
|
|
2
|
+
|
|
3
|
+
This project uses a **two-layer token system**. Read this before adding or renaming a CSS custom property.
|
|
4
|
+
|
|
5
|
+
## Files in this directory
|
|
6
|
+
|
|
7
|
+
Each file plays a distinct role. Don't merge them without understanding why they were split.
|
|
8
|
+
|
|
9
|
+
| File | Scope | Tokens used | Loaded by | Notes |
|
|
10
|
+
|---|---|---|---|---|
|
|
11
|
+
| `tokens.css` | Themed pages | Defines `--color-*`, `--surface-*`, `--text-*`, `--space-*`, … | `main.ts` | **Runtime-edited.** The token editor rewrites this file via the `themeFileApi` Vite plugin. Starter content; consumers replace at will. |
|
|
12
|
+
| `ui-editor.css` | Editor chrome only | Defines `--ui-*` (opaque grayscale, system fonts) | JS-imported by `Editor.svelte` and `ComponentEditorPage.svelte` | Deliberately isolated from the theme system so editor surfaces stay neutral while live theme edits flow through the components being edited. Never load globally. |
|
|
13
|
+
| `ui-form-controls.css` | Editor chrome only | Consumes `--ui-*` only | JS-imported by `Editor.svelte` and `ComponentEditorPage.svelte` | `.ui-form-select` / `.ui-form-input` / `.ui-form-field-*` classes. Used by `ProjectFontsSection`, `FontStackEditor`, `DialogEditor`, `NotificationEditor`. Theme-immune — must not reference `--font-*`, `--surface-*`, etc. |
|
|
14
|
+
| `site.css` | Themed pages | Consumes theme tokens | Page-imported by `Home.svelte` / `Demo.svelte` | Global typography for the landing/demo pages (unscoped `h1`, `p`, `a`, …). Never load on editor pages. Starter content. |
|
|
15
|
+
| `fonts.css` + `fonts/` | Themed pages only | n/a (`@font-face` only) | `main.ts` | Build-special-cased: copied directly to `dist/` without processing so Vite doesn't inline woff2 files as base64. Starter content; editor's font invariant means these never affect chrome. |
|
|
16
|
+
|
|
17
|
+
### Publishing layout
|
|
18
|
+
|
|
19
|
+
The library publishes a small set of subpaths:
|
|
20
|
+
|
|
21
|
+
- `./styles/ui-editor.css` — read-only window onto the editor's `--ui-*` token contract (for theming inspection or debugging). Consumers don't *need* to import this; the editor pages auto-load it.
|
|
22
|
+
- `./starter/tokens.css`, `./starter/site.css`, `./starter/fonts.css` — replaceable starter content. Consumers can import as-is for a working default, or copy + edit.
|
|
23
|
+
|
|
24
|
+
`ui-form-controls.css` is editor-internal and not exported — the editor pages script-import it themselves.
|
|
25
|
+
|
|
26
|
+
### Editor font invariant
|
|
27
|
+
|
|
28
|
+
Editor chrome uses **only** the `--ui-*` font namespace (`--ui-font-sans`, `--ui-font-mono`, `--ui-font-size-*`, etc.), which `ui-editor.css` defines as a pure system stack. No editor-namespace rule may reference `var(--font-sans)`, `var(--font-serif)`, `var(--font-display)`, or `var(--font-mono)` — those are the consumer's theme fonts and must not bleed into chrome. This invariant is what closes the "editor adopts consumer brand fonts" leak.
|
|
29
|
+
|
|
30
|
+
### When to put a rule where
|
|
31
|
+
|
|
32
|
+
- It defines a `--color-*` / `--surface-*` / `--space-*` / etc. → `tokens.css`.
|
|
33
|
+
- It defines a `--ui-*` token → `ui-editor.css`.
|
|
34
|
+
- It styles a bare element selector (`h1`, `p`, `blockquote`) on themed pages → `site.css`.
|
|
35
|
+
- It styles editor chrome → put it in the component's own `<style>` block using `--ui-*` tokens; don't add a new global file.
|
|
36
|
+
- It declares an `@font-face` → `fonts.css` (and add the woff2 to `fonts/`).
|
|
37
|
+
|
|
38
|
+
## Layer 1 — theme tokens (`tokens.css`)
|
|
39
|
+
|
|
40
|
+
Theme tokens are the design system's vocabulary. They describe colors, sizes, spacing, shadows, and motion: the things a designer reasons about independent of any one component. Components consume them, and themes in `themes/*.json` recolor or re-scale them.
|
|
41
|
+
|
|
42
|
+
### Category-first naming
|
|
43
|
+
|
|
44
|
+
Every theme token starts with a **category prefix**. The category tells you what *kind* of value lives at that key:
|
|
45
|
+
|
|
46
|
+
| Category | What it holds |
|
|
47
|
+
|----------------|-----------------------------------------------------------------|
|
|
48
|
+
| `--color-*` | Primitive color palette (e.g. `--color-accent-500`) |
|
|
49
|
+
| `--surface-*` | Fill/background colors, with elevation tiers |
|
|
50
|
+
| `--border-*` | Border colors, with emphasis tiers |
|
|
51
|
+
| `--text-*` | Text colors, with hierarchy tiers |
|
|
52
|
+
| `--font-*` | Font families and weights |
|
|
53
|
+
| `--font-size-*`| Font sizes (explicit subcategory to avoid colliding with families) |
|
|
54
|
+
| `--space-*` | Spacing scale, values encoded in the name (`--space-8` = 8px) |
|
|
55
|
+
| `--radius-*` | Border radii (t-shirt scale) |
|
|
56
|
+
| `--shadow-*` | Elevation shadows |
|
|
57
|
+
| `--ring-*` | Focus rings (separate namespace from shadows) |
|
|
58
|
+
| `--border-width-*` | Stroke widths |
|
|
59
|
+
| `--transition-*`, `--opacity-*`, `--z-*` | Animation, opacity, z-index scales |
|
|
60
|
+
| `--overlay-*`, `--hover-*` | Semantic overlay tints |
|
|
61
|
+
| `--gradient-*` | Named gradients |
|
|
62
|
+
| `--columns-*`, `--page-*` | Page-level layout primitives |
|
|
63
|
+
|
|
64
|
+
**Rule: a bare one-word token belongs to *some* category.** If you find yourself writing `--overlay` or `--border`, make sure the category is obvious and it's the canonical default. Otherwise pick a longer name that slots it into its family (e.g. `--border-neutral`).
|
|
65
|
+
|
|
66
|
+
### Families within a category
|
|
67
|
+
|
|
68
|
+
Color categories (`--surface-*`, `--border-*`, `--text-*`) partition into **families**: `neutral`, `canvas`, `primary` (*→ brand, rename pending*), `accent`, `success`, `warning`, `danger`, `info`, `special`, `alternate`. Each family carries its own emphasis/elevation scale suited to its role: 7-step elevation for surfaces, 4-step emphasis for borders, 5-step hierarchy for text. They differ on purpose.
|
|
69
|
+
|
|
70
|
+
### Scales
|
|
71
|
+
|
|
72
|
+
Two shapes appear:
|
|
73
|
+
|
|
74
|
+
- **T-shirt scale** (`-xs / -sm / -md / -lg / -xl / -2xl …`). Used for `--radius-*`, `--font-size-*`, `--shadow-*`, `--ring-focus-*`.
|
|
75
|
+
- **Numeric scale.** `--color-*-100` through `--color-*-950` for palettes; `--space-4 / -8 / -16 / …` (value encoded in the name).
|
|
76
|
+
|
|
77
|
+
Don't invent a third scale shape for a new category.
|
|
78
|
+
|
|
79
|
+
## Layer 2 — component tokens (`component-configs/*/default.json` + component Svelte files)
|
|
80
|
+
|
|
81
|
+
Component tokens *reference* theme tokens. They're how a component names its own slots: "my bar's surface color", "my selected option's border width". The config file records which theme alias is currently assigned to each slot.
|
|
82
|
+
|
|
83
|
+
### The naming scheme
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
--<componentId>-<part>[-<state>][-<element>]-<property>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- **`componentId`.** The literal component ID. No abbreviations. The ID itself has no dashes (it's the file-system-safe form: `segmentedcontrol`, not `segmented-control`).
|
|
90
|
+
- **`part`.** Which part of the component this slot belongs to: `bar`, `divider`, `option`, `selected`, `track`, `save`, `cancel`, etc.
|
|
91
|
+
- **`state`.** Optional. The interaction state if more than default: `hover`, `disabled`, `active`, `focus`. States come **before** the property, never after.
|
|
92
|
+
- **`element`.** Optional. A sub-element within the part: `dot`, `icon`, `label`, `text`.
|
|
93
|
+
- **`property`.** Always last. Either a **theme role** (`surface`, `border`, `text`, `icon`, `label`, `fill`) or a **CSS property name** (`radius`, `border-width`, `font-weight`, `font-family`, `font-size`).
|
|
94
|
+
|
|
95
|
+
### No abbreviations
|
|
96
|
+
|
|
97
|
+
- `bg` → `surface` (matches the theme role name and the theme layer's full-word vocabulary).
|
|
98
|
+
- `fg` → `text`.
|
|
99
|
+
- Component IDs are never abbreviated. Use `--segmentedcontrol-*`, not `--segment-*` or `--sc-*`.
|
|
100
|
+
|
|
101
|
+
### Property suffix vocabulary
|
|
102
|
+
|
|
103
|
+
| Suffix | Meaning |
|
|
104
|
+
|----------------|--------------------------------------------------------------|
|
|
105
|
+
| `-surface` | Fill/background color |
|
|
106
|
+
| `-border` | Border color |
|
|
107
|
+
| `-text` | Text color |
|
|
108
|
+
| `-icon` | Icon color |
|
|
109
|
+
| `-label` | Label text color |
|
|
110
|
+
| `-fill` | Inner fill (distinct from outer surface) |
|
|
111
|
+
| `-radius` | Corner radius |
|
|
112
|
+
| `-border-width`| Stroke thickness |
|
|
113
|
+
| `-font-family` | Font family reference |
|
|
114
|
+
| `-font-weight` | Font weight reference |
|
|
115
|
+
| `-font-size` | Font size reference |
|
|
116
|
+
| `-thickness` | Alternative stroke dimension (used where `-width` would alias another token under name-based fallback grouping) |
|
|
117
|
+
| `-height` | Explicit height when `-width`'s sibling would collide under name-based fallback grouping |
|
|
118
|
+
| `-color` | Generic color when none of the role words fits (rare) |
|
|
119
|
+
|
|
120
|
+
**Why `thickness` and `height` sometimes stand in for `width`:** when an editor declares no explicit `groupKey` for a token, sibling grouping falls back to matching the final `-<property>` segment. If two unrelated slots both end in `-width` and neither has a `groupKey`, they get auto-linked. Either declare a `groupKey` per token in the editor (preferred) or use an alternative property word. The divider in SegmentedControl uses `--segmentedcontrol-divider-thickness` for legacy parity with the fallback rule, but it now also has `groupKey: 'divider-thickness'` declared in the editor. The `groupKey` is the source of truth.
|
|
121
|
+
|
|
122
|
+
### State order matters
|
|
123
|
+
|
|
124
|
+
State comes **before** the property, not after:
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
--inlineeditactions-save-hover-surface ✓ state before property; siblings on `-surface`
|
|
128
|
+
--inlineeditactions-save-surface-hover ✗ breaks sibling matching and reads oddly
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Linked siblings (the link toggle)
|
|
132
|
+
|
|
133
|
+
Tokens that share a `groupKey` form a **sibling set**. A property declared `canBeLinked: true` in the editor shows a link toggle that lets the user broadcast one value across every sibling. So in SegmentedControl:
|
|
134
|
+
|
|
135
|
+
- `--segmentedcontrol-bar-border-width` and `--segmentedcontrol-selected-border-width` share `groupKey: 'border-width'`.
|
|
136
|
+
- `--segmentedcontrol-option-text-font-weight`, `--segmentedcontrol-option-disabled-text-font-weight`, and `--segmentedcontrol-selected-text-font-weight` share `groupKey: 'font-weight'`.
|
|
137
|
+
|
|
138
|
+
Editor authors declare `groupKey` per token in the editor's token list (and call `registerComponentSchema(component, tokens)` once at module load). The store consults the schema first; for unmigrated editors with no schema entry, it falls back to matching the last `-<property>` segment. Tokens with neither a `groupKey` nor a colliding name suffix are solo.
|
|
139
|
+
|
|
140
|
+
Linkage is **dev-declared** — the editor schema is the source of truth for which variables share a `groupKey`. Users only choose whether to opt out of an existing link (per-property), never to add or reshape one.
|
|
141
|
+
|
|
142
|
+
The `unlinked` array on a `ComponentSlice` stores the variable names the user has explicitly detached. The remaining declared siblings stay linked to each other; an unlinked variable rejoins via `setComponentAliasLinked` or `relinkComponentProperty`.
|
|
143
|
+
|
|
144
|
+
### Typography slot scoping
|
|
145
|
+
|
|
146
|
+
When a component declares more than one typography slot — e.g. a notification with separate `title` and `text` slots — every typography `groupKey` (`font-family`, `font-size`, `font-weight`, `line-height`) **must** include the slot name as a prefix:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
groupKey: 'title-font-family', 'text-font-family' ✓ one link tree per slot
|
|
150
|
+
groupKey: 'font-family' ✗ silently links title and text together
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
A bare typography `groupKey` like `'font-family'` is fine when the component has only one typography slot (Button has only `text`; RadioButton only `label`; CollapsibleSection only `label`). Add a slot prefix the moment the component grows a second slot.
|
|
154
|
+
|
|
155
|
+
`registerComponentSchema` emits a console warning at runtime if a single `groupKey` covers variables whose name-derived slots differ. Treat that warning as a build-time error.
|
|
156
|
+
|
|
157
|
+
### When the last-dash fallback surprises you
|
|
158
|
+
|
|
159
|
+
For tokens without an explicit `groupKey`, the store derives one by splitting on the last dash:
|
|
160
|
+
|
|
161
|
+
- `--segmentedcontrol-option-text-font-weight` → fallback groupKey `weight`.
|
|
162
|
+
|
|
163
|
+
So the fallback property is always the literal last segment. If you don't want a token to participate in the fallback grouping, declare an explicit `groupKey` (or omit `canBeLinked`).
|
|
164
|
+
|
|
165
|
+
## Checklist for adding a new component token
|
|
166
|
+
|
|
167
|
+
1. Does the value belong at the **theme layer**? (It's a color or scale that multiple components could reuse.) → Add it to `tokens.css` under the correct category, not here.
|
|
168
|
+
2. Pick a **componentId** matching the one used in `component-configs/` and the editor's `const component = '...'` literal.
|
|
169
|
+
3. Build the name as `--<componentId>-<part>[-<state>]-<property>`.
|
|
170
|
+
4. Use **full words**: no `bg`, no shortened component IDs.
|
|
171
|
+
5. Declare the slot in both the component's Svelte `<style>` (`--tok: var(--theme-alias);`) and the config JSON (`"--tok": "--theme-alias"`).
|
|
172
|
+
6. If the slot should link across variants, add `canBeLinked: true` and `groupKey: '<your-key>'` in the editor's token list. Siblings are tokens that share the same `groupKey`. Pick a `groupKey` that names the kind of property (`radius`, `border-width`, `font-weight`, `font-family`, etc.); a unique key isolates a token from any other. For typography on multi-slot components, prefix the slot name (see "Typography slot scoping").
|
|
173
|
+
7. Make sure the editor calls `registerComponentSchema(component, tokens)` once at module load so the store sees the explicit groupKeys.
|
|
174
|
+
|
|
175
|
+
## What's still pending
|
|
176
|
+
|
|
177
|
+
- **`primary` → `brand` rename.** Disambiguates the emphasis-tier, color-family, and component-variant uses of "primary." Tracked in `temp/primary-to-brand-rename.md`.
|
|
178
|
+
- **Theme-layer cleanups** tracked in `temp/theme-token-improvements.md`: font-weight scale normalization, bare-word orphan audit, full `bg` → `canvas` sweep.
|
|
@@ -4,17 +4,20 @@
|
|
|
4
4
|
/* Adobe Typekit — fira-code */
|
|
5
5
|
@import url('https://use.typekit.net/jes8oow.css');
|
|
6
6
|
|
|
7
|
+
/* Google Fonts — Arvo (display) */
|
|
8
|
+
@import url('https://fonts.googleapis.com/css2?family=Arvo:ital,wght@0,400;0,700;1,400;1,700&display=swap');
|
|
9
|
+
|
|
7
10
|
/* Local — Fraunces */
|
|
8
11
|
@font-face {
|
|
9
12
|
font-family: "Fraunces";
|
|
10
|
-
src: url('/src/styles/fonts/Fraunces/Fraunces-roman-latin.woff2') format('woff2');
|
|
13
|
+
src: url('/src/system/styles/fonts/Fraunces/Fraunces-roman-latin.woff2') format('woff2');
|
|
11
14
|
font-weight: 100 900;
|
|
12
15
|
font-style: normal;
|
|
13
16
|
font-display: swap;
|
|
14
17
|
}
|
|
15
18
|
@font-face {
|
|
16
19
|
font-family: "Fraunces";
|
|
17
|
-
src: url('/src/styles/fonts/Fraunces/Fraunces-italic-latin.woff2') format('woff2');
|
|
20
|
+
src: url('/src/system/styles/fonts/Fraunces/Fraunces-italic-latin.woff2') format('woff2');
|
|
18
21
|
font-weight: 100 900;
|
|
19
22
|
font-style: italic;
|
|
20
23
|
font-display: swap;
|
|
@@ -23,7 +26,7 @@
|
|
|
23
26
|
/* Local — Manrope */
|
|
24
27
|
@font-face {
|
|
25
28
|
font-family: "Manrope";
|
|
26
|
-
src: url('/src/styles/fonts/Manrope/Manrope-latin.woff2') format('woff2');
|
|
29
|
+
src: url('/src/system/styles/fonts/Manrope/Manrope-latin.woff2') format('woff2');
|
|
27
30
|
font-weight: 200 800;
|
|
28
31
|
font-style: normal;
|
|
29
32
|
font-display: swap;
|
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
--radius-full: 9999px;
|
|
421
421
|
|
|
422
422
|
/* Border Width */
|
|
423
|
-
--border-width-0:
|
|
423
|
+
--border-width-0: 0px;
|
|
424
424
|
--border-width-1: 1px;
|
|
425
425
|
--border-width-2: 2px;
|
|
426
426
|
--border-width-3: 3px;
|
|
@@ -491,11 +491,11 @@
|
|
|
491
491
|
═══════════════════════════════════════════════════════ */
|
|
492
492
|
--columns-count: 12;
|
|
493
493
|
--columns-max-width: 1440px;
|
|
494
|
-
--columns-gutter:
|
|
495
|
-
--columns-margin:
|
|
494
|
+
--columns-gutter: 11px;
|
|
495
|
+
--columns-margin: 0px;
|
|
496
496
|
|
|
497
497
|
/* Font Families */
|
|
498
|
-
--font-display: "Fraunces", serif;
|
|
498
|
+
--font-display: "Arvo", "Fraunces", serif;
|
|
499
499
|
--font-sans: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, sans-serif;
|
|
500
500
|
--font-serif: "Fraunces", serif;
|
|
501
501
|
--font-mono: "fira-code", ui-monospace, "SF Mono", Menlo, Consolas, monospace, monospace;
|
|
@@ -666,16 +666,10 @@
|
|
|
666
666
|
--card-default-title: var(--text-primary);
|
|
667
667
|
--card-default-body: var(--text-secondary);
|
|
668
668
|
--card-default-radius: var(--radius-lg);
|
|
669
|
-
--card-hover-surface: color-mix(in srgb, var(--surface-neutral-lower) 90%, transparent);
|
|
670
669
|
--card-hover-border: var(--border-neutral);
|
|
671
|
-
--card-hover-title: var(--text-primary);
|
|
672
|
-
--card-hover-body: var(--text-secondary);
|
|
673
|
-
--card-hover-radius: var(--radius-lg);
|
|
674
670
|
--card-hover-shadow: var(--shadow-sm);
|
|
675
671
|
--card-default-shadow: var(--shadow-sm);
|
|
676
|
-
--card-hover-header-surface: var(--surface-neutral-high);
|
|
677
672
|
--card-default-header-surface: var(--surface-neutral);
|
|
678
|
-
--card-hover-border-width: var(--border-width-1);
|
|
679
673
|
--card-default-border-width: var(--border-width-1);
|
|
680
674
|
--collapsiblesection-container-frame-surface: var(--surface-canvas-high);
|
|
681
675
|
--collapsiblesection-container-frame-border-width: var(--border-width-3);
|
|
@@ -1301,24 +1295,150 @@
|
|
|
1301
1295
|
|
|
1302
1296
|
/* component-aliases:start */
|
|
1303
1297
|
:root:root {
|
|
1304
|
-
/*
|
|
1305
|
-
--
|
|
1306
|
-
--
|
|
1307
|
-
--
|
|
1308
|
-
--
|
|
1309
|
-
--
|
|
1310
|
-
--
|
|
1311
|
-
--
|
|
1312
|
-
--
|
|
1313
|
-
--
|
|
1314
|
-
--
|
|
1315
|
-
|
|
1316
|
-
--
|
|
1317
|
-
--
|
|
1318
|
-
--
|
|
1319
|
-
--
|
|
1320
|
-
--
|
|
1321
|
-
--
|
|
1322
|
-
--
|
|
1298
|
+
/* badge (my-badge) */
|
|
1299
|
+
--badge-primary-radius: var(--radius-md);
|
|
1300
|
+
--badge-accent-radius: var(--radius-md);
|
|
1301
|
+
--badge-neutral-radius: var(--radius-md);
|
|
1302
|
+
--badge-alternate-radius: var(--radius-md);
|
|
1303
|
+
--badge-canvas-radius: var(--radius-md);
|
|
1304
|
+
--badge-special-radius: var(--radius-md);
|
|
1305
|
+
--badge-success-radius: var(--radius-md);
|
|
1306
|
+
--badge-warning-radius: var(--radius-md);
|
|
1307
|
+
--badge-danger-radius: var(--radius-md);
|
|
1308
|
+
--badge-info-radius: var(--radius-md);
|
|
1309
|
+
/* callout (my-callout) */
|
|
1310
|
+
--callout-info-border-width: var(--border-width-2);
|
|
1311
|
+
--callout-info-label-font-family: var(--font-sans);
|
|
1312
|
+
--callout-info-label-font-weight: var(--font-weight-semibold);
|
|
1313
|
+
--callout-info-text-font-family: var(--font-sans);
|
|
1314
|
+
--callout-success-border-width: var(--border-width-2);
|
|
1315
|
+
--callout-success-label-font-family: var(--font-sans);
|
|
1316
|
+
--callout-success-label-font-weight: var(--font-weight-semibold);
|
|
1317
|
+
--callout-success-text-font-family: var(--font-sans);
|
|
1318
|
+
--callout-warning-border-width: var(--border-width-2);
|
|
1319
|
+
--callout-warning-label-font-family: var(--font-sans);
|
|
1320
|
+
--callout-warning-label-font-weight: var(--font-weight-semibold);
|
|
1321
|
+
--callout-warning-text-font-family: var(--font-sans);
|
|
1322
|
+
--callout-danger-border-width: var(--border-width-2);
|
|
1323
|
+
--callout-danger-label-font-family: var(--font-sans);
|
|
1324
|
+
--callout-danger-label-font-weight: var(--font-weight-semibold);
|
|
1325
|
+
--callout-danger-text-font-family: var(--font-sans);
|
|
1326
|
+
/* card (my-card) */
|
|
1327
|
+
--card-default-surface: var(color-mix(in srgb, var(--surface-neutral-low) 95%, transparent));
|
|
1328
|
+
--card-default-header-surface: var(color-mix(in srgb, var(--surface-neutral-lower) 85%, transparent));
|
|
1329
|
+
--card-default-title-font-weight: var(--font-weight-semibold);
|
|
1330
|
+
--card-default-header-padding-top: var(--space-8);
|
|
1331
|
+
--card-default-header-padding-right: var(--space-16);
|
|
1332
|
+
--card-default-header-padding-bottom: var(--space-8);
|
|
1333
|
+
--card-default-header-padding-left: var(--space-16);
|
|
1334
|
+
/* cornerbadge (my-corner-badge) */
|
|
1335
|
+
--corner-badge-primary-text-font-size: var(--font-size-xs);
|
|
1336
|
+
--corner-badge-accent-text-font-size: var(--font-size-xs);
|
|
1337
|
+
--corner-badge-neutral-text-font-size: var(--font-size-xs);
|
|
1338
|
+
--corner-badge-alternate-text-font-size: var(--font-size-xs);
|
|
1339
|
+
--corner-badge-canvas-text-font-size: var(--font-size-xs);
|
|
1340
|
+
--corner-badge-special-text-font-size: var(--font-size-xs);
|
|
1341
|
+
--corner-badge-success-text-font-size: var(--font-size-xs);
|
|
1342
|
+
--corner-badge-warning-text-font-size: var(--font-size-xs);
|
|
1343
|
+
--corner-badge-danger-text-font-size: var(--font-size-xs);
|
|
1344
|
+
--corner-badge-info-text-font-size: var(--font-size-xs);
|
|
1345
|
+
/* dialog (my-dialog) */
|
|
1346
|
+
--dialog-overlay-surface: var(color-mix(in srgb, var(--surface-neutral-lowest) 65%, transparent));
|
|
1347
|
+
/* progressbar (my-progress-bar) */
|
|
1348
|
+
--progressbar-primary-fill: var(--color-brand-400);
|
|
1349
|
+
--progressbar-success-fill: var(--color-success-400);
|
|
1350
|
+
--progressbar-warning-fill: var(--color-warning-400);
|
|
1351
|
+
--progressbar-danger-fill: var(--color-danger-400);
|
|
1352
|
+
--progressbar-info-fill: var(--color-info-400);
|
|
1353
|
+
/* sectiondivider (my-section-divider) */
|
|
1354
|
+
--sectiondivider-canvas-title-font-family: var(--font-sans);
|
|
1355
|
+
--sectiondivider-canvas-title-font-weight: var(--font-weight-bold);
|
|
1356
|
+
--sectiondivider-canvas-title-border-width: var(--border-width-6);
|
|
1357
|
+
--sectiondivider-canvas-title-stroke-color: var(color-mix(in srgb, var(--surface-canvas-lowest) 30%, transparent));
|
|
1358
|
+
--sectiondivider-canvas-gradient-stop-1-color: var(color-mix(in srgb, var(--surface-canvas-highest) 85%, transparent));
|
|
1359
|
+
--sectiondivider-canvas-gradient-stop-1-position: var(0%);
|
|
1360
|
+
--sectiondivider-canvas-gradient-stop-2-color: var(color-mix(in srgb, var(--surface-canvas-higher) 60%, transparent));
|
|
1361
|
+
--sectiondivider-canvas-gradient-stop-2-position: var(35%);
|
|
1362
|
+
--sectiondivider-canvas-gradient-stop-3-color: var(color-mix(in srgb, var(--surface-canvas) 75%, transparent));
|
|
1363
|
+
--sectiondivider-canvas-gradient-stop-3-position: var(100%);
|
|
1364
|
+
--sectiondivider-canvas-border: var(--border-canvas-medium);
|
|
1365
|
+
--sectiondivider-canvas-border-width: var(--border-width-2);
|
|
1366
|
+
--sectiondivider-neutral-title-font-family: var(--font-sans);
|
|
1367
|
+
--sectiondivider-neutral-title-font-weight: var(--font-weight-bold);
|
|
1368
|
+
--sectiondivider-neutral-title-border-width: var(--border-width-6);
|
|
1369
|
+
--sectiondivider-neutral-title-stroke-color: var(color-mix(in srgb, var(--surface-neutral-lowest) 30%, transparent));
|
|
1370
|
+
--sectiondivider-neutral-gradient-stop-1-color: var(color-mix(in srgb, var(--surface-neutral-highest) 85%, transparent));
|
|
1371
|
+
--sectiondivider-neutral-gradient-stop-1-position: var(0%);
|
|
1372
|
+
--sectiondivider-neutral-gradient-stop-2-color: var(color-mix(in srgb, var(--surface-neutral-higher) 60%, transparent));
|
|
1373
|
+
--sectiondivider-neutral-gradient-stop-2-position: var(35%);
|
|
1374
|
+
--sectiondivider-neutral-gradient-stop-3-color: var(color-mix(in srgb, var(--surface-neutral) 75%, transparent));
|
|
1375
|
+
--sectiondivider-neutral-gradient-stop-3-position: var(100%);
|
|
1376
|
+
--sectiondivider-neutral-border: var(--border-neutral-medium);
|
|
1377
|
+
--sectiondivider-neutral-border-width: var(--border-width-2);
|
|
1378
|
+
--sectiondivider-alternate-title-font-family: var(--font-sans);
|
|
1379
|
+
--sectiondivider-alternate-title-font-weight: var(--font-weight-bold);
|
|
1380
|
+
--sectiondivider-alternate-title-border-width: var(--border-width-6);
|
|
1381
|
+
--sectiondivider-alternate-title-stroke-color: var(color-mix(in srgb, var(--surface-alternate-lowest) 30%, transparent));
|
|
1382
|
+
--sectiondivider-alternate-gradient-stop-1-color: var(color-mix(in srgb, var(--surface-alternate-highest) 85%, transparent));
|
|
1383
|
+
--sectiondivider-alternate-gradient-stop-1-position: var(0%);
|
|
1384
|
+
--sectiondivider-alternate-gradient-stop-2-color: var(color-mix(in srgb, var(--surface-alternate-higher) 60%, transparent));
|
|
1385
|
+
--sectiondivider-alternate-gradient-stop-2-position: var(35%);
|
|
1386
|
+
--sectiondivider-alternate-gradient-stop-3-color: var(color-mix(in srgb, var(--surface-alternate) 75%, transparent));
|
|
1387
|
+
--sectiondivider-alternate-gradient-stop-3-position: var(100%);
|
|
1388
|
+
--sectiondivider-alternate-border: var(--border-alternate-medium);
|
|
1389
|
+
--sectiondivider-alternate-border-width: var(--border-width-2);
|
|
1390
|
+
--sectiondivider-primary-title-font-family: var(--font-sans);
|
|
1391
|
+
--sectiondivider-primary-title-font-weight: var(--font-weight-bold);
|
|
1392
|
+
--sectiondivider-primary-title-border-width: var(--border-width-6);
|
|
1393
|
+
--sectiondivider-primary-title-stroke-color: var(color-mix(in srgb, var(--surface-brand-lowest) 30%, transparent));
|
|
1394
|
+
--sectiondivider-primary-gradient-stop-1-color: var(color-mix(in srgb, var(--surface-brand-highest) 85%, transparent));
|
|
1395
|
+
--sectiondivider-primary-gradient-stop-1-position: var(0%);
|
|
1396
|
+
--sectiondivider-primary-gradient-stop-2-color: var(color-mix(in srgb, var(--surface-brand-higher) 60%, transparent));
|
|
1397
|
+
--sectiondivider-primary-gradient-stop-2-position: var(35%);
|
|
1398
|
+
--sectiondivider-primary-gradient-stop-3-color: var(color-mix(in srgb, var(--surface-brand) 75%, transparent));
|
|
1399
|
+
--sectiondivider-primary-gradient-stop-3-position: var(100%);
|
|
1400
|
+
--sectiondivider-primary-border: var(--border-brand-medium);
|
|
1401
|
+
--sectiondivider-primary-border-width: var(--border-width-2);
|
|
1402
|
+
--sectiondivider-accent-title-font-family: var(--font-sans);
|
|
1403
|
+
--sectiondivider-accent-title-font-weight: var(--font-weight-bold);
|
|
1404
|
+
--sectiondivider-accent-title-border-width: var(--border-width-6);
|
|
1405
|
+
--sectiondivider-accent-title-stroke-color: var(color-mix(in srgb, var(--surface-accent-lowest) 30%, transparent));
|
|
1406
|
+
--sectiondivider-accent-description: var(--text-accent);
|
|
1407
|
+
--sectiondivider-accent-gradient-stop-1-color: var(color-mix(in srgb, var(--surface-accent-highest) 85%, transparent));
|
|
1408
|
+
--sectiondivider-accent-gradient-stop-1-position: var(0%);
|
|
1409
|
+
--sectiondivider-accent-gradient-stop-2-color: var(color-mix(in srgb, var(--surface-accent-higher) 60%, transparent));
|
|
1410
|
+
--sectiondivider-accent-gradient-stop-2-position: var(35%);
|
|
1411
|
+
--sectiondivider-accent-gradient-stop-3-color: var(color-mix(in srgb, var(--surface-accent-low) 75%, transparent));
|
|
1412
|
+
--sectiondivider-accent-gradient-stop-3-position: var(100%);
|
|
1413
|
+
--sectiondivider-accent-border: var(--border-accent-medium);
|
|
1414
|
+
--sectiondivider-accent-border-width: var(--border-width-2);
|
|
1415
|
+
--sectiondivider-special-title-font-family: var(--font-sans);
|
|
1416
|
+
--sectiondivider-special-title-font-weight: var(--font-weight-bold);
|
|
1417
|
+
--sectiondivider-special-title-border-width: var(--border-width-6);
|
|
1418
|
+
--sectiondivider-special-title-stroke-color: var(color-mix(in srgb, var(--surface-special-lowest) 30%, transparent));
|
|
1419
|
+
--sectiondivider-special-gradient-stop-1-color: var(color-mix(in srgb, var(--surface-special-highest) 85%, transparent));
|
|
1420
|
+
--sectiondivider-special-gradient-stop-1-position: var(0%);
|
|
1421
|
+
--sectiondivider-special-gradient-stop-2-color: var(color-mix(in srgb, var(--surface-special-higher) 60%, transparent));
|
|
1422
|
+
--sectiondivider-special-gradient-stop-2-position: var(35%);
|
|
1423
|
+
--sectiondivider-special-gradient-stop-3-color: var(color-mix(in srgb, var(--surface-special) 75%, transparent));
|
|
1424
|
+
--sectiondivider-special-gradient-stop-3-position: var(100%);
|
|
1425
|
+
--sectiondivider-special-border: var(--border-special-medium);
|
|
1426
|
+
--sectiondivider-special-border-width: var(--border-width-2);
|
|
1427
|
+
/* segmentedcontrol (my-segmented-control) */
|
|
1428
|
+
--segmentedcontrol-bar-surface: var(--surface-neutral-lower);
|
|
1429
|
+
--segmentedcontrol-option-text: var(--text-secondary);
|
|
1430
|
+
--segmentedcontrol-option-hover-icon: var(--text-primary);
|
|
1431
|
+
--segmentedcontrol-selected-surface: var(--surface-brand);
|
|
1432
|
+
--segmentedcontrol-selected-text-font-weight: var(--font-weight-normal);
|
|
1433
|
+
--segmentedcontrol-selected-icon: var(--text-primary);
|
|
1434
|
+
--segmentedcontrol-selected-border: var(--border-brand-medium);
|
|
1435
|
+
--segmentedcontrol-disabled-surface: var(transparent);
|
|
1436
|
+
/* table (my-table) */
|
|
1437
|
+
--table-default-header-surface: var(--surface-neutral-lower);
|
|
1438
|
+
--table-default-header-font-weight: var(--font-weight-semibold);
|
|
1439
|
+
--table-default-header-border: var(--border-neutral);
|
|
1440
|
+
--table-default-row-divider: var(--border-neutral);
|
|
1441
|
+
--table-default-row-stripe-surface: var(color-mix(in srgb, var(--surface-neutral-lower) 50%, transparent));
|
|
1442
|
+
--table-default-row-surface: var(color-mix(in srgb, var(--surface-neutral) 70%, transparent));
|
|
1323
1443
|
}
|
|
1324
1444
|
/* component-aliases:end */
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
import type { Token } from './scaffolding/types';
|
|
3
|
-
|
|
4
|
-
export const component = 'image';
|
|
5
|
-
|
|
6
|
-
// Single object: image frame.
|
|
7
|
-
const states: Record<string, Token[]> = {
|
|
8
|
-
image: [
|
|
9
|
-
{ label: 'border color', groupKey: 'border', variable: '--image-default-border' },
|
|
10
|
-
{ label: 'border width', groupKey: 'width', variable: '--image-default-border-width' },
|
|
11
|
-
{ label: 'corner radius', groupKey: 'radius', variable: '--image-default-radius' },
|
|
12
|
-
{ label: 'image shadow', groupKey: 'shadow', variable: '--image-default-shadow' },
|
|
13
|
-
],
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const allTokens: Token[] = Object.values(states).flat();
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<script lang="ts">
|
|
20
|
-
import { onMount } from 'svelte';
|
|
21
|
-
import Image from '../components/Image.svelte';
|
|
22
|
-
import VariantGroup from './scaffolding/VariantGroup.svelte';
|
|
23
|
-
import ComponentEditorBase from './scaffolding/ComponentEditorBase.svelte';
|
|
24
|
-
import demoImageUrl from '../assets/offering.webp';
|
|
25
|
-
import ShadowBackdrop from './scaffolding/ShadowBackdrop.svelte';
|
|
26
|
-
import UIPaletteSelector from '../ui/UIPaletteSelector.svelte';
|
|
27
|
-
import { setCssVar } from '../lib/cssVarSync';
|
|
28
|
-
|
|
29
|
-
const bgVar = '--backdrop-image-surface';
|
|
30
|
-
|
|
31
|
-
onMount(() => {
|
|
32
|
-
if (!document.documentElement.style.getPropertyValue(bgVar)) {
|
|
33
|
-
setCssVar(bgVar, 'var(--surface-canvas)');
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<ComponentEditorBase {component} title="Image" description="Framed image with rounded corners, border, and shadow. Import from <code>components/Image.svelte</code>" tokens={allTokens}>
|
|
39
|
-
{#snippet config()}
|
|
40
|
-
|
|
41
|
-
<label class="backdrop-config">
|
|
42
|
-
<span>Sample background</span>
|
|
43
|
-
<div class="picker-slot">
|
|
44
|
-
<UIPaletteSelector variable={bgVar} />
|
|
45
|
-
</div>
|
|
46
|
-
</label>
|
|
47
|
-
|
|
48
|
-
{/snippet}
|
|
49
|
-
<VariantGroup name="image" title="Image" {states} {component}>
|
|
50
|
-
<ShadowBackdrop mode="color" colorVariable={bgVar}>
|
|
51
|
-
<div class="image-demo-grid">
|
|
52
|
-
<Image src={demoImageUrl} alt="Demo" variant="banner" />
|
|
53
|
-
</div>
|
|
54
|
-
</ShadowBackdrop>
|
|
55
|
-
</VariantGroup>
|
|
56
|
-
</ComponentEditorBase>
|
|
57
|
-
|
|
58
|
-
<style>
|
|
59
|
-
.image-demo-grid {
|
|
60
|
-
display: grid;
|
|
61
|
-
place-items: center;
|
|
62
|
-
}
|
|
63
|
-
.backdrop-config {
|
|
64
|
-
display: inline-flex;
|
|
65
|
-
align-items: center;
|
|
66
|
-
gap: var(--ui-space-8);
|
|
67
|
-
}
|
|
68
|
-
.picker-slot {
|
|
69
|
-
min-width: 8rem;
|
|
70
|
-
}
|
|
71
|
-
.picker-slot :global(.ui-token-selector) {
|
|
72
|
-
width: 100%;
|
|
73
|
-
}
|
|
74
|
-
</style>
|