@birdycom/omniaui 0.14.0 → 0.14.2
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/bin/lib/add.mjs +7 -1
- package/bin/lib/catalog.mjs +6 -0
- package/bin/lib/copy-js.mjs +2 -0
- package/dist/components.css +540 -24
- package/dist/components.min.css +1 -1
- package/dist/docs-ui.css +12 -1
- package/dist/language-select.d.ts +7 -0
- package/dist/language-select.js +48 -0
- package/dist/oc-theme.css +1 -1
- package/dist/parts/app-page-header.css +1 -1
- package/dist/parts/app-severity-card.css +4 -0
- package/dist/parts/app-status-dot.css +19 -4
- package/dist/parts/app-version-banner.css +18 -1
- package/dist/parts/data-dl-glossary.css +22 -0
- package/dist/parts/data-meter-row.css +7 -0
- package/dist/parts/data-step-list.css +48 -0
- package/dist/parts/forms-language-select.css +62 -0
- package/dist/parts/site-doc-layout.css +39 -0
- package/dist/parts/site-layout.css +15 -1
- package/dist/parts/site-neon.css +17 -3
- package/dist/parts/site-prose.css +4 -1
- package/dist/parts/site-tint-card.css +223 -0
- package/dist/showcase.css +20 -5
- package/dist/toc.d.ts +9 -0
- package/dist/toc.js +96 -0
- package/manifest.json +24 -0
- package/package.json +4 -2
- package/snippets/definition-list.html +2 -0
- package/snippets/doc-layout.html +39 -0
- package/snippets/meter-row.html +2 -1
- package/snippets/page-sections.html +1 -1
- package/snippets/progress.html +1 -1
- package/snippets/status-dot.html +1 -0
- package/snippets/step-list.html +28 -0
- package/snippets/tint-card.html +66 -0
- package/snippets/toc.html +1 -1
package/dist/docs-ui.css
CHANGED
|
@@ -57,9 +57,17 @@
|
|
|
57
57
|
.oc-sidebar--docs.oc-sidebar--collapsed { inline-size: auto; }
|
|
58
58
|
|
|
59
59
|
/* ---- On this page: .oc-toc ---------------------------------------------------------------------- */
|
|
60
|
-
|
|
60
|
+
/* Sticky only from 64rem: stacked above the text on a phone it would stay over the text. It stops under a sticky site
|
|
61
|
+
header (--oc-sticky-offset, see parts/site-doc-layout.css). */
|
|
62
|
+
.oc-toc { max-block-size: 100%; overflow: auto; padding-block-start: 2px; padding-inline-end: 0.5rem; }
|
|
63
|
+
@media (min-width: 64rem) {
|
|
64
|
+
.oc-toc { position: sticky; inset-block-start: var(--oc-sticky-offset, 0px); }
|
|
65
|
+
}
|
|
61
66
|
.oc-toc-title { margin: 1rem 0 0.5rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--oc-muted-foreground); }
|
|
62
67
|
.oc-toc-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
|
|
68
|
+
/* Label above a group of links (Articles, Annexes): a <p> between two lists, or an <li> inside one list. */
|
|
69
|
+
.oc-toc-group-label { margin: 1.25rem 0 0.4rem; padding-inline: 0.5rem; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--oc-subtle-foreground, var(--oc-muted-foreground)); }
|
|
70
|
+
.oc-toc-group-label:first-child { margin-block-start: 0; }
|
|
63
71
|
.oc-toc-link {
|
|
64
72
|
display: block;
|
|
65
73
|
padding: 0.375rem 0.5rem;
|
|
@@ -76,6 +84,9 @@
|
|
|
76
84
|
.oc-toc-link.is-active { color: var(--oc-foreground); border-color: var(--oc-primary); background: oklch(from var(--oc-primary) l c h / 0.1); }
|
|
77
85
|
/* Scroll-spy without JavaScript: the link of the heading you are reading is highlighted (native :target-current). */
|
|
78
86
|
.oc-toc-list { scroll-target-group: auto; }
|
|
87
|
+
/* One group for the whole table of contents, so with several lists (one per group) only one link lights up. */
|
|
88
|
+
.oc-toc { scroll-target-group: auto; }
|
|
89
|
+
.oc-toc .oc-toc-list { scroll-target-group: none; }
|
|
79
90
|
.oc-toc-link:target-current { color: var(--oc-foreground); border-color: var(--oc-primary); background: oklch(from var(--oc-primary) l c h / 0.1); }
|
|
80
91
|
.oc-toc-item--sub { margin-inline-start: 0.75rem; }
|
|
81
92
|
.oc-toc-item--sub .oc-toc-link { font-size: 0.8125rem; }
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// File: packages/ui/src/language-select.d.ts
|
|
2
|
+
// Types for the language select that switches the page.
|
|
3
|
+
|
|
4
|
+
/** Address for a chosen option value: the value, plus the current #hash when it has none of its own. */
|
|
5
|
+
export function languageTarget(value: string, hash?: string, keepHash?: boolean): string;
|
|
6
|
+
/** On change of a [data-oc-language-select], go to the address in the chosen option's value. */
|
|
7
|
+
export function initLanguageSelect(scope?: ParentNode): () => void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// File: packages/ui/src/language-select.js
|
|
2
|
+
// Map: target of an option (its value, + the current #hash) -> on change go there -> boot on [data-oc-language-select]
|
|
3
|
+
// Language select that switches the page: put data-oc-language-select on the .oc-language-select (or on the <select>)
|
|
4
|
+
// and give every <option> the address of the same page in that language as its value. On change the browser goes
|
|
5
|
+
// there, keeping the #section you were reading (data-oc-keep-hash="false" turns that off).
|
|
6
|
+
// Without JavaScript a select cannot switch pages: add the links in a <noscript>, or use the dropdown variant
|
|
7
|
+
// (button.oc-language-select + .oc-dropdown-menu with links), which needs no script at all.
|
|
8
|
+
|
|
9
|
+
/** Address to go to for a chosen option value: the value itself, plus the hash when it has none of its own. */
|
|
10
|
+
export function languageTarget(value, hash = "", keepHash = true) {
|
|
11
|
+
const v = String(value || "").trim();
|
|
12
|
+
if (!v) return "";
|
|
13
|
+
if (!keepHash || !hash || v.includes("#")) return v;
|
|
14
|
+
return v + hash;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Starts every [data-oc-language-select] in scope. Returns a function that stops it. */
|
|
18
|
+
export function initLanguageSelect(scope = document) {
|
|
19
|
+
const doc = scope.ownerDocument || scope;
|
|
20
|
+
const win = doc.defaultView;
|
|
21
|
+
const selects = [...scope.querySelectorAll("[data-oc-language-select]")]
|
|
22
|
+
.map((el) => (el.matches("select") ? el : el.querySelector("select")))
|
|
23
|
+
.filter(Boolean);
|
|
24
|
+
const onChange = (e) => {
|
|
25
|
+
const select = e.currentTarget;
|
|
26
|
+
const host = select.closest("[data-oc-language-select]");
|
|
27
|
+
const keep = (host?.dataset.ocKeepHash ?? select.dataset.ocKeepHash) !== "false";
|
|
28
|
+
const target = languageTarget(select.value, win?.location.hash, keep);
|
|
29
|
+
if (target && win) win.location.assign(target);
|
|
30
|
+
};
|
|
31
|
+
selects.forEach((s) => s.addEventListener("change", onChange));
|
|
32
|
+
return () => selects.forEach((s) => s.removeEventListener("change", onChange));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Starts on its own as /js/oc-language-select.js (`npx omniaui copy-js language-select`), with ?auto in the URL or
|
|
36
|
+
// data-oc-auto on the tag.
|
|
37
|
+
function autoStart() {
|
|
38
|
+
if (typeof document === "undefined") return false;
|
|
39
|
+
const url = String(import.meta.url);
|
|
40
|
+
if (url.includes("oc-language-select") || /[?&]auto(=|&|$)/.test(url)) return true;
|
|
41
|
+
const file = url.split(/[?#]/)[0];
|
|
42
|
+
return [...document.querySelectorAll("script[data-oc-auto][src]")].some((s) => s.src.split(/[?#]/)[0] === file);
|
|
43
|
+
}
|
|
44
|
+
if (autoStart()) {
|
|
45
|
+
const boot = () => initLanguageSelect(document);
|
|
46
|
+
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", boot);
|
|
47
|
+
else boot();
|
|
48
|
+
}
|
package/dist/oc-theme.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* File: oc-theme.css — generated from tokens/semantic.json by @birdycom/omniacss 0.14.
|
|
1
|
+
/* File: oc-theme.css — generated from tokens/semantic.json by @birdycom/omniacss 0.14.2. Do not edit. */
|
|
2
2
|
/* Semantic theme tokens: every color is light-dark() of an Omnia palette token (oc-colors.css). */
|
|
3
3
|
/* Same source as the desktop export: npx omniacss tokens --format json|dtcg|python */
|
|
4
4
|
:root {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
.oc-page-header--bordered { margin-block-end: 1rem; border-block-end: 1px solid var(--oc-border); }
|
|
48
48
|
|
|
49
49
|
/* Sticky: stays on top while the page scrolls (needs a background). */
|
|
50
|
-
.oc-page-header--sticky { position: sticky; inset-block-start:
|
|
50
|
+
.oc-page-header--sticky { position: sticky; inset-block-start: var(--oc-sticky-offset, 0px); z-index: 10; background: var(--oc-background); }
|
|
51
51
|
|
|
52
52
|
/* Small: for sub pages and dialogs. */
|
|
53
53
|
.oc-page-header--sm { padding-block: 0.5rem 0.75rem; }
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
interpolate-size: allow-keywords;
|
|
16
16
|
}
|
|
17
17
|
.oc-severity-card + .oc-severity-card { margin-block-start: 0.5rem; }
|
|
18
|
+
/* In a stack the gap of the stack is the space between the cards; the margin would add to it. */
|
|
19
|
+
.oc-stack > .oc-severity-card + .oc-severity-card { margin-block-start: 0; }
|
|
18
20
|
|
|
19
21
|
/* Head row (summary): icon, title + tags, level badge, chevron. */
|
|
20
22
|
.oc-severity-card-head {
|
|
@@ -72,6 +74,8 @@
|
|
|
72
74
|
.oc-severity-card[open]::details-content { block-size: auto; }
|
|
73
75
|
.oc-severity-card-body { padding: 0 1rem 1rem 3rem; font-size: 0.875rem; line-height: 1.6; color: var(--oc-muted-foreground); }
|
|
74
76
|
.oc-severity-card-body > :first-child { margin-block-start: 0; }
|
|
77
|
+
/* Without an icon in the head the text lines up with the title instead of the icon column. */
|
|
78
|
+
.oc-severity-card:not(:has(> .oc-severity-card-head .oc-severity-card-icon)) .oc-severity-card-body { padding-inline-start: 1rem; }
|
|
75
79
|
.oc-severity-card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block-start: 0.75rem; }
|
|
76
80
|
|
|
77
81
|
/* Levels (theme tokens; critical is a deeper red). */
|
|
@@ -16,17 +16,32 @@
|
|
|
16
16
|
vertical-align: middle;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
/* Tones. --working pulses a ring outwards
|
|
19
|
+
/* Tones. --working pulses a ring outwards: a ::after that only scales and fades (transform + opacity), so the GPU
|
|
20
|
+
draws it and the page does no style or paint work per frame, also in a window that is always open.
|
|
21
|
+
--oc-status-dot-pulses: how many times (default infinite; 3 = pulse three times and then stay a steady dot).
|
|
22
|
+
--still: working without the pulse. */
|
|
23
|
+
:where(.oc-status-dot--working) { position: relative; }
|
|
20
24
|
.oc-status-dot--working {
|
|
21
25
|
--oc-status-dot-color: var(--oc-primary);
|
|
22
|
-
animation: oc-status-dot-pulse 1.8s ease-in-out infinite;
|
|
23
26
|
}
|
|
27
|
+
.oc-status-dot--working::after {
|
|
28
|
+
content: "";
|
|
29
|
+
position: absolute;
|
|
30
|
+
inset: 0;
|
|
31
|
+
border-radius: inherit;
|
|
32
|
+
background: var(--oc-status-dot-color);
|
|
33
|
+
opacity: 0;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
animation: oc-status-dot-pulse 1.8s ease-out var(--oc-status-dot-pulses, infinite);
|
|
36
|
+
}
|
|
37
|
+
.oc-status-dot--still::after { content: none; }
|
|
24
38
|
.oc-status-dot--waiting { --oc-status-dot-color: var(--oc-warning); }
|
|
25
39
|
.oc-status-dot--done { --oc-status-dot-color: var(--oc-success); }
|
|
26
40
|
.oc-status-dot--error { --oc-status-dot-color: var(--oc-destructive); }
|
|
27
41
|
.oc-status-dot--idle { --oc-status-dot-color: var(--oc-muted-foreground); box-shadow: none; opacity: 0.7; }
|
|
28
42
|
@keyframes oc-status-dot-pulse {
|
|
29
|
-
|
|
43
|
+
0% { transform: scale(1); opacity: 0.35; }
|
|
44
|
+
100% { transform: scale(2.25); opacity: 0; }
|
|
30
45
|
}
|
|
31
46
|
|
|
32
47
|
/* Sizes */
|
|
@@ -46,5 +61,5 @@
|
|
|
46
61
|
.oc-status__meta { flex: none; margin-inline-start: auto; color: var(--oc-muted-foreground); font-variant-numeric: tabular-nums; }
|
|
47
62
|
|
|
48
63
|
@media (prefers-reduced-motion: reduce) {
|
|
49
|
-
.oc-status-dot--working { animation: none; }
|
|
64
|
+
.oc-status-dot--working::after { animation: none; }
|
|
50
65
|
}
|
|
@@ -29,9 +29,26 @@
|
|
|
29
29
|
block-size: 0.5rem;
|
|
30
30
|
border-radius: 50%;
|
|
31
31
|
background: var(--oc-version-banner-color);
|
|
32
|
+
position: relative;
|
|
33
|
+
}
|
|
34
|
+
/* The pulse is a ::after that scales and fades (transform + opacity): drawn by the GPU, no work per frame. */
|
|
35
|
+
.oc-version-banner-dot::after {
|
|
36
|
+
content: "";
|
|
37
|
+
position: absolute;
|
|
38
|
+
inset: 0;
|
|
39
|
+
border-radius: inherit;
|
|
40
|
+
background: var(--oc-version-banner-color);
|
|
41
|
+
opacity: 0;
|
|
42
|
+
pointer-events: none;
|
|
32
43
|
animation: oc-version-banner-pulse 2s ease-in-out infinite;
|
|
33
44
|
}
|
|
34
|
-
@keyframes oc-version-banner-pulse {
|
|
45
|
+
@keyframes oc-version-banner-pulse {
|
|
46
|
+
0%, 100% { transform: scale(1); opacity: 0; }
|
|
47
|
+
50% { transform: scale(2); opacity: 0.2; }
|
|
48
|
+
}
|
|
49
|
+
@media (prefers-reduced-motion: reduce) {
|
|
50
|
+
.oc-version-banner-dot::after { animation: none; }
|
|
51
|
+
}
|
|
35
52
|
|
|
36
53
|
/* Text: the long text hides on small screens, the short one shows instead. */
|
|
37
54
|
.oc-version-banner-text { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/* File: packages/ui/src/parts/data-dl-glossary.css | Map: glossary rows (term bold, explanation normal, same top line) */
|
|
2
|
+
/* Glossary: the definition list (.oc-dl) as term + explanation instead of label + value. The term is bold in the
|
|
3
|
+
foreground, the explanation normal text; both use the same line height, so their first lines sit on one line. */
|
|
4
|
+
|
|
5
|
+
.oc-dl--glossary .oc-dl-row { align-items: baseline; }
|
|
6
|
+
.oc-dl--glossary :is(.oc-dl-term, .oc-dl-detail) { line-height: 1.55; }
|
|
7
|
+
.oc-dl--glossary .oc-dl-term { color: var(--oc-foreground); font-weight: 600; }
|
|
8
|
+
.oc-dl--glossary .oc-dl-detail { color: var(--oc-muted-foreground); font-weight: 400; overflow-wrap: break-word; }
|
|
9
|
+
@media (min-width: 40rem) {
|
|
10
|
+
.oc-dl--glossary .oc-dl-row { grid-template-columns: minmax(8rem, var(--oc-dl-term-width, 30%)) minmax(0, 1fr); }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* A definition list inside .oc-prose (a glossary in a privacy policy): the rows keep their own rhythm, not the flow
|
|
14
|
+
margin of the prose (1.1em on every element), and the dd does not get the indent and top margin of a prose dd. */
|
|
15
|
+
.oc-prose .oc-dl > .oc-dl-row { margin-block: 0; }
|
|
16
|
+
.oc-prose .oc-dl :is(.oc-dl-term, .oc-dl-detail) { margin: 0; padding-inline-start: 0; }
|
|
17
|
+
/* Long terms ("Verwerkingsverantwoordelijke") hyphenate in the language of the page; where the browser has no hyphenation for it, they still break instead of running into the explanation. */
|
|
18
|
+
.oc-dl--glossary .oc-dl-term { hyphens: auto; overflow-wrap: break-word; }
|
|
19
|
+
|
|
20
|
+
/* Flush: no margin and no line above the list (a list with no .oc-dl-title above it). */
|
|
21
|
+
.oc-dl--flush { margin-block-start: 0; border-block-start: 0; }
|
|
22
|
+
.oc-dl--flush > .oc-dl-row:first-child { padding-block-start: 0; }
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
.oc-meter-row__value { font-size: 0.8125rem; font-variant-numeric: tabular-nums; color: var(--oc-muted-foreground); white-space: nowrap; }
|
|
15
15
|
.oc-meter-row__value strong { color: var(--oc-foreground); }
|
|
16
16
|
.oc-meter-row__bar {
|
|
17
|
+
contain: layout paint;
|
|
17
18
|
grid-column: 1 / -1;
|
|
18
19
|
block-size: 0.5rem;
|
|
19
20
|
overflow: hidden;
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
}
|
|
57
58
|
.oc-meter-row__subbar {
|
|
58
59
|
--oc-meter-color: var(--oc-muted-foreground);
|
|
60
|
+
contain: layout paint;
|
|
59
61
|
flex: 1;
|
|
60
62
|
min-inline-size: 2rem;
|
|
61
63
|
block-size: 3px;
|
|
@@ -85,6 +87,11 @@
|
|
|
85
87
|
.oc-meter-list--dense .oc-meter-row__label { font-size: 0.8rem; }
|
|
86
88
|
.oc-meter-list--dense .oc-meter-row__value { font-size: 0.75rem; }
|
|
87
89
|
.oc-meter-list--dense .oc-meter-row__bar { block-size: 5px; }
|
|
90
|
+
/* Live meters (a value every few seconds, a window that stays open): no width transition, so no layout per frame.
|
|
91
|
+
The dense list is meant for that, so it has none either. */
|
|
92
|
+
:is(.oc-meter-list--live, .oc-meter-list--dense) .oc-meter-row__bar::before,
|
|
93
|
+
:is(.oc-meter-list--live, .oc-meter-list--dense) .oc-meter-row__subbar::before,
|
|
94
|
+
:is(.oc-meter-list--live, .oc-meter-list--dense) .oc-meter-row__fill { transition: none; }
|
|
88
95
|
|
|
89
96
|
@media (prefers-reduced-motion: reduce) {
|
|
90
97
|
.oc-meter-row__bar::before,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* File: packages/ui/src/parts/data-step-list.css | Map: list (one column, counter) -> row (number + text) -> number color
|
|
2
|
+
-> links -> small */
|
|
3
|
+
/* Step list: a compact numbered list of steps inside a card or a disclosure ("How to remove this", the steps per
|
|
4
|
+
service, what a scan does). One row per step: the number on the left in the display font, the text on the right.
|
|
5
|
+
The number takes --oc-step-list-color, else the color of the severity card it sits in (--oc-severity-color), else
|
|
6
|
+
primary. Start at another number: style="counter-reset: oc-step-list 3" (the first step is then 4).
|
|
7
|
+
Not to be confused with .oc-steps, the large process section of a website. */
|
|
8
|
+
|
|
9
|
+
.oc-step-list {
|
|
10
|
+
display: grid;
|
|
11
|
+
gap: 0.6rem;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
list-style: none;
|
|
15
|
+
/* One column that never grows with its widest step (a <pre> or a long URL stays inside the card). */
|
|
16
|
+
grid-template-columns: minmax(0, 1fr);
|
|
17
|
+
counter-reset: oc-step-list;
|
|
18
|
+
font-size: 0.875rem;
|
|
19
|
+
line-height: 1.5;
|
|
20
|
+
}
|
|
21
|
+
/* The text flows as normal text (bold words and links stay inline); the number hangs in the indent on the first line. */
|
|
22
|
+
.oc-step-list > li {
|
|
23
|
+
position: relative;
|
|
24
|
+
min-inline-size: 0;
|
|
25
|
+
padding-inline-start: 1.85rem;
|
|
26
|
+
overflow-wrap: anywhere;
|
|
27
|
+
counter-increment: oc-step-list;
|
|
28
|
+
}
|
|
29
|
+
.oc-step-list > li::before {
|
|
30
|
+
content: counter(oc-step-list);
|
|
31
|
+
position: absolute;
|
|
32
|
+
inset-block-start: 0;
|
|
33
|
+
inset-inline-start: 0;
|
|
34
|
+
inline-size: 1.25rem;
|
|
35
|
+
color: var(--oc-step-list-color, var(--oc-severity-color, var(--oc-primary)));
|
|
36
|
+
font-family: var(--oc-font-display, inherit);
|
|
37
|
+
font-weight: 700;
|
|
38
|
+
font-variant-numeric: tabular-nums;
|
|
39
|
+
text-align: end;
|
|
40
|
+
}
|
|
41
|
+
.oc-step-list > li > :first-child { margin-block-start: 0; }
|
|
42
|
+
.oc-step-list > li > :last-child { margin-block-end: 0; }
|
|
43
|
+
.oc-step-list a { text-underline-offset: 2px; }
|
|
44
|
+
/* A code block in a step scrolls inside the step. */
|
|
45
|
+
.oc-step-list pre { max-inline-size: 100%; overflow-x: auto; overflow-wrap: normal; }
|
|
46
|
+
|
|
47
|
+
/* Small: tighter rows and a smaller text, for a dense panel. */
|
|
48
|
+
.oc-step-list--sm { gap: 0.4rem; font-size: 0.8125rem; }
|
|
@@ -105,3 +105,65 @@ button.oc-language-select:hover { background: var(--oc-surface); }
|
|
|
105
105
|
.oc-language-select--code::after,
|
|
106
106
|
.oc-language-select--code .oc-language-select-icon { display: none; }
|
|
107
107
|
.oc-language-select--code .oc-language-select-control { position: absolute; inset: 0; padding: 0; opacity: 0; }
|
|
108
|
+
|
|
109
|
+
/* Open list in the OmniaUI dropdown look (Chrome and Edge 135+: customizable select, appearance: base-select).
|
|
110
|
+
The native list of the system looked like a bare Windows list: narrow, small, no padding. Now it is a popover with
|
|
111
|
+
the colors, padding, radius and shadow of .oc-dropdown-menu, as wide as the longest language (at least 8rem), with a check at the current
|
|
112
|
+
language. Other browsers keep the system list (the select still works the same). */
|
|
113
|
+
@supports (appearance: base-select) {
|
|
114
|
+
.oc-language-select-control,
|
|
115
|
+
.oc-language-select-control::picker(select) { appearance: base-select; }
|
|
116
|
+
.oc-language-select-control {
|
|
117
|
+
min-inline-size: 0;
|
|
118
|
+
border: 0;
|
|
119
|
+
background: transparent;
|
|
120
|
+
}
|
|
121
|
+
/* The list lines up with the whole pill (icon included), not only with the select inside it. anchor-scope keeps
|
|
122
|
+
every pill its own anchor when a page has several. */
|
|
123
|
+
.oc-language-select:has(> .oc-language-select-control) { anchor-name: --oc-language-select; anchor-scope: --oc-language-select; }
|
|
124
|
+
.oc-language-select-control::picker(select) { position-anchor: --oc-language-select; }
|
|
125
|
+
/* The label draws its own chevron (::after). */
|
|
126
|
+
.oc-language-select-control::picker-icon { display: none; }
|
|
127
|
+
.oc-language-select-control::picker(select) {
|
|
128
|
+
/* As wide as the longest language, at least 8rem and never narrower than the field. */
|
|
129
|
+
min-inline-size: max(8rem, anchor-size(inline));
|
|
130
|
+
margin-block: 4px;
|
|
131
|
+
padding: 4px;
|
|
132
|
+
border: 1px solid var(--oc-border);
|
|
133
|
+
border-radius: var(--oc-radius);
|
|
134
|
+
background: var(--oc-popover);
|
|
135
|
+
color: var(--oc-popover-foreground);
|
|
136
|
+
box-shadow: 0 8px 24px oklch(from var(--color-black-60) l c h / 0.15);
|
|
137
|
+
font-size: 0.875rem;
|
|
138
|
+
font-weight: 400;
|
|
139
|
+
letter-spacing: normal;
|
|
140
|
+
text-transform: none;
|
|
141
|
+
position-area: block-end span-inline-end;
|
|
142
|
+
/* Under the field; above it only when it does not fit below (normal order: no "side with the most room"). */
|
|
143
|
+
position-try-order: normal;
|
|
144
|
+
position-try-fallbacks: flip-block;
|
|
145
|
+
}
|
|
146
|
+
.oc-language-select-control option {
|
|
147
|
+
display: flex;
|
|
148
|
+
align-items: center;
|
|
149
|
+
gap: 1rem;
|
|
150
|
+
padding: 8px 10px;
|
|
151
|
+
border-radius: calc(var(--oc-radius) - 2px);
|
|
152
|
+
background: transparent;
|
|
153
|
+
color: inherit;
|
|
154
|
+
cursor: pointer;
|
|
155
|
+
}
|
|
156
|
+
.oc-language-select-control option:hover,
|
|
157
|
+
.oc-language-select-control option:focus-visible {
|
|
158
|
+
background: var(--oc-accent);
|
|
159
|
+
color: var(--oc-accent-foreground);
|
|
160
|
+
outline: none;
|
|
161
|
+
}
|
|
162
|
+
.oc-language-select-control option:checked { font-weight: 600; }
|
|
163
|
+
/* The check of the current language on the right, in the primary color. */
|
|
164
|
+
.oc-language-select-control option::checkmark { order: 1; margin-inline-start: auto; color: var(--oc-primary); }
|
|
165
|
+
|
|
166
|
+
/* Code: the select lies over the whole button (still invisible text), the list opens under it, aligned right. */
|
|
167
|
+
.oc-language-select--code .oc-language-select-control { opacity: 1; color: transparent; overflow: hidden; }
|
|
168
|
+
.oc-language-select--code .oc-language-select-control::picker(select) { position-area: block-end span-inline-start; }
|
|
169
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* File: packages/ui/src/parts/site-doc-layout.css */
|
|
2
|
+
/* Map: sticky offset (token, auto under a site header, scroll padding for anchors) -> document layout (side column +
|
|
3
|
+
text) -> sticky side column from 64rem -> a table of contents inside it */
|
|
4
|
+
/* A document page with a side column (a table of contents next to a privacy policy, terms or a manual) and the offset
|
|
5
|
+
that keeps sticky parts and anchor jumps clear of a sticky site header.
|
|
6
|
+
--oc-sticky-offset: how far from the top sticky parts stop. Set it yourself (:root { --oc-sticky-offset: 5rem }), or
|
|
7
|
+
let it follow .oc-site-header: its height (--oc-site-header-height, 4.5rem) plus 1rem. Used by .oc-toc,
|
|
8
|
+
.oc-doc-layout__aside, .oc-page-header--sticky and the scroll padding of the page, so a heading you jump to from the
|
|
9
|
+
table of contents is not hidden under the header. */
|
|
10
|
+
|
|
11
|
+
/* Only the header of the page itself (not one shown as an example inside <main>); :where keeps it overridable, also
|
|
12
|
+
by a scroll-p* utility on <html>. */
|
|
13
|
+
:where(html:has(.oc-site-header:not(main *))) { --oc-sticky-offset: calc(var(--oc-site-header-height, 4.5rem) + 1rem); }
|
|
14
|
+
:where(html) { scroll-padding-block-start: var(--oc-sticky-offset, 0px); }
|
|
15
|
+
|
|
16
|
+
/* Document layout: side column (--oc-doc-aside, 17rem) and the text; stacked below 64rem, side column first.
|
|
17
|
+
--end puts the side column on the right on a wide screen. */
|
|
18
|
+
.oc-doc-layout {
|
|
19
|
+
display: grid;
|
|
20
|
+
gap: var(--oc-doc-gap, 2rem 4rem);
|
|
21
|
+
align-items: start;
|
|
22
|
+
}
|
|
23
|
+
.oc-doc-layout__aside,
|
|
24
|
+
.oc-doc-layout__main { min-inline-size: 0; }
|
|
25
|
+
@media (min-width: 64rem) {
|
|
26
|
+
.oc-doc-layout { grid-template-columns: var(--oc-doc-aside, 17rem) minmax(0, 1fr); }
|
|
27
|
+
.oc-doc-layout--end { grid-template-columns: minmax(0, 1fr) var(--oc-doc-aside, 17rem); }
|
|
28
|
+
.oc-doc-layout--end > .oc-doc-layout__aside { order: 1; }
|
|
29
|
+
/* Sticky only next to the text: stacked on a phone it would stay over the text. */
|
|
30
|
+
.oc-doc-layout__aside {
|
|
31
|
+
position: sticky;
|
|
32
|
+
inset-block-start: var(--oc-sticky-offset, 0px);
|
|
33
|
+
max-block-size: calc(100dvh - var(--oc-sticky-offset, 0px) - 1rem);
|
|
34
|
+
overflow: auto;
|
|
35
|
+
overscroll-behavior: contain;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/* The column is sticky itself, so the table of contents in it is not. */
|
|
39
|
+
.oc-doc-layout__aside .oc-toc { position: static; max-block-size: none; overflow: visible; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* File: packages/ui/src/parts/site-layout.css */
|
|
2
|
-
/* Map: page hero -> section head / more -> action row -> group title -> band -> meta line */
|
|
2
|
+
/* Map: page hero -> section head (split) / more -> action row -> group title -> band -> meta line */
|
|
3
3
|
/* Page building blocks for a marketing or company site, on top of the showcase classes (.oc-section-pad, .oc-display):
|
|
4
4
|
the larger header of an inner page, a section head and a "see more" row, a row of buttons, a group title with a count,
|
|
5
5
|
a full-width band (for a stat strip) and a meta line (version · date). */
|
|
@@ -20,6 +20,20 @@
|
|
|
20
20
|
margin-inline: auto;
|
|
21
21
|
text-align: center;
|
|
22
22
|
}
|
|
23
|
+
/* Split: the title on the left, the lead on the right (one column below 56rem). Put the eyebrow and the title in a
|
|
24
|
+
<div>, the lead next to it. */
|
|
25
|
+
.oc-section-head--split {
|
|
26
|
+
display: grid;
|
|
27
|
+
gap: 1rem 4rem;
|
|
28
|
+
align-items: end;
|
|
29
|
+
max-inline-size: none;
|
|
30
|
+
}
|
|
31
|
+
.oc-section-head--split > :last-child,
|
|
32
|
+
.oc-section-head--split > div > :last-child { margin-block-end: 0; }
|
|
33
|
+
@media (min-width: 56rem) {
|
|
34
|
+
.oc-section-head--split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
|
|
35
|
+
.oc-section-head--split > .oc-lead { justify-self: end; max-inline-size: 36rem; }
|
|
36
|
+
}
|
|
23
37
|
.oc-section-more { margin-block-start: 2.5rem; }
|
|
24
38
|
|
|
25
39
|
/* Row of buttons under a text: wraps on a narrow screen. */
|
package/dist/parts/site-neon.css
CHANGED
|
@@ -3,16 +3,30 @@
|
|
|
3
3
|
Colors: --oc-accent-from and --oc-accent-to (brand-1 and brand-2, or an .oc-accent--* preset).
|
|
4
4
|
.oc-glow-border goes on anything with a border: <form class="oc-glass oc-glow-border">, an .oc-card, a panel. */
|
|
5
5
|
|
|
6
|
+
/* The element keeps a steady border and glow in --oc-accent-from; a ::after with the border and a wider glow in
|
|
7
|
+
--oc-accent-to fades in and out over it. Only opacity animates, so the GPU does it: no style or paint work per frame.
|
|
8
|
+
position: relative only when the element has no position of its own (:where = no specificity). */
|
|
9
|
+
:where(.oc-glow-border) { position: relative; }
|
|
6
10
|
.oc-glow-border {
|
|
7
11
|
border-color: var(--oc-accent-from);
|
|
8
12
|
box-shadow: 0 0 10px oklch(from var(--oc-accent-from) l c h / 0.35), var(--oc-glow-extra, 0 0 transparent);
|
|
13
|
+
}
|
|
14
|
+
.oc-glow-border::after {
|
|
15
|
+
content: "";
|
|
16
|
+
position: absolute;
|
|
17
|
+
inset: calc(-1 * var(--oc-glow-border-width, 1px));
|
|
18
|
+
border: var(--oc-glow-border-width, 1px) solid var(--oc-accent-to);
|
|
19
|
+
border-radius: inherit;
|
|
20
|
+
box-shadow: 0 0 20px oklch(from var(--oc-accent-to) l c h / 0.35);
|
|
21
|
+
opacity: 0;
|
|
22
|
+
pointer-events: none;
|
|
9
23
|
animation: oc-glow-border var(--oc-glow-border-duration, 3s) ease-in-out infinite;
|
|
10
24
|
}
|
|
11
25
|
/* Glass keeps its light top edge and drop shadow under the glow. */
|
|
12
26
|
.oc-glass.oc-glow-border { --oc-glow-extra: var(--oc-glass-shadow), inset 0 1px 0 var(--oc-glass-edge-hi); }
|
|
13
27
|
@keyframes oc-glow-border {
|
|
14
|
-
0%, 100% {
|
|
15
|
-
50% {
|
|
28
|
+
0%, 100% { opacity: 0; }
|
|
29
|
+
50% { opacity: 1; }
|
|
16
30
|
}
|
|
17
31
|
|
|
18
32
|
/* Neon button: gradient from one accent to the other, with a glow. --oc-btn-neon-ink sets the text color. */
|
|
@@ -29,5 +43,5 @@
|
|
|
29
43
|
.oc-btn--neon:disabled { color: var(--oc-muted-foreground); background: var(--oc-muted); box-shadow: none; }
|
|
30
44
|
|
|
31
45
|
@media (prefers-reduced-motion: reduce) {
|
|
32
|
-
.oc-glow-border { animation: none; }
|
|
46
|
+
.oc-glow-border::after { animation: none; }
|
|
33
47
|
}
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
.oc-prose :where(h3) { margin-block-start: 1.6em; font-size: 1.2em; }
|
|
24
24
|
.oc-prose :where(h4) { margin-block-start: 1.4em; font-size: 1em; }
|
|
25
25
|
.oc-prose :where(h1, h2, h3, h4) + :where(*) { margin-block-start: 0.6em; }
|
|
26
|
-
|
|
26
|
+
/* Room above a heading you jump to: 5rem, or 0.5rem on top of the page's scroll padding (--oc-sticky-offset). */
|
|
27
|
+
.oc-prose :where(h2, h3, h4) { scroll-margin-block-start: max(0.5rem, 5rem - var(--oc-sticky-offset, 0px)); }
|
|
27
28
|
|
|
28
29
|
/* ---- Paragraphs ---- */
|
|
29
30
|
.oc-prose :where(p) { text-wrap: pretty; }
|
|
@@ -146,3 +147,5 @@
|
|
|
146
147
|
.oc-prose--legal :where(a) { color: var(--oc-brand-1); font-weight: inherit; text-decoration-color: currentColor; text-underline-offset: 3px; }
|
|
147
148
|
.oc-prose--legal :where(a:hover) { color: var(--oc-foreground); }
|
|
148
149
|
.oc-prose--legal :where(table) { font-size: 0.93rem; }
|
|
150
|
+
/* Ruled: a line under every h2, so the articles of a long document stand apart (with --legal or any prose). */
|
|
151
|
+
.oc-prose--ruled :where(h2) { padding-block-end: 0.6rem; border-block-end: 1px solid var(--oc-border); }
|