@whatsaaaa/design-system 0.6.0 → 0.7.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/README.md +2 -2
- package/dist/css/base.css +21 -1
- package/dist/css/callout.css +10 -0
- package/dist/css/code.css +24 -0
- package/dist/css/ghost.css +24 -0
- package/dist/css/icons.css +12 -0
- package/dist/css/nuxt-ui.css +121 -0
- package/dist/css/pairs.css +26 -0
- package/dist/css/prose.css +20 -1
- package/dist/css/segmented.css +20 -0
- package/dist/css/terminal.css +158 -9
- package/dist/css/theme.css +20 -0
- package/dist/index.css +304 -11
- package/dist/shortcuts/index.d.ts +11 -9
- package/dist/shortcuts/index.js +12 -10
- package/dist/shortcuts/init.js +2 -2
- package/dist/vitepress-config/index.js +2 -1
- package/docs/usage.md +48 -19
- package/package.json +1 -1
- package/src/vitepress/styles/nav.css +13 -6
package/README.md
CHANGED
|
@@ -62,10 +62,10 @@ A pull request that changes what the package ships adds a changeset with `pnpm c
|
|
|
62
62
|
CI runs on every pull request:
|
|
63
63
|
|
|
64
64
|
- formatting, lint and types,
|
|
65
|
-
- the unit tests, with the contrast of every role pair in both themes,
|
|
65
|
+
- the unit tests, with the contrast of every role pair in both themes, the comments of the stylesheets in the built ones, and Nuxt UI's colors read from tokens outside any layer,
|
|
66
66
|
- that `assets/` is what the sources produce,
|
|
67
67
|
- that the package and the style guide build,
|
|
68
|
-
- the browser tests: no page overflows sideways at phone, tablet and desktop width in either theme, no page logs an error when it loads, the easter egg works with the mouse, the keyboard and reduced motion, the keys of the status line work and their switch turns them off, the path of the status line gives way at every width from 320 px and the theme button switches the theme, a `dark` or `light` class chooses the theme as `data-theme` does, an element for one theme shows only in it, the browser's theme-color follows the theme, a control that takes the focus is not left under the status line and no bar or corner of the window cuts off its focus ring, the first tab starts on the border of the sidebar, the pieces of a form fit every width from 320 px (a segmented control works with the keyboard, stands out at 3:1 and takes the selection colors in forced colors, amounts line up at the right in figures of one width, a number field has no spin buttons and its arrow keys step it, wrapped code hangs and stays inside its block, a long email breaks after its @, and the check icon and the ghost files draw), both fonts draw Serbian Latin, an app built on the Tailwind entry takes its utilities, layers and `dark:` and `light:` from the tokens and their theme, and the pages of the style guide look like their stored screenshots.
|
|
68
|
+
- the browser tests: no page overflows sideways at phone, tablet and desktop width in either theme, and no terminal window or bar of one cuts off its content, no page logs an error when it loads, the easter egg works with the mouse, the keyboard and reduced motion, the keys of the status line work and their switch turns them off, the numbers of the tabs show only while their keys work and keep their place while the keys load, the path of the status line gives way at every width from 320 px and the theme button switches the theme, a `dark` or `light` class chooses the theme as `data-theme` does, an element for one theme shows only in it, the browser's theme-color follows the theme, a control that takes the focus is not left under the status line and no bar or corner of the window cuts off its focus ring, a radius of the page's own wins over the focus ring's and a button without one takes its small corners, with index.css and with tailwind.css, a state lines up with the text beside it, a prompt that wraps keeps its chevron on its first line at every width from 320 px, assistive technology reads the parts of the path above a page title as words of their own, the first tab starts on the border of the sidebar, the pieces of a form fit every width from 320 px (a segmented control works with the keyboard, stands out at 3:1 and takes the selection colors in forced colors, amounts line up at the right in figures of one width, a number field has no spin buttons and its arrow keys step it, wrapped code hangs and stays inside its block, a long email breaks after its @, and the check icon and the ghost files draw), both fonts draw Serbian Latin, an app built on the Tailwind entry takes its utilities, layers and `dark:` and `light:` from the tokens and their theme, Nuxt UI's colors take the roles of the theme chosen around them, and the pages of the style guide look like their stored screenshots.
|
|
69
69
|
|
|
70
70
|
The screenshots are in `tests/browser/__screenshots__/` and are taken on Linux, in the Playwright container, so they are the same on every machine. After a change that is meant to be seen, update them:
|
|
71
71
|
|
package/dist/css/base.css
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Page defaults for a site that is all this system: box sizing, the page colors, the body
|
|
3
|
+
* face, links, number fields, focus and selection. It resets margins and list markers, so
|
|
4
|
+
* content that should read as a document goes in a .ws-prose container.
|
|
5
|
+
*/
|
|
1
6
|
*, :before, :after {
|
|
2
7
|
box-sizing: border-box;
|
|
3
8
|
}
|
|
@@ -33,11 +38,16 @@ a {
|
|
|
33
38
|
text-decoration-thickness: 1px;
|
|
34
39
|
}
|
|
35
40
|
|
|
41
|
+
/* A mono face with ligatures turns => and != into single shapes, which code should not do. */
|
|
36
42
|
code, kbd, samp, pre {
|
|
37
43
|
font-family: var(--ws-font-family-mono);
|
|
38
44
|
font-variant-ligatures: none;
|
|
39
45
|
}
|
|
40
46
|
|
|
47
|
+
/*
|
|
48
|
+
* A number field is typed, and stepped with the arrow keys. The system draws no spin buttons,
|
|
49
|
+
* and the browser's own have no look of its, so they go.
|
|
50
|
+
*/
|
|
41
51
|
input[type="number"] {
|
|
42
52
|
appearance: textfield;
|
|
43
53
|
}
|
|
@@ -53,11 +63,21 @@ input[type="number"]::-webkit-outer-spin-button {
|
|
|
53
63
|
}
|
|
54
64
|
|
|
55
65
|
:focus-visible {
|
|
56
|
-
border-radius: var(--ws-radius-sm);
|
|
57
66
|
outline: var(--ws-border-width-medium) solid var(--ws-color-interactive);
|
|
58
67
|
outline-offset: 3px;
|
|
59
68
|
}
|
|
60
69
|
|
|
70
|
+
/*
|
|
71
|
+
* A ring follows the corners of what it rings. What has no corners of its own, such as a
|
|
72
|
+
* link, takes small ones while it is focused. The rule weighs no more than an element, so a
|
|
73
|
+
* class of the page's own, such as a round radio button's, always wins, wherever it is
|
|
74
|
+
* written. A form control weighs as an element here, to win over Tailwind's preflight, which
|
|
75
|
+
* squares its corners at that weight before base.css in the same layer.
|
|
76
|
+
*/
|
|
77
|
+
:where(:focus-visible), :is(button, input, select, optgroup, textarea):where(:focus-visible) {
|
|
78
|
+
border-radius: var(--ws-radius-sm);
|
|
79
|
+
}
|
|
80
|
+
|
|
61
81
|
::selection {
|
|
62
82
|
background: var(--ws-color-selection);
|
|
63
83
|
color: var(--ws-color-text);
|
package/dist/css/callout.css
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A callout: a bar in the status color, a label with an icon, then text.
|
|
3
|
+
* The status is never carried by color alone. On the light theme the label and icon take the
|
|
4
|
+
* text color, because the status hues miss AA as text there, and the hue stays on the bar.
|
|
5
|
+
*
|
|
6
|
+
* <aside class="ws-callout ws-callout--warning">
|
|
7
|
+
* <p class="ws-callout__title">Warning</p>
|
|
8
|
+
* <p>...</p>
|
|
9
|
+
* </aside>
|
|
10
|
+
*/
|
|
1
11
|
.ws-callout {
|
|
2
12
|
--ws-callout-tone: var(--ws-color-note);
|
|
3
13
|
--ws-callout-label: var(--ws-color-note-text);
|
package/dist/css/code.css
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A code block with a caption: the file name on the left, the language on the right.
|
|
3
|
+
*
|
|
4
|
+
* <figure class="ws-code">
|
|
5
|
+
* <figcaption><span>conditions.ts</span><span>ts</span></figcaption>
|
|
6
|
+
* <pre><code>...</code></pre>
|
|
7
|
+
* </figure>
|
|
8
|
+
*
|
|
9
|
+
* Code blocks stay on the dark palette in both themes: on dawn no syntax color except
|
|
10
|
+
* pine reaches AA on the surface.
|
|
11
|
+
*
|
|
12
|
+
* A block scrolls sideways. ws-code--wrap wraps its lines instead, for text a person typed,
|
|
13
|
+
* such as a long value, which a phone would cut off. When each line is a .line with
|
|
14
|
+
* --ws-code-hang, its indent in characters plus two, as the hangingIndent transformer of
|
|
15
|
+
* @whatsaaaa/design-system/shiki gives it, the rest of a wrapped line hangs one level in from
|
|
16
|
+
* the line's own text, so the shape of the code still reads.
|
|
17
|
+
*
|
|
18
|
+
* <figure class="ws-code ws-code--wrap">
|
|
19
|
+
* <figcaption><span>order.json</span><span>json</span></figcaption>
|
|
20
|
+
* <pre><code><span class="line" style="--ws-code-hang: 4"> "note": "..."</span></code></pre>
|
|
21
|
+
* </figure>
|
|
22
|
+
*/
|
|
1
23
|
.ws-code {
|
|
2
24
|
margin: var(--ws-space-16) 0 0;
|
|
3
25
|
border: var(--ws-border-width-thin) solid var(--ws-code-border);
|
|
@@ -44,6 +66,7 @@
|
|
|
44
66
|
overflow-x: visible;
|
|
45
67
|
}
|
|
46
68
|
|
|
69
|
+
/* A line is a box of its own, so its rest can hang. The line break after it stays text. */
|
|
47
70
|
.ws-code--wrap .line {
|
|
48
71
|
box-sizing: border-box;
|
|
49
72
|
width: 100%;
|
|
@@ -61,6 +84,7 @@
|
|
|
61
84
|
color: var(--ws-code-text);
|
|
62
85
|
}
|
|
63
86
|
|
|
87
|
+
/* The scrollbar of a code block belongs to the dark block, whatever the page theme is. */
|
|
64
88
|
.ws-code > pre, .ws-prose pre {
|
|
65
89
|
--lightningcss-light: ;
|
|
66
90
|
--lightningcss-dark: initial;
|
package/dist/css/ghost.css
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The ghost as an element: <ws-ghost>. See the ghost module for its markup and behavior.
|
|
3
|
+
* The body takes the text color and the tongue the brand color, so the free ghost follows
|
|
4
|
+
* the theme.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* The one breakpoint of the system. Below it there is one column, the tab bar wraps and
|
|
9
|
+
* headings take their compact sizes. Custom properties cannot be used in media queries,
|
|
10
|
+
* so in another project write the query out: @media (width < 64rem).
|
|
11
|
+
*/
|
|
1
12
|
ws-ghost {
|
|
2
13
|
color: var(--ws-color-text);
|
|
3
14
|
vertical-align: middle;
|
|
@@ -22,6 +33,13 @@ ws-ghost {
|
|
|
22
33
|
display: block;
|
|
23
34
|
}
|
|
24
35
|
|
|
36
|
+
/*
|
|
37
|
+
* A ghost that is large on a wide screen, such as the one next to the display name, takes a
|
|
38
|
+
* smaller size on a phone with compact-px: the size of one sprite pixel below 64rem, a whole
|
|
39
|
+
* number from 1 to 5. The ghost is 10 by 12 sprite pixels.
|
|
40
|
+
*
|
|
41
|
+
* <ws-ghost px="6" compact-px="4"></ws-ghost>
|
|
42
|
+
*/
|
|
25
43
|
@media (width < 64rem) {
|
|
26
44
|
ws-ghost[compact-px="1"] .ws-ghost__sprite {
|
|
27
45
|
width: 10px;
|
|
@@ -57,6 +75,10 @@ ws-ghost {
|
|
|
57
75
|
fill: var(--ws-color-brand);
|
|
58
76
|
}
|
|
59
77
|
|
|
78
|
+
/*
|
|
79
|
+
* The speech bubble. It is a popover, so it shows above everything and no container clips
|
|
80
|
+
* it. The script places it next to the ghost and keeps it inside the window.
|
|
81
|
+
*/
|
|
60
82
|
.ws-ghost__bubble {
|
|
61
83
|
z-index: 1000;
|
|
62
84
|
pointer-events: none;
|
|
@@ -87,6 +109,7 @@ ws-ghost {
|
|
|
87
109
|
fill: var(--ws-color-bg);
|
|
88
110
|
}
|
|
89
111
|
|
|
112
|
+
/* The bubble pops in four frames, like a sprite. With reduced motion it is just there. */
|
|
90
113
|
@media (prefers-reduced-motion: no-preference) {
|
|
91
114
|
.ws-ghost__bubble svg {
|
|
92
115
|
transform-origin: 0 100%;
|
|
@@ -105,6 +128,7 @@ ws-ghost {
|
|
|
105
128
|
}
|
|
106
129
|
}
|
|
107
130
|
|
|
131
|
+
/* The shout for screen readers. */
|
|
108
132
|
.ws-ghost__live {
|
|
109
133
|
clip-path: inset(50%);
|
|
110
134
|
white-space: nowrap;
|
package/dist/css/icons.css
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The few icons the styles draw themselves, as masks, so they take the color of their text
|
|
3
|
+
* and need no markup. All are 16 x 16 strokes of 1.5.
|
|
4
|
+
*
|
|
5
|
+
* .done::before {
|
|
6
|
+
* width: 1rem;
|
|
7
|
+
* height: 1rem;
|
|
8
|
+
* background: currentcolor;
|
|
9
|
+
* content: '';
|
|
10
|
+
* mask: var(--ws-icon-check) center / contain no-repeat;
|
|
11
|
+
* }
|
|
12
|
+
*/
|
|
1
13
|
:root {
|
|
2
14
|
--ws-icon-note: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='6.2'/%3E%3Cpath d='M8 7.4v3.4M8 5.1v.2'/%3E%3C/svg%3E");
|
|
3
15
|
--ws-icon-tip: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 1.8a4.3 4.3 0 0 0-2.3 7.9v1.5h4.6V9.7A4.3 4.3 0 0 0 8 1.8ZM6.4 13.6h3.2'/%3E%3C/svg%3E");
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Nuxt UI's theme variables, pointed at the design system's roles. Both themes follow by
|
|
3
|
+
* themselves: the roles switch, and these read them.
|
|
4
|
+
*
|
|
5
|
+
* Outside any layer, so it wins over Nuxt UI's own values, which it keeps in its theme layer
|
|
6
|
+
* and in a style it adds at runtime. Declared again on every element with a data-theme or a dark
|
|
7
|
+
* or light class, where Nuxt UI puts its own, so a part of a page kept in one theme, either way,
|
|
8
|
+
* reads that theme's roles, as the tokens do.
|
|
9
|
+
*
|
|
10
|
+
* Where Nuxt UI wants a step the system has no role for, it is mixed from the roles around it
|
|
11
|
+
* in oklab. The shade scales Nuxt UI makes of each color run from the page (50) through the
|
|
12
|
+
* color (500) to the text (950), so a low shade is a faint tint in both themes.
|
|
13
|
+
*
|
|
14
|
+
* It reads the tokens and comes after Nuxt UI's own stylesheet, so it is not in index.css or
|
|
15
|
+
* tailwind.css. An app's stylesheet ends its imports with it:
|
|
16
|
+
*
|
|
17
|
+
* @import '@whatsaaaa/design-system/tailwind.css';
|
|
18
|
+
* @import '@nuxt/ui';
|
|
19
|
+
* @import '@whatsaaaa/design-system/tailwind/variants.css';
|
|
20
|
+
* @import '@whatsaaaa/design-system/css/nuxt-ui.css';
|
|
21
|
+
*/
|
|
22
|
+
:root, :host, [data-theme], .dark, .light {
|
|
23
|
+
--ui-text-dimmed: var(--ws-color-text-faint);
|
|
24
|
+
--ui-text-muted: var(--ws-color-text-secondary);
|
|
25
|
+
--ui-text-toned: color-mix(in oklab, var(--ws-color-text-secondary), var(--ws-color-text));
|
|
26
|
+
--ui-text: var(--ws-color-text);
|
|
27
|
+
--ui-text-highlighted: var(--ws-color-text);
|
|
28
|
+
--ui-text-inverted: var(--ws-color-bg);
|
|
29
|
+
--ui-bg: var(--ws-color-bg);
|
|
30
|
+
--ui-bg-muted: var(--ws-color-surface);
|
|
31
|
+
--ui-bg-elevated: var(--ws-color-raised);
|
|
32
|
+
--ui-bg-accented: color-mix(in oklab, var(--ws-color-raised) 85%, var(--ws-color-text));
|
|
33
|
+
--ui-bg-inverted: var(--ws-color-text);
|
|
34
|
+
--ui-border: var(--ws-color-border);
|
|
35
|
+
--ui-border-muted: var(--ws-color-border);
|
|
36
|
+
--ui-border-accented: var(--ws-color-field-border);
|
|
37
|
+
--ui-border-inverted: var(--ws-color-text);
|
|
38
|
+
--ui-primary: var(--ws-color-interactive);
|
|
39
|
+
--ui-success: var(--ws-color-tip);
|
|
40
|
+
--ui-info: var(--ws-color-note);
|
|
41
|
+
--ui-warning: var(--ws-color-warning);
|
|
42
|
+
--ui-error: var(--ws-color-danger);
|
|
43
|
+
--ui-color-primary-50: color-mix(in oklab, var(--ws-color-interactive) 10%, var(--ws-color-bg));
|
|
44
|
+
--ui-color-primary-100: color-mix(in oklab, var(--ws-color-interactive) 20%, var(--ws-color-bg));
|
|
45
|
+
--ui-color-primary-200: color-mix(in oklab, var(--ws-color-interactive) 40%, var(--ws-color-bg));
|
|
46
|
+
--ui-color-primary-300: color-mix(in oklab, var(--ws-color-interactive) 60%, var(--ws-color-bg));
|
|
47
|
+
--ui-color-primary-400: color-mix(in oklab, var(--ws-color-interactive) 80%, var(--ws-color-bg));
|
|
48
|
+
--ui-color-primary-500: var(--ws-color-interactive);
|
|
49
|
+
--ui-color-primary-600: color-mix(in oklab,
|
|
50
|
+
var(--ws-color-interactive) 80%,
|
|
51
|
+
var(--ws-color-text));
|
|
52
|
+
--ui-color-primary-700: color-mix(in oklab,
|
|
53
|
+
var(--ws-color-interactive) 60%,
|
|
54
|
+
var(--ws-color-text));
|
|
55
|
+
--ui-color-primary-800: color-mix(in oklab,
|
|
56
|
+
var(--ws-color-interactive) 40%,
|
|
57
|
+
var(--ws-color-text));
|
|
58
|
+
--ui-color-primary-900: color-mix(in oklab,
|
|
59
|
+
var(--ws-color-interactive) 20%,
|
|
60
|
+
var(--ws-color-text));
|
|
61
|
+
--ui-color-primary-950: color-mix(in oklab,
|
|
62
|
+
var(--ws-color-interactive) 10%,
|
|
63
|
+
var(--ws-color-text));
|
|
64
|
+
--ui-color-success-50: color-mix(in oklab, var(--ws-color-tip) 10%, var(--ws-color-bg));
|
|
65
|
+
--ui-color-success-100: color-mix(in oklab, var(--ws-color-tip) 20%, var(--ws-color-bg));
|
|
66
|
+
--ui-color-success-200: color-mix(in oklab, var(--ws-color-tip) 40%, var(--ws-color-bg));
|
|
67
|
+
--ui-color-success-300: color-mix(in oklab, var(--ws-color-tip) 60%, var(--ws-color-bg));
|
|
68
|
+
--ui-color-success-400: color-mix(in oklab, var(--ws-color-tip) 80%, var(--ws-color-bg));
|
|
69
|
+
--ui-color-success-500: var(--ws-color-tip);
|
|
70
|
+
--ui-color-success-600: color-mix(in oklab, var(--ws-color-tip) 80%, var(--ws-color-text));
|
|
71
|
+
--ui-color-success-700: color-mix(in oklab, var(--ws-color-tip) 60%, var(--ws-color-text));
|
|
72
|
+
--ui-color-success-800: color-mix(in oklab, var(--ws-color-tip) 40%, var(--ws-color-text));
|
|
73
|
+
--ui-color-success-900: color-mix(in oklab, var(--ws-color-tip) 20%, var(--ws-color-text));
|
|
74
|
+
--ui-color-success-950: color-mix(in oklab, var(--ws-color-tip) 10%, var(--ws-color-text));
|
|
75
|
+
--ui-color-info-50: color-mix(in oklab, var(--ws-color-note) 10%, var(--ws-color-bg));
|
|
76
|
+
--ui-color-info-100: color-mix(in oklab, var(--ws-color-note) 20%, var(--ws-color-bg));
|
|
77
|
+
--ui-color-info-200: color-mix(in oklab, var(--ws-color-note) 40%, var(--ws-color-bg));
|
|
78
|
+
--ui-color-info-300: color-mix(in oklab, var(--ws-color-note) 60%, var(--ws-color-bg));
|
|
79
|
+
--ui-color-info-400: color-mix(in oklab, var(--ws-color-note) 80%, var(--ws-color-bg));
|
|
80
|
+
--ui-color-info-500: var(--ws-color-note);
|
|
81
|
+
--ui-color-info-600: color-mix(in oklab, var(--ws-color-note) 80%, var(--ws-color-text));
|
|
82
|
+
--ui-color-info-700: color-mix(in oklab, var(--ws-color-note) 60%, var(--ws-color-text));
|
|
83
|
+
--ui-color-info-800: color-mix(in oklab, var(--ws-color-note) 40%, var(--ws-color-text));
|
|
84
|
+
--ui-color-info-900: color-mix(in oklab, var(--ws-color-note) 20%, var(--ws-color-text));
|
|
85
|
+
--ui-color-info-950: color-mix(in oklab, var(--ws-color-note) 10%, var(--ws-color-text));
|
|
86
|
+
--ui-color-warning-50: color-mix(in oklab, var(--ws-color-warning) 10%, var(--ws-color-bg));
|
|
87
|
+
--ui-color-warning-100: color-mix(in oklab, var(--ws-color-warning) 20%, var(--ws-color-bg));
|
|
88
|
+
--ui-color-warning-200: color-mix(in oklab, var(--ws-color-warning) 40%, var(--ws-color-bg));
|
|
89
|
+
--ui-color-warning-300: color-mix(in oklab, var(--ws-color-warning) 60%, var(--ws-color-bg));
|
|
90
|
+
--ui-color-warning-400: color-mix(in oklab, var(--ws-color-warning) 80%, var(--ws-color-bg));
|
|
91
|
+
--ui-color-warning-500: var(--ws-color-warning);
|
|
92
|
+
--ui-color-warning-600: color-mix(in oklab, var(--ws-color-warning) 80%, var(--ws-color-text));
|
|
93
|
+
--ui-color-warning-700: color-mix(in oklab, var(--ws-color-warning) 60%, var(--ws-color-text));
|
|
94
|
+
--ui-color-warning-800: color-mix(in oklab, var(--ws-color-warning) 40%, var(--ws-color-text));
|
|
95
|
+
--ui-color-warning-900: color-mix(in oklab, var(--ws-color-warning) 20%, var(--ws-color-text));
|
|
96
|
+
--ui-color-warning-950: color-mix(in oklab, var(--ws-color-warning) 10%, var(--ws-color-text));
|
|
97
|
+
--ui-color-error-50: color-mix(in oklab, var(--ws-color-danger) 10%, var(--ws-color-bg));
|
|
98
|
+
--ui-color-error-100: color-mix(in oklab, var(--ws-color-danger) 20%, var(--ws-color-bg));
|
|
99
|
+
--ui-color-error-200: color-mix(in oklab, var(--ws-color-danger) 40%, var(--ws-color-bg));
|
|
100
|
+
--ui-color-error-300: color-mix(in oklab, var(--ws-color-danger) 60%, var(--ws-color-bg));
|
|
101
|
+
--ui-color-error-400: color-mix(in oklab, var(--ws-color-danger) 80%, var(--ws-color-bg));
|
|
102
|
+
--ui-color-error-500: var(--ws-color-danger);
|
|
103
|
+
--ui-color-error-600: color-mix(in oklab, var(--ws-color-danger) 80%, var(--ws-color-text));
|
|
104
|
+
--ui-color-error-700: color-mix(in oklab, var(--ws-color-danger) 60%, var(--ws-color-text));
|
|
105
|
+
--ui-color-error-800: color-mix(in oklab, var(--ws-color-danger) 40%, var(--ws-color-text));
|
|
106
|
+
--ui-color-error-900: color-mix(in oklab, var(--ws-color-danger) 20%, var(--ws-color-text));
|
|
107
|
+
--ui-color-error-950: color-mix(in oklab, var(--ws-color-danger) 10%, var(--ws-color-text));
|
|
108
|
+
--ui-color-neutral-50: color-mix(in oklab, var(--ws-color-text) 5%, var(--ws-color-bg));
|
|
109
|
+
--ui-color-neutral-100: color-mix(in oklab, var(--ws-color-text) 10%, var(--ws-color-bg));
|
|
110
|
+
--ui-color-neutral-200: color-mix(in oklab, var(--ws-color-text) 20%, var(--ws-color-bg));
|
|
111
|
+
--ui-color-neutral-300: color-mix(in oklab, var(--ws-color-text) 30%, var(--ws-color-bg));
|
|
112
|
+
--ui-color-neutral-400: color-mix(in oklab, var(--ws-color-text) 40%, var(--ws-color-bg));
|
|
113
|
+
--ui-color-neutral-500: color-mix(in oklab, var(--ws-color-text) 50%, var(--ws-color-bg));
|
|
114
|
+
--ui-color-neutral-600: color-mix(in oklab, var(--ws-color-text) 60%, var(--ws-color-bg));
|
|
115
|
+
--ui-color-neutral-700: color-mix(in oklab, var(--ws-color-text) 70%, var(--ws-color-bg));
|
|
116
|
+
--ui-color-neutral-800: color-mix(in oklab, var(--ws-color-text) 80%, var(--ws-color-bg));
|
|
117
|
+
--ui-color-neutral-900: color-mix(in oklab, var(--ws-color-text) 90%, var(--ws-color-bg));
|
|
118
|
+
--ui-color-neutral-950: color-mix(in oklab, var(--ws-color-text) 95%, var(--ws-color-bg));
|
|
119
|
+
--ui-radius: var(--ws-radius-sm);
|
|
120
|
+
--ui-header-height: var(--ws-size-tab-bar);
|
|
121
|
+
}
|
package/dist/css/pairs.css
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Terms and their values, a row each: the answers of a form on its review step, or what an
|
|
3
|
+
* order costs. A term is in the voice of a label, its value in the face of a field, and the
|
|
4
|
+
* two share a baseline. The terms share a column as wide as the longest of them, at most two
|
|
5
|
+
* fifths of the row, so the values line up and have the rest of it. A long email or URL takes
|
|
6
|
+
* a <wbr /> after its @ or a /, so it breaks there and not in a word.
|
|
7
|
+
*
|
|
8
|
+
* <dl class="ws-pairs">
|
|
9
|
+
* <div><dt>Name</dt><dd>Ana Petrović</dd></div>
|
|
10
|
+
* <div><dt>Email</dt><dd>ana@<wbr />example.com</dd></div>
|
|
11
|
+
* </dl>
|
|
12
|
+
*
|
|
13
|
+
* Amounts take ws-pairs--amounts: each value at the right edge, in figures of one width, so
|
|
14
|
+
* the digits of the rows line up, and the terms take the rest of the row. The total is the
|
|
15
|
+
* last row, ws-pairs__total.
|
|
16
|
+
*
|
|
17
|
+
* <dl class="ws-pairs ws-pairs--amounts">
|
|
18
|
+
* <div><dt>Subtotal</dt><dd>€48.00</dd></div>
|
|
19
|
+
* <div><dt>Shipping</dt><dd>€4.00</dd></div>
|
|
20
|
+
* <div class="ws-pairs__total"><dt>Total</dt><dd>€52.00</dd></div>
|
|
21
|
+
* </dl>
|
|
22
|
+
*/
|
|
1
23
|
.ws-pairs {
|
|
2
24
|
column-gap: var(--ws-space-16);
|
|
3
25
|
border-bottom: var(--ws-border-width-thin) dashed var(--ws-color-border);
|
|
@@ -6,6 +28,9 @@
|
|
|
6
28
|
display: grid;
|
|
7
29
|
}
|
|
8
30
|
|
|
31
|
+
/* Each row takes the columns and the gap of the list, so a browser without subgrid (Chrome
|
|
32
|
+
before 117) still sets a term beside its value; only the terms of different rows may differ
|
|
33
|
+
in width. */
|
|
9
34
|
.ws-pairs > div {
|
|
10
35
|
grid-column: 1 / -1;
|
|
11
36
|
grid-template-columns: inherit;
|
|
@@ -47,6 +72,7 @@
|
|
|
47
72
|
white-space: nowrap;
|
|
48
73
|
}
|
|
49
74
|
|
|
75
|
+
/* The total: set off by a solid rule, and both of its parts in the text color, semibold. */
|
|
50
76
|
.ws-pairs > .ws-pairs__total {
|
|
51
77
|
border-top-style: solid;
|
|
52
78
|
}
|
package/dist/css/prose.css
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Long-form text: headings, paragraphs, links, lists, inline code, tables and the small
|
|
3
|
+
* things around them. Put rendered Markdown in a .ws-prose container.
|
|
4
|
+
* The same rules style VitePress pages, whose content container is .vp-doc.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* The one breakpoint of the system. Below it there is one column, the tab bar wraps and
|
|
9
|
+
* headings take their compact sizes. Custom properties cannot be used in media queries,
|
|
10
|
+
* so in another project write the query out: @media (width < 64rem).
|
|
11
|
+
*/
|
|
1
12
|
.ws-prose, .vp-doc {
|
|
2
13
|
color: var(--ws-color-text);
|
|
3
14
|
font: var(--ws-text-body);
|
|
@@ -285,6 +296,7 @@
|
|
|
285
296
|
}
|
|
286
297
|
}
|
|
287
298
|
|
|
299
|
+
/* A plain code block in prose. Dark in both themes, like every code block. */
|
|
288
300
|
.ws-prose pre {
|
|
289
301
|
margin: var(--ws-space-16) 0 0;
|
|
290
302
|
padding: var(--ws-space-16);
|
|
@@ -302,6 +314,13 @@
|
|
|
302
314
|
font: inherit;
|
|
303
315
|
}
|
|
304
316
|
|
|
317
|
+
/*
|
|
318
|
+
* The path above a page title. The slashes between its parts are drawn. Assistive technology
|
|
319
|
+
* reads a comma in their place, so the parts come out as words of their own.
|
|
320
|
+
*
|
|
321
|
+
* <p class="ws-crumb"><span>writing</span><span>form-builder</span><span>conditions</span></p>
|
|
322
|
+
* <h1>Conditions</h1>
|
|
323
|
+
*/
|
|
305
324
|
.ws-crumb {
|
|
306
325
|
color: var(--ws-color-text-secondary);
|
|
307
326
|
font: var(--ws-text-caption);
|
|
@@ -312,7 +331,7 @@
|
|
|
312
331
|
margin-inline: var(--ws-space-4);
|
|
313
332
|
color: var(--ws-color-text-faint);
|
|
314
333
|
content: "/";
|
|
315
|
-
content: "/" / "";
|
|
334
|
+
content: "/" / ", ";
|
|
316
335
|
}
|
|
317
336
|
|
|
318
337
|
.ws-crumb + h1 {
|
package/dist/css/segmented.css
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* A segmented control: buttons in a row that share their edges, one of them pressed, such as
|
|
3
|
+
* the switch between the languages of a page.
|
|
4
|
+
*
|
|
5
|
+
* <div class="ws-segmented" role="group" aria-label="Language">
|
|
6
|
+
* <button type="button" aria-pressed="true">en</button>
|
|
7
|
+
* <button type="button" aria-pressed="false">sr</button>
|
|
8
|
+
* </div>
|
|
9
|
+
*
|
|
10
|
+
* The pressed segment is raised, in the text color, with an edge of the interactive color
|
|
11
|
+
* that is twice as thick as the others, at least 3:1 on the page and on the raised fill. It is
|
|
12
|
+
* not filled: next to a primary button a filled segment would be as loud as the button.
|
|
13
|
+
*/
|
|
1
14
|
.ws-segmented {
|
|
2
15
|
max-width: 100%;
|
|
3
16
|
display: inline-flex;
|
|
@@ -27,6 +40,7 @@
|
|
|
27
40
|
border-end-end-radius: var(--ws-radius-md);
|
|
28
41
|
}
|
|
29
42
|
|
|
43
|
+
/* The edge two segments share is one line: the hovered or pressed one draws it, over the other. */
|
|
30
44
|
.ws-segmented > button + button {
|
|
31
45
|
margin-inline-start: calc(-1 * var(--ws-border-width-thin));
|
|
32
46
|
}
|
|
@@ -59,6 +73,12 @@
|
|
|
59
73
|
background: none;
|
|
60
74
|
}
|
|
61
75
|
|
|
76
|
+
/*
|
|
77
|
+
* In forced colors the browser paints every fill in the page's color, so the pressed segment
|
|
78
|
+
* takes the system's colors of a selection. It keeps them as they are, as the browser would
|
|
79
|
+
* otherwise put a plate of the page's color behind its text. Kept colors keep the shadow too,
|
|
80
|
+
* so it drops the shadow itself: the fill already shows the segment is pressed.
|
|
81
|
+
*/
|
|
62
82
|
@media (forced-colors: active) {
|
|
63
83
|
.ws-segmented > button[aria-pressed="true"] {
|
|
64
84
|
box-shadow: none;
|