@lanfermann/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/README.md +17 -2
- package/TRADEMARK.md +10 -0
- package/brand/app-icon.svg +1 -0
- package/brand/avatar.svg +1 -0
- package/brand/favicon.svg +1 -0
- package/dist/components/accordion/accordion.d.ts +26 -0
- package/dist/components/accordion/accordion.js +78 -0
- package/dist/components/alert/alert.d.ts +19 -0
- package/dist/components/alert/alert.js +68 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +20 -0
- package/dist/components/alert-dialog/alert-dialog.js +75 -0
- package/dist/components/anchor-heading/anchor-heading.d.ts +19 -0
- package/dist/components/anchor-heading/anchor-heading.js +39 -0
- package/dist/components/avatar/avatar.d.ts +14 -0
- package/dist/components/avatar/avatar.js +42 -0
- package/dist/components/badge/badge.d.ts +12 -0
- package/dist/components/badge/badge.js +27 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +23 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +63 -0
- package/dist/components/button/button-variants.d.ts +15 -0
- package/dist/components/button/button-variants.js +76 -0
- package/dist/components/button/button.d.ts +25 -0
- package/dist/components/button/button.js +50 -0
- package/dist/components/calendar/calendar-selection.js +216 -0
- package/dist/components/calendar/calendar.d.ts +44 -0
- package/dist/components/calendar/calendar.js +208 -0
- package/dist/components/callout/callout.d.ts +21 -0
- package/dist/components/callout/callout.js +75 -0
- package/dist/components/card/card.d.ts +16 -0
- package/dist/components/card/card.js +53 -0
- package/dist/components/checkbox/checkbox.d.ts +9 -0
- package/dist/components/checkbox/checkbox.js +33 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +18 -0
- package/dist/components/checkbox-group/checkbox-group.js +33 -0
- package/dist/components/code/code.d.ts +7 -0
- package/dist/components/code/code.js +16 -0
- package/dist/components/code-block/code-block-frame.js +146 -0
- package/dist/components/code-block/code-block-live.d.ts +45 -0
- package/dist/components/code-block/code-block-live.js +51 -0
- package/dist/components/code-block/code-block.d.ts +36 -0
- package/dist/components/code-block/code-block.js +51 -0
- package/dist/components/code-block/code-copy.d.ts +12 -0
- package/dist/components/code-block/code-copy.js +71 -0
- package/dist/components/code-block/code-lines-view.d.ts +16 -0
- package/dist/components/code-block/code-lines-view.js +48 -0
- package/dist/components/code-block/code-lines.js +17 -0
- package/dist/components/code-block/code-scroll.js +29 -0
- package/dist/components/code-block/code-surface.js +13 -0
- package/dist/components/code-block/code-tabs-frame.js +85 -0
- package/dist/components/code-block/code-tabs-store.js +25 -0
- package/dist/components/code-block/code-tabs.d.ts +28 -0
- package/dist/components/code-block/code-tabs.js +29 -0
- package/dist/components/code-block/highlight.d.ts +34 -0
- package/dist/components/code-block/highlight.js +258 -0
- package/dist/components/code-block/lines.d.ts +5 -0
- package/dist/components/code-block/lines.js +40 -0
- package/dist/components/collapsible/collapsible.d.ts +19 -0
- package/dist/components/collapsible/collapsible.js +54 -0
- package/dist/components/combobox/combobox.d.ts +84 -0
- package/dist/components/combobox/combobox.js +169 -0
- package/dist/components/container/container.d.ts +16 -0
- package/dist/components/container/container.js +30 -0
- package/dist/components/copy-pill/copy-pill.d.ts +52 -0
- package/dist/components/copy-pill/copy-pill.js +232 -0
- package/dist/components/cta/cta.d.ts +109 -0
- package/dist/components/cta/cta.js +375 -0
- package/dist/components/date-field/date-field.d.ts +40 -0
- package/dist/components/date-field/date-field.js +99 -0
- package/dist/components/date-range-field/date-range-field.d.ts +41 -0
- package/dist/components/date-range-field/date-range-field.js +155 -0
- package/dist/components/dialog/dialog.d.ts +29 -0
- package/dist/components/dialog/dialog.js +96 -0
- package/dist/components/docs-layout/docs-layout.d.ts +17 -0
- package/dist/components/docs-layout/docs-layout.js +46 -0
- package/dist/components/drawer/drawer.d.ts +39 -0
- package/dist/components/drawer/drawer.js +181 -0
- package/dist/components/field/field.d.ts +18 -0
- package/dist/components/field/field.js +77 -0
- package/dist/components/fieldset/fieldset.d.ts +8 -0
- package/dist/components/fieldset/fieldset.js +25 -0
- package/dist/components/figure/figure.d.ts +14 -0
- package/dist/components/figure/figure.js +35 -0
- package/dist/components/form/form.d.ts +31 -0
- package/dist/components/form/form.js +55 -0
- package/dist/components/ground/ground.d.ts +20 -0
- package/dist/components/ground/ground.js +31 -0
- package/dist/components/heading/heading.d.ts +16 -0
- package/dist/components/heading/heading.js +36 -0
- package/dist/components/icon/icon.d.ts +22 -0
- package/dist/components/icon/icon.js +24 -0
- package/dist/components/input/input.d.ts +19 -0
- package/dist/components/input/input.js +46 -0
- package/dist/components/input-group/input-group.d.ts +34 -0
- package/dist/components/input-group/input-group.js +61 -0
- package/dist/components/kbd/kbd.d.ts +6 -0
- package/dist/components/kbd/kbd.js +15 -0
- package/dist/components/link/link-variants.d.ts +13 -0
- package/dist/components/link/link-variants.js +27 -0
- package/dist/components/link/link.d.ts +9 -0
- package/dist/components/link/link.js +18 -0
- package/dist/components/logo/logo-paths.js +22 -0
- package/dist/components/logo/logomark.d.ts +19 -0
- package/dist/components/logo/logomark.js +49 -0
- package/dist/components/logo/wordmark.d.ts +35 -0
- package/dist/components/logo/wordmark.js +48 -0
- package/dist/components/menu/menu.d.ts +26 -0
- package/dist/components/menu/menu.js +132 -0
- package/dist/components/meter/meter.d.ts +29 -0
- package/dist/components/meter/meter.js +68 -0
- package/dist/components/navigation-menu/navigation-menu-variants.d.ts +12 -0
- package/dist/components/navigation-menu/navigation-menu-variants.js +18 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +42 -0
- package/dist/components/navigation-menu/navigation-menu.js +128 -0
- package/dist/components/number-field/number-field.d.ts +32 -0
- package/dist/components/number-field/number-field.js +85 -0
- package/dist/components/page-header/page-header.d.ts +27 -0
- package/dist/components/page-header/page-header.js +48 -0
- package/dist/components/pager/pager.d.ts +24 -0
- package/dist/components/pager/pager.js +51 -0
- package/dist/components/parameter-list/parameter-list.d.ts +34 -0
- package/dist/components/parameter-list/parameter-list.js +70 -0
- package/dist/components/popover/popover.d.ts +15 -0
- package/dist/components/popover/popover.js +64 -0
- package/dist/components/progress/progress.d.ts +19 -0
- package/dist/components/progress/progress.js +67 -0
- package/dist/components/prose/prose.d.ts +13 -0
- package/dist/components/prose/prose.js +22 -0
- package/dist/components/quote/quote.d.ts +21 -0
- package/dist/components/quote/quote.js +46 -0
- package/dist/components/radio/radio.d.ts +12 -0
- package/dist/components/radio/radio.js +37 -0
- package/dist/components/reference-entry/reference-entry.d.ts +25 -0
- package/dist/components/reference-entry/reference-entry.js +66 -0
- package/dist/components/section/section.d.ts +13 -0
- package/dist/components/section/section.js +30 -0
- package/dist/components/segmented-control/segmented-control.d.ts +42 -0
- package/dist/components/segmented-control/segmented-control.js +413 -0
- package/dist/components/select/select.d.ts +70 -0
- package/dist/components/select/select.js +189 -0
- package/dist/components/separator/separator.d.ts +12 -0
- package/dist/components/separator/separator.js +29 -0
- package/dist/components/side-nav/side-nav.d.ts +48 -0
- package/dist/components/side-nav/side-nav.js +89 -0
- package/dist/components/site-footer/site-footer-floor.js +48 -0
- package/dist/components/site-footer/site-footer.d.ts +38 -0
- package/dist/components/site-footer/site-footer.js +96 -0
- package/dist/components/site-header/site-header.d.ts +77 -0
- package/dist/components/site-header/site-header.js +214 -0
- package/dist/components/slider/slider.d.ts +42 -0
- package/dist/components/slider/slider.js +279 -0
- package/dist/components/spinner/spinner.d.ts +15 -0
- package/dist/components/spinner/spinner.js +34 -0
- package/dist/components/switch/switch.d.ts +8 -0
- package/dist/components/switch/switch.js +28 -0
- package/dist/components/table/table.d.ts +83 -0
- package/dist/components/table/table.js +123 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +32 -0
- package/dist/components/table-of-contents/table-of-contents.js +187 -0
- package/dist/components/tabs/tabs.d.ts +28 -0
- package/dist/components/tabs/tabs.js +124 -0
- package/dist/components/text/text.d.ts +16 -0
- package/dist/components/text/text.js +63 -0
- package/dist/components/textarea/textarea.d.ts +19 -0
- package/dist/components/textarea/textarea.js +30 -0
- package/dist/components/time-field/time-field.d.ts +40 -0
- package/dist/components/time-field/time-field.js +123 -0
- package/dist/components/toast/toast.d.ts +55 -0
- package/dist/components/toast/toast.js +129 -0
- package/dist/components/tooltip/tooltip.d.ts +16 -0
- package/dist/components/tooltip/tooltip.js +41 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +77 -0
- package/dist/internal/arrow.js +41 -0
- package/dist/internal/disclosure.js +20 -0
- package/dist/internal/field-context.js +21 -0
- package/dist/internal/field.d.ts +23 -0
- package/dist/internal/field.js +49 -0
- package/dist/internal/glyphs.js +84 -0
- package/dist/internal/iso-date.d.ts +2 -0
- package/dist/internal/iso-date.js +268 -0
- package/dist/internal/overlay.js +40 -0
- package/dist/internal/picker-sheet.js +74 -0
- package/dist/internal/popup.js +37 -0
- package/dist/internal/range-shape.js +295 -0
- package/dist/internal/reduced-motion.js +19 -0
- package/dist/internal/scroll-edges.js +45 -0
- package/dist/internal/trough.js +39 -0
- package/dist/internal/typed-input.d.ts +16 -0
- package/dist/internal/typed-input.js +133 -0
- package/dist/lib/cn.d.ts +11 -0
- package/dist/lib/cn.js +98 -0
- package/dist/motion/inertia.js +111 -0
- package/dist/motion/spring-step.js +35 -0
- package/dist/motion/springs.d.ts +78 -0
- package/dist/motion/springs.js +81 -0
- package/package.json +107 -4
- package/src/styles/base.css +93 -0
- package/src/styles/calendar.css +117 -0
- package/src/styles/code.css +252 -0
- package/src/styles/density.css +53 -0
- package/src/styles/depth.css +501 -0
- package/src/styles/grounds.css +191 -0
- package/src/styles/marks.css +50 -0
- package/src/styles/motion.css +55 -0
- package/src/styles/motion.generated.css +101 -0
- package/src/styles/prose.css +252 -0
- package/src/styles/radius.css +20 -0
- package/src/styles/segmented.css +208 -0
- package/src/styles/slider.css +110 -0
- package/src/styles/status.css +108 -0
- package/src/styles/tabs.css +39 -0
- package/src/styles/toast.css +106 -0
- package/src/styles/touch.css +41 -0
- package/src/styles/type.css +54 -0
- package/src/styles.css +38 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* What is chosen in a calendar, drawn as one raised shape over the days: a day, or a range.
|
|
3
|
+
*
|
|
4
|
+
* It is the plug's recipe: edge, face, top light, bottom shade and contact shadow, with the
|
|
5
|
+
* tone's knobs from depth.css. But a box-shadow follows a box, and a range over several weeks is
|
|
6
|
+
* a stair. So every layer is the outline itself, cut out with `clip-path`:
|
|
7
|
+
*
|
|
8
|
+
* edge the outline grown by a pixel, under everything: the ring around the shape
|
|
9
|
+
* face the fill and its gloss, one gradient over the whole shape, and on it the numbers
|
|
10
|
+
* of the days in the colour that reads there, cut to the outline like the fill
|
|
11
|
+
* light a pixel along every edge that faces up: the shape, less itself moved down by one
|
|
12
|
+
* shade the same along every edge that faces down
|
|
13
|
+
*
|
|
14
|
+
* The points come from src/internal/range-shape.ts as custom properties: `--shape`, `--shape-edge`
|
|
15
|
+
* and `--shape-start` (the first point, which closes the cut-out of light and shade). They are
|
|
16
|
+
* written in the calendar's units: `--u` (the pitch of the days), `--g` (their gap), `--r` (the
|
|
17
|
+
* corner). The layers keep `--room` around the grid, so the ring and the moved copies are whole.
|
|
18
|
+
*
|
|
19
|
+
* The shape does not move by itself here: when the selection changes, the component rewrites
|
|
20
|
+
* those properties frame by frame (see calendar-selection.tsx). What this file animates is only
|
|
21
|
+
* the seating of a selection made where there was none.
|
|
22
|
+
*/
|
|
23
|
+
@utility calendar-selection {
|
|
24
|
+
--g: var(--calendar-gap);
|
|
25
|
+
--r: var(--radius-md);
|
|
26
|
+
/*
|
|
27
|
+
* The tone's knobs (`--d-*`) do not inherit: they belong to the element that carries the tone.
|
|
28
|
+
* Handed on here under names that do, for the layers inside.
|
|
29
|
+
*/
|
|
30
|
+
--range-edge: var(--d-edge, var(--depth-surface-edge));
|
|
31
|
+
--range-face: var(--d-face, var(--depth-surface-face));
|
|
32
|
+
--range-hi: var(--d-hi, var(--depth-surface-hi));
|
|
33
|
+
--range-lo: var(--d-lo, var(--depth-surface-lo));
|
|
34
|
+
|
|
35
|
+
position: absolute;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
/* Over the six weeks of days: below the row of weekdays, which is as tall as a small control. */
|
|
38
|
+
top: calc(var(--control-sm) + var(--g) - var(--room));
|
|
39
|
+
inset-inline-start: calc(-1 * var(--room));
|
|
40
|
+
width: calc(7 * var(--u) - var(--g) + 2 * var(--room));
|
|
41
|
+
height: calc(6 * var(--u) - var(--g) + 2 * var(--room));
|
|
42
|
+
/* The contact shadow follows the shape, whatever it is. */
|
|
43
|
+
filter: drop-shadow(0 1px 2px var(--d-contact, var(--depth-surface-contact)));
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* Chosen where nothing was, it seats: it grows out of the middle of its first day. The
|
|
47
|
+
* component sets the smaller size and lets go of it; this is the way back.
|
|
48
|
+
*/
|
|
49
|
+
transition:
|
|
50
|
+
scale var(--transition-duration-spring-seat) var(--ease-spring-seat),
|
|
51
|
+
opacity var(--transition-duration-spring-snap) var(--ease-spring-snap);
|
|
52
|
+
|
|
53
|
+
/* Nothing chosen: nothing drawn. */
|
|
54
|
+
&[data-empty] {
|
|
55
|
+
visibility: hidden;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
& > * {
|
|
59
|
+
position: absolute;
|
|
60
|
+
inset: 0;
|
|
61
|
+
}
|
|
62
|
+
& > [data-layer="edge"] {
|
|
63
|
+
background: var(--range-edge);
|
|
64
|
+
clip-path: polygon(var(--shape-edge, 0 0));
|
|
65
|
+
}
|
|
66
|
+
& > [data-layer="face"] {
|
|
67
|
+
background-color: var(--color-accent);
|
|
68
|
+
background-image: var(--range-face);
|
|
69
|
+
clip-path: polygon(var(--shape, 0 0));
|
|
70
|
+
}
|
|
71
|
+
& > [data-layer="light"],
|
|
72
|
+
& > [data-layer="shade"] {
|
|
73
|
+
clip-path: polygon(var(--shape, 0 0));
|
|
74
|
+
}
|
|
75
|
+
/* Everything but the shape: a frame around it, joined to the outline by a line there and back. */
|
|
76
|
+
& > [data-layer="light"]::before,
|
|
77
|
+
& > [data-layer="shade"]::before {
|
|
78
|
+
content: "";
|
|
79
|
+
position: absolute;
|
|
80
|
+
inset: 0;
|
|
81
|
+
clip-path: polygon(
|
|
82
|
+
evenodd,
|
|
83
|
+
-1rem -1rem,
|
|
84
|
+
calc(100% + 1rem) -1rem,
|
|
85
|
+
calc(100% + 1rem) calc(100% + 1rem),
|
|
86
|
+
-1rem calc(100% + 1rem),
|
|
87
|
+
-1rem -1rem,
|
|
88
|
+
var(--shape, 0 0),
|
|
89
|
+
var(--shape-start, 0 0),
|
|
90
|
+
-1rem -1rem
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
& > [data-layer="light"]::before {
|
|
94
|
+
background: var(--range-hi);
|
|
95
|
+
translate: 0 1px;
|
|
96
|
+
}
|
|
97
|
+
& > [data-layer="shade"]::before {
|
|
98
|
+
background: var(--range-lo);
|
|
99
|
+
translate: 0 -1px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@media (prefers-reduced-motion: reduce) {
|
|
103
|
+
transition: none;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@media (forced-colors: active) {
|
|
107
|
+
filter: none;
|
|
108
|
+
& > [data-layer="face"] {
|
|
109
|
+
forced-color-adjust: none;
|
|
110
|
+
background: Highlight;
|
|
111
|
+
color: HighlightText;
|
|
112
|
+
}
|
|
113
|
+
& > :not([data-layer="face"]) {
|
|
114
|
+
display: none;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code: the colours of a code block, per ground. Shiki writes them into the highlighted spans as
|
|
3
|
+
* `var(--lf-code-<role>)` (src/components/code-block/highlight.ts), so a block takes the ground it
|
|
4
|
+
* stands on like every other part, and a nested ground recolours the code inside it.
|
|
5
|
+
*
|
|
6
|
+
* Ten roles, fewer than a code editor's theme on purpose: code here is read, not edited. The
|
|
7
|
+
* plain text is the body colour, punctuation and comments are muted, and the keyword is the
|
|
8
|
+
* accent. Strings, numbers, functions, types and tags take five hues beside it ("Farbig",
|
|
9
|
+
* picked by Justin on 2026-11-15 over a calmer palette, then made more saturated so the hues
|
|
10
|
+
* tell apart at a glance). Contrast of every role on the block's faces (well, surface, ground) and on the three
|
|
11
|
+
* line washes (marked, added, removed) is asserted in src/styles/tokens.test.ts.
|
|
12
|
+
*
|
|
13
|
+
* The washes are code-specific because a line wash must keep every syntax colour readable: on
|
|
14
|
+
* Indigo the status washes are one colour, so the washes here step darker instead.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
:root,
|
|
18
|
+
[data-theme="paper"] {
|
|
19
|
+
--lf-code-text: #302f39;
|
|
20
|
+
--lf-code-punct: #686775;
|
|
21
|
+
--lf-code-comment: #686775;
|
|
22
|
+
--lf-code-keyword: #5f50d0;
|
|
23
|
+
--lf-code-string: #0a7520;
|
|
24
|
+
--lf-code-number: #a14f09;
|
|
25
|
+
--lf-code-function: #125fb3;
|
|
26
|
+
--lf-code-type: #007273;
|
|
27
|
+
--lf-code-tag: #b11f47;
|
|
28
|
+
--lf-code-attribute: #125fb3;
|
|
29
|
+
|
|
30
|
+
/* The face: a white sheet, its header on the well. */
|
|
31
|
+
--lf-code-face: #ffffff;
|
|
32
|
+
--lf-code-head: #f6f6fa;
|
|
33
|
+
|
|
34
|
+
--lf-code-mark: #edeafc;
|
|
35
|
+
--lf-code-added: #dff8e6;
|
|
36
|
+
--lf-code-removed: #ffebea;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[data-theme="tint"] {
|
|
40
|
+
--lf-code-text: #302f39;
|
|
41
|
+
--lf-code-punct: #5f5e6e;
|
|
42
|
+
--lf-code-comment: #5f5e6e;
|
|
43
|
+
--lf-code-keyword: #5f50d0;
|
|
44
|
+
--lf-code-string: #0a7520;
|
|
45
|
+
--lf-code-number: #a14f09;
|
|
46
|
+
--lf-code-function: #125fb3;
|
|
47
|
+
--lf-code-type: #007273;
|
|
48
|
+
--lf-code-tag: #b11f47;
|
|
49
|
+
--lf-code-attribute: #125fb3;
|
|
50
|
+
|
|
51
|
+
--lf-code-face: #ffffff;
|
|
52
|
+
--lf-code-head: #f6f5fd;
|
|
53
|
+
|
|
54
|
+
--lf-code-mark: #edeafc;
|
|
55
|
+
--lf-code-added: #dff8e6;
|
|
56
|
+
--lf-code-removed: #ffebea;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.dark,
|
|
60
|
+
[data-theme="ink"] {
|
|
61
|
+
--lf-code-text: #d8d8df;
|
|
62
|
+
--lf-code-punct: #aaa9ba;
|
|
63
|
+
--lf-code-comment: #aaa9ba;
|
|
64
|
+
--lf-code-keyword: #a6a1fd;
|
|
65
|
+
--lf-code-string: #8de29a;
|
|
66
|
+
--lf-code-number: #fcbc7c;
|
|
67
|
+
--lf-code-function: #85ccff;
|
|
68
|
+
--lf-code-type: #76e2e2;
|
|
69
|
+
--lf-code-tag: #fca0a7;
|
|
70
|
+
--lf-code-attribute: #85ccff;
|
|
71
|
+
|
|
72
|
+
/* In the dark the sheet is the black slab, its header lifted. */
|
|
73
|
+
--lf-code-face: #13121c;
|
|
74
|
+
--lf-code-head: #1d1c28;
|
|
75
|
+
|
|
76
|
+
--lf-code-mark: #2b2654;
|
|
77
|
+
--lf-code-added: #143320;
|
|
78
|
+
--lf-code-removed: #4b1d20;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
[data-theme="indigo"] {
|
|
82
|
+
--lf-code-text: #ffffff;
|
|
83
|
+
--lf-code-punct: #e6e3fb;
|
|
84
|
+
--lf-code-comment: #e6e3fb;
|
|
85
|
+
--lf-code-keyword: #ffffff;
|
|
86
|
+
--lf-code-string: #bcf6c3;
|
|
87
|
+
--lf-code-number: #ffe0bb;
|
|
88
|
+
--lf-code-function: #c6ecff;
|
|
89
|
+
--lf-code-type: #b0f7f6;
|
|
90
|
+
--lf-code-tag: #ffdbdd;
|
|
91
|
+
--lf-code-attribute: #c6ecff;
|
|
92
|
+
|
|
93
|
+
--lf-code-face: #5244c2;
|
|
94
|
+
--lf-code-head: #4b3eb8;
|
|
95
|
+
|
|
96
|
+
--lf-code-mark: #3f32a6;
|
|
97
|
+
--lf-code-added: #3a3aa8;
|
|
98
|
+
--lf-code-removed: #4a2f9e;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
@theme inline {
|
|
102
|
+
--color-code-face: var(--lf-code-face);
|
|
103
|
+
--color-code-head: var(--lf-code-head);
|
|
104
|
+
--color-code-text: var(--lf-code-text);
|
|
105
|
+
--color-code-punct: var(--lf-code-punct);
|
|
106
|
+
--color-code-mark: var(--lf-code-mark);
|
|
107
|
+
--color-code-added: var(--lf-code-added);
|
|
108
|
+
--color-code-removed: var(--lf-code-removed);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/*
|
|
112
|
+
* The edges of a block that scrolls sideways fade where more code waits. The two lengths are
|
|
113
|
+
* registered so the mask can move between them on a spring; the scroller sets them from
|
|
114
|
+
* `data-overflow` (code-block-frame.tsx).
|
|
115
|
+
*/
|
|
116
|
+
@property --code-fade-start {
|
|
117
|
+
syntax: "<length>";
|
|
118
|
+
inherits: false;
|
|
119
|
+
initial-value: 0px;
|
|
120
|
+
}
|
|
121
|
+
@property --code-fade-end {
|
|
122
|
+
syntax: "<length>";
|
|
123
|
+
inherits: false;
|
|
124
|
+
initial-value: 0px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/*
|
|
128
|
+
* The parts of a block that Tailwind classes cannot say well: counters, generated signs and the
|
|
129
|
+
* mask. Measures come from the block (code-block-frame.tsx):
|
|
130
|
+
* --code-pad-x the inset of the code from the block's edge
|
|
131
|
+
* --code-gutter the room before the code: line numbers and the sign of a change
|
|
132
|
+
* --code-digits the width of the widest line number
|
|
133
|
+
* --code-sign-at where the sign of a change stands, from the inset
|
|
134
|
+
*/
|
|
135
|
+
@layer components {
|
|
136
|
+
/* As wide as the longest line or the block, whichever is wider: a wash runs the full width. */
|
|
137
|
+
[data-slot="code-block-code"] {
|
|
138
|
+
display: grid;
|
|
139
|
+
width: max-content;
|
|
140
|
+
min-width: 100%;
|
|
141
|
+
counter-reset: line;
|
|
142
|
+
font-variant-ligatures: none;
|
|
143
|
+
tab-size: 2;
|
|
144
|
+
}
|
|
145
|
+
[data-slot="code-block-code"][data-wrap] {
|
|
146
|
+
width: auto;
|
|
147
|
+
white-space: pre-wrap;
|
|
148
|
+
overflow-wrap: anywhere;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
[data-slot="code-block-line"] {
|
|
152
|
+
position: relative;
|
|
153
|
+
min-height: 1lh;
|
|
154
|
+
padding-inline: var(--code-pad-x) var(--code-pad-x);
|
|
155
|
+
padding-left: calc(var(--code-pad-x) + var(--code-gutter, 0px));
|
|
156
|
+
counter-increment: line;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Numbers are read past, not read out, and never copied with the code. */
|
|
160
|
+
[data-line-numbers] > [data-slot="code-block-line"]::before {
|
|
161
|
+
content: counter(line) / "";
|
|
162
|
+
position: absolute;
|
|
163
|
+
left: var(--code-pad-x);
|
|
164
|
+
width: var(--code-digits);
|
|
165
|
+
text-align: right;
|
|
166
|
+
color: var(--lf-text-muted);
|
|
167
|
+
font-variant-numeric: tabular-nums;
|
|
168
|
+
user-select: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* A marked line: the tint, and the accent along its edge (a gradient, not a shadow). */
|
|
172
|
+
[data-slot="code-block-line"][data-kind="marked"] {
|
|
173
|
+
background: linear-gradient(to right, var(--lf-accent) 2px, var(--lf-code-mark) 2px);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* A change carries its sign, so colour is never the only way to tell. The sign is read out
|
|
177
|
+
with its word (`data-label`) but never copied. */
|
|
178
|
+
[data-slot="code-block-line"][data-kind="added"] {
|
|
179
|
+
background-color: var(--lf-code-added);
|
|
180
|
+
}
|
|
181
|
+
[data-slot="code-block-line"][data-kind="removed"] {
|
|
182
|
+
background-color: var(--lf-code-removed);
|
|
183
|
+
}
|
|
184
|
+
[data-slot="code-block-line"]:is([data-kind="added"], [data-kind="removed"])::after {
|
|
185
|
+
position: absolute;
|
|
186
|
+
left: calc(var(--code-pad-x) + var(--code-sign-at, 0px));
|
|
187
|
+
user-select: none;
|
|
188
|
+
}
|
|
189
|
+
[data-slot="code-block-line"][data-kind="added"]::after {
|
|
190
|
+
content: "+" / attr(data-label);
|
|
191
|
+
color: var(--lf-success);
|
|
192
|
+
}
|
|
193
|
+
[data-slot="code-block-line"][data-kind="removed"]::after {
|
|
194
|
+
content: "−" / attr(data-label);
|
|
195
|
+
color: var(--lf-danger);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* The edges fade where more code waits to the side; the mask moves on `settle`. The focus
|
|
199
|
+
outline is drawn by the block around it, since a mask would cut it off. */
|
|
200
|
+
[data-slot="code-block-scroll"] {
|
|
201
|
+
mask-image: linear-gradient(
|
|
202
|
+
to right,
|
|
203
|
+
transparent,
|
|
204
|
+
#000 var(--code-fade-start),
|
|
205
|
+
#000 calc(100% - var(--code-fade-end)),
|
|
206
|
+
transparent
|
|
207
|
+
);
|
|
208
|
+
transition:
|
|
209
|
+
--code-fade-start var(--transition-duration-spring-settle) var(--ease-spring-settle),
|
|
210
|
+
--code-fade-end var(--transition-duration-spring-settle) var(--ease-spring-settle);
|
|
211
|
+
scrollbar-width: thin;
|
|
212
|
+
scrollbar-color: var(--lf-line) transparent;
|
|
213
|
+
}
|
|
214
|
+
[data-slot="code-block-scroll"][data-overflow~="start"] {
|
|
215
|
+
--code-fade-start: 2.5rem;
|
|
216
|
+
}
|
|
217
|
+
[data-slot="code-block-scroll"][data-overflow~="end"] {
|
|
218
|
+
--code-fade-end: 2.5rem;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/*
|
|
222
|
+
* Copy: the copy symbol shrinks away and a tick is drawn in its place, short leg first, as in
|
|
223
|
+
* a checkbox. When the moment has passed the tick fades where it is (it is not undrawn) and the
|
|
224
|
+
* copy symbol seats back with a little bounce.
|
|
225
|
+
*/
|
|
226
|
+
[data-slot="code-copy-symbol"] {
|
|
227
|
+
transition-property: scale, opacity;
|
|
228
|
+
transition-duration: var(--transition-duration-spring-seat);
|
|
229
|
+
transition-timing-function: var(--ease-spring-seat);
|
|
230
|
+
}
|
|
231
|
+
[data-copied] > [data-slot="code-copy-symbol"] {
|
|
232
|
+
scale: 0.5;
|
|
233
|
+
opacity: 0;
|
|
234
|
+
transition-duration: var(--transition-duration-spring-leave);
|
|
235
|
+
transition-timing-function: var(--ease-spring-leave);
|
|
236
|
+
}
|
|
237
|
+
[data-slot="code-copy-tick"] {
|
|
238
|
+
stroke-dasharray: 1;
|
|
239
|
+
stroke-dashoffset: 1;
|
|
240
|
+
opacity: 0;
|
|
241
|
+
transition:
|
|
242
|
+
opacity var(--transition-duration-spring-leave) var(--ease-spring-leave),
|
|
243
|
+
stroke-dashoffset 0s var(--transition-duration-spring-leave);
|
|
244
|
+
}
|
|
245
|
+
[data-copied] > [data-slot="code-copy-tick"] {
|
|
246
|
+
stroke-dashoffset: 0;
|
|
247
|
+
opacity: 1;
|
|
248
|
+
transition:
|
|
249
|
+
opacity 60ms linear 60ms,
|
|
250
|
+
stroke-dashoffset 220ms cubic-bezier(0.3, 0, 0.2, 1) 60ms;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Density: how large controls are. Sizes are variables, not constants, so the choice stays open:
|
|
3
|
+
* `compact` is the default, `data-density="comfortable"` on <html> or on any subtree gives the
|
|
4
|
+
* larger set. Components read these variables and never hard-code a control height.
|
|
5
|
+
*
|
|
6
|
+
* Only control and field labels follow the density (`text-control`: 15px compact, 16px
|
|
7
|
+
* comfortable). Reading text stays on the type scale; helper and error text is 13.5px in both.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
:root,
|
|
11
|
+
[data-density="compact"] {
|
|
12
|
+
--control-sm: 1.625rem; /* 26 */
|
|
13
|
+
--control-md: 2rem; /* 32 */
|
|
14
|
+
--control-lg: 2.5rem; /* 40 */
|
|
15
|
+
/* inline padding of a button */
|
|
16
|
+
--control-pad-sm: 0.625rem;
|
|
17
|
+
--control-pad-md: 0.875rem;
|
|
18
|
+
--control-pad-lg: 1.25rem;
|
|
19
|
+
/* inline padding of a field or a segment: text starts closer to the edge than a label does */
|
|
20
|
+
--field-pad-sm: 0.5rem;
|
|
21
|
+
--field-pad-md: 0.625rem;
|
|
22
|
+
--field-pad-lg: 0.875rem;
|
|
23
|
+
--control-text: 0.9375rem; /* 15 */
|
|
24
|
+
--control-item: 1.75rem; /* 28: a row in a menu or a list */
|
|
25
|
+
--check-size: 1rem; /* 16: checkbox and radio */
|
|
26
|
+
--radio-dot: 0.5rem;
|
|
27
|
+
--switch-w: 2rem;
|
|
28
|
+
--switch-h: 1.125rem;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[data-density="comfortable"] {
|
|
32
|
+
--control-sm: 1.75rem; /* 28 */
|
|
33
|
+
--control-md: 2.25rem; /* 36 */
|
|
34
|
+
--control-lg: 2.75rem; /* 44 */
|
|
35
|
+
--control-pad-sm: 0.75rem;
|
|
36
|
+
--control-pad-md: 1rem;
|
|
37
|
+
--control-pad-lg: 1.5rem;
|
|
38
|
+
--field-pad-sm: 0.625rem;
|
|
39
|
+
--field-pad-md: 0.75rem;
|
|
40
|
+
--field-pad-lg: 1rem;
|
|
41
|
+
--control-text: 1rem; /* 16 */
|
|
42
|
+
--control-item: 2rem; /* 32 */
|
|
43
|
+
--check-size: 1.125rem; /* 18 */
|
|
44
|
+
--radio-dot: 0.625rem;
|
|
45
|
+
--switch-w: 2.25rem;
|
|
46
|
+
--switch-h: 1.25rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* `inline`, so the size resolves where it is used and a nested density wins. */
|
|
50
|
+
@theme inline {
|
|
51
|
+
--text-control: var(--control-text);
|
|
52
|
+
--text-control--line-height: 1.4;
|
|
53
|
+
}
|