@prismora/css 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +18 -2
- package/dist/components/accordion.css +57 -0
- package/dist/components/alert.css +31 -0
- package/dist/components/avatar.css +34 -0
- package/dist/components/badge.css +25 -0
- package/dist/components/banner.css +25 -0
- package/dist/components/breadcrumb.css +37 -0
- package/dist/components/button.css +162 -0
- package/dist/components/calendar.css +60 -0
- package/dist/components/card.css +34 -0
- package/dist/components/carousel.css +70 -0
- package/dist/components/chart.css +63 -0
- package/dist/components/chat.css +66 -0
- package/dist/components/checkbox.css +67 -0
- package/dist/components/color-picker.css +78 -0
- package/dist/components/combobox.css +42 -0
- package/dist/components/command.css +58 -0
- package/dist/components/data-table.css +295 -0
- package/dist/components/description-list.css +24 -0
- package/dist/components/dialog.css +58 -0
- package/dist/components/drawer.css +60 -0
- package/dist/components/editor.css +46 -0
- package/dist/components/empty-state.css +30 -0
- package/dist/components/extras.css +99 -0
- package/dist/components/field.css +38 -0
- package/dist/components/file-upload.css +48 -0
- package/dist/components/helpers.css +128 -0
- package/dist/components/icon.css +21 -0
- package/dist/components/image.css +28 -0
- package/dist/components/indicator.css +56 -0
- package/dist/components/input.css +109 -0
- package/dist/components/kbd.css +26 -0
- package/dist/components/list.css +77 -0
- package/dist/components/listbox.css +56 -0
- package/dist/components/meter.css +34 -0
- package/dist/components/nav.css +116 -0
- package/dist/components/number-input.css +33 -0
- package/dist/components/overlay.css +34 -0
- package/dist/components/pagination.css +47 -0
- package/dist/components/pickers.css +68 -0
- package/dist/components/pin-input.css +21 -0
- package/dist/components/popover.css +110 -0
- package/dist/components/progress.css +40 -0
- package/dist/components/pull-refresh.css +39 -0
- package/dist/components/range-slider.css +76 -0
- package/dist/components/rating.css +34 -0
- package/dist/components/scheduler.css +65 -0
- package/dist/components/segmented.css +41 -0
- package/dist/components/select.css +69 -0
- package/dist/components/separator.css +22 -0
- package/dist/components/sheet.css +47 -0
- package/dist/components/skeleton.css +25 -0
- package/dist/components/slider.css +57 -0
- package/dist/components/sortable.css +31 -0
- package/dist/components/spinner.css +21 -0
- package/dist/components/splitter.css +40 -0
- package/dist/components/stat.css +32 -0
- package/dist/components/steps.css +74 -0
- package/dist/components/surface.css +24 -0
- package/dist/components/switch.css +56 -0
- package/dist/components/table.css +95 -0
- package/dist/components/tabs.css +124 -0
- package/dist/components/tag.css +59 -0
- package/dist/components/time-picker.css +24 -0
- package/dist/components/timeline.css +43 -0
- package/dist/components/toast.css +84 -0
- package/dist/components/toggle.css +45 -0
- package/dist/components/toolbar.css +20 -0
- package/dist/components/tooltip.css +26 -0
- package/dist/components/tree.css +60 -0
- package/dist/core.css +4275 -0
- package/dist/foundation.css +898 -0
- package/dist/prismora.css +4682 -0
- package/dist/theme.css +409 -0
- package/dist/tone.css +11 -0
- package/dist/typography.css +157 -0
- package/package.json +42 -4
- package/src/base.css +66 -0
- package/src/components/accordion.css +54 -0
- package/src/components/alert.css +28 -0
- package/src/components/avatar.css +31 -0
- package/src/components/badge.css +22 -0
- package/src/components/banner.css +22 -0
- package/src/components/breadcrumb.css +34 -0
- package/src/components/button.css +159 -0
- package/src/components/calendar.css +57 -0
- package/src/components/card.css +31 -0
- package/src/components/carousel.css +67 -0
- package/src/components/chart.css +60 -0
- package/src/components/chat.css +63 -0
- package/src/components/checkbox.css +64 -0
- package/src/components/color-picker.css +75 -0
- package/src/components/combobox.css +39 -0
- package/src/components/command.css +55 -0
- package/src/components/data-table.css +292 -0
- package/src/components/description-list.css +21 -0
- package/src/components/dialog.css +55 -0
- package/src/components/drawer.css +57 -0
- package/src/components/editor.css +43 -0
- package/src/components/empty-state.css +27 -0
- package/src/components/extras.css +96 -0
- package/src/components/field.css +35 -0
- package/src/components/file-upload.css +45 -0
- package/src/components/helpers.css +125 -0
- package/src/components/icon.css +18 -0
- package/src/components/image.css +25 -0
- package/src/components/indicator.css +53 -0
- package/src/components/input.css +106 -0
- package/src/components/kbd.css +23 -0
- package/src/components/list.css +74 -0
- package/src/components/listbox.css +53 -0
- package/src/components/meter.css +31 -0
- package/src/components/nav.css +113 -0
- package/src/components/number-input.css +30 -0
- package/src/components/overlay.css +31 -0
- package/src/components/pagination.css +44 -0
- package/src/components/pickers.css +65 -0
- package/src/components/pin-input.css +18 -0
- package/src/components/popover.css +107 -0
- package/src/components/progress.css +37 -0
- package/src/components/pull-refresh.css +36 -0
- package/src/components/range-slider.css +73 -0
- package/src/components/rating.css +31 -0
- package/src/components/scheduler.css +62 -0
- package/src/components/segmented.css +38 -0
- package/src/components/select.css +66 -0
- package/src/components/separator.css +19 -0
- package/src/components/sheet.css +44 -0
- package/src/components/skeleton.css +22 -0
- package/src/components/slider.css +54 -0
- package/src/components/sortable.css +28 -0
- package/src/components/spinner.css +18 -0
- package/src/components/splitter.css +37 -0
- package/src/components/stat.css +29 -0
- package/src/components/steps.css +71 -0
- package/src/components/surface.css +21 -0
- package/src/components/switch.css +53 -0
- package/src/components/table.css +92 -0
- package/src/components/tabs.css +121 -0
- package/src/components/tag.css +56 -0
- package/src/components/time-picker.css +21 -0
- package/src/components/timeline.css +40 -0
- package/src/components/toast.css +81 -0
- package/src/components/toggle.css +42 -0
- package/src/components/toolbar.css +17 -0
- package/src/components/tooltip.css +23 -0
- package/src/components/tree.css +57 -0
- package/src/layers.css +2 -0
- package/src/layout.css +113 -0
- package/src/reset.css +18 -0
- package/src/typography.css +154 -0
- package/src/utilities.css +99 -0
package/src/layout.css
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* Page layout: split, switcher, scroll lanes and the app shell. Page-level only (never adopted by component
|
|
2
|
+
shadow roots), so single-element bundles stay small. */
|
|
3
|
+
/* Layout variables apply only where they are set: a gap or column size on an outer stack must not leak into the
|
|
4
|
+
stacks, clusters and grids nested inside it. (Browsers without @property inherit them, as before.) */
|
|
5
|
+
@property --pm-gap { syntax: "*"; inherits: false; }
|
|
6
|
+
@property --pm-grid-min { syntax: "*"; inherits: false; }
|
|
7
|
+
@property --pm-side { syntax: "*"; inherits: false; }
|
|
8
|
+
@property --pm-split-min { syntax: "*"; inherits: false; }
|
|
9
|
+
@property --pm-split-align { syntax: "*"; inherits: false; }
|
|
10
|
+
@property --pm-switch-at { syntax: "*"; inherits: false; }
|
|
11
|
+
@property --pm-col { syntax: "*"; inherits: false; }
|
|
12
|
+
@layer pm.utilities {
|
|
13
|
+
/* Two parts side by side that stack when there is no room (no media query): the first is a sidebar of
|
|
14
|
+
--pm-side width, the rest takes the remaining space and wraps below once it would be narrower than --pm-split-min.
|
|
15
|
+
data-side="end" puts the sidebar second (summaries, order totals). */
|
|
16
|
+
.pm-split { display: flex; flex-wrap: wrap; align-items: var(--pm-split-align, flex-start); gap: var(--pm-gap, var(--pm-space-6)); }
|
|
17
|
+
.pm-split > * { min-inline-size: 0; }
|
|
18
|
+
.pm-split > :first-child { flex: 1 1 var(--pm-side, 18rem); }
|
|
19
|
+
.pm-split > :last-child { flex: 999 1 0; min-inline-size: min(100%, var(--pm-split-min, 55%)); }
|
|
20
|
+
.pm-split[data-side="end"] > :first-child { flex: 999 1 0; min-inline-size: min(100%, var(--pm-split-min, 55%)); }
|
|
21
|
+
.pm-split[data-side="end"] > :last-child { flex: 1 1 var(--pm-side, 18rem); min-inline-size: 0; }
|
|
22
|
+
/* Equal columns that become a single column below --pm-switch-at (container width, not viewport). */
|
|
23
|
+
.pm-switcher { display: flex; flex-wrap: wrap; gap: var(--pm-gap, var(--pm-space-4)); }
|
|
24
|
+
.pm-switcher > * { flex-grow: 1; flex-basis: calc((var(--pm-switch-at, 40rem) - 100%) * 999); min-inline-size: 0; }
|
|
25
|
+
/* Horizontal lane of fixed-width columns or cards (boards, carousels of cards); give it tabindex="0" and a label. */
|
|
26
|
+
.pm-scroll-x {
|
|
27
|
+
display: grid;
|
|
28
|
+
grid-auto-flow: column;
|
|
29
|
+
grid-auto-columns: var(--pm-col, min(85%, 18rem));
|
|
30
|
+
gap: var(--pm-gap, var(--pm-space-4));
|
|
31
|
+
min-inline-size: 0;
|
|
32
|
+
max-inline-size: 100%;
|
|
33
|
+
overflow-x: auto;
|
|
34
|
+
overscroll-behavior-x: contain;
|
|
35
|
+
scroll-snap-type: x proximity;
|
|
36
|
+
scroll-padding-inline: var(--pm-space-1);
|
|
37
|
+
padding-block-end: var(--pm-space-2);
|
|
38
|
+
& > * { scroll-snap-align: start; }
|
|
39
|
+
&:focus-visible { outline: 2px solid var(--pm-color-ring); outline-offset: 2px; }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* ---------- App shell: <div class="pm-app" mobile> <aside class="pm-app-side">…<pm-nav></aside>
|
|
43
|
+
<div class="pm-app-main"><header class="pm-app-bar">…</header><main class="pm-app-content">…</main></div></div>
|
|
44
|
+
Sidebar on wide screens; on phones only the nav stays and pm-nav (with mobile) becomes the bottom tab bar. ---------- */
|
|
45
|
+
.pm-app {
|
|
46
|
+
display: grid;
|
|
47
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
48
|
+
min-block-size: 100dvh;
|
|
49
|
+
background: var(--pm-color-bg-canvas);
|
|
50
|
+
color: var(--pm-color-fg);
|
|
51
|
+
}
|
|
52
|
+
.pm-app-side {
|
|
53
|
+
position: sticky;
|
|
54
|
+
inset-block-start: 0;
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: var(--pm-space-4);
|
|
58
|
+
inline-size: var(--pm-app-side, 16rem);
|
|
59
|
+
block-size: 100dvh;
|
|
60
|
+
padding: var(--pm-space-4) var(--pm-space-3);
|
|
61
|
+
overflow-y: auto;
|
|
62
|
+
border-inline-end: 1px solid var(--pm-color-border);
|
|
63
|
+
background: var(--pm-color-bg-subtle);
|
|
64
|
+
}
|
|
65
|
+
.pm-app-main { display: flex; flex-direction: column; min-inline-size: 0; }
|
|
66
|
+
.pm-app-bar {
|
|
67
|
+
position: sticky;
|
|
68
|
+
inset-block-start: 0;
|
|
69
|
+
z-index: var(--pm-z-sticky);
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: var(--pm-space-2);
|
|
73
|
+
min-block-size: 3.5rem;
|
|
74
|
+
padding-inline: var(--pm-space-4);
|
|
75
|
+
border-block-end: 1px solid var(--pm-color-border);
|
|
76
|
+
background: color-mix(in oklab, var(--pm-color-bg-canvas) 88%, transparent);
|
|
77
|
+
backdrop-filter: blur(12px);
|
|
78
|
+
@supports not (backdrop-filter: blur(1px)) { background: var(--pm-color-bg-canvas); }
|
|
79
|
+
}
|
|
80
|
+
.pm-app-content { flex: 1; display: flex; flex-direction: column; gap: var(--pm-gap, var(--pm-space-6)); padding: var(--pm-space-6) var(--pm-space-4); inline-size: min(100%, var(--pm-container, 72rem)); margin-inline: auto; }
|
|
81
|
+
.pm-app-content > * { min-inline-size: 0; }
|
|
82
|
+
/* The sidebar may carry `popover` (so phones can open it as a drawer): on wide screens it stays in the page. */
|
|
83
|
+
.pm-app-side:where([popover]) { inset: auto; inset-block-start: 0; margin: 0; border-width: 0; border-inline-end-width: 1px; color: inherit; }
|
|
84
|
+
/* Menu button for the drawer: <pm-button class="pm-app-menu" popovertarget="app-side">; phones without a tab bar only. */
|
|
85
|
+
.pm-app-menu { display: none; }
|
|
86
|
+
@media (width < 40rem) {
|
|
87
|
+
.pm-app { grid-template-columns: minmax(0, 1fr); }
|
|
88
|
+
.pm-app-content { padding-block: var(--pm-space-4); }
|
|
89
|
+
/* Native mobile (pm-nav became the bottom tab bar): only the nav stays. */
|
|
90
|
+
.pm-app:has(pm-nav[data-bar]) .pm-app-side { display: contents; }
|
|
91
|
+
.pm-app:has(pm-nav[data-bar]) .pm-app-side > :not(pm-nav) { display: none; }
|
|
92
|
+
.pm-app:has(pm-nav[data-bar]) .pm-app-main { padding-block-end: calc(4.5rem + env(safe-area-inset-bottom)); }
|
|
93
|
+
/* Responsive web: the sidebar is an off-canvas drawer, opened by .pm-app-menu. */
|
|
94
|
+
.pm-app:not(:has(pm-nav[data-bar])) {
|
|
95
|
+
& .pm-app-menu { display: inline-flex; }
|
|
96
|
+
& .pm-app-side:not(:popover-open) { display: none; }
|
|
97
|
+
& .pm-app-side:popover-open {
|
|
98
|
+
position: fixed;
|
|
99
|
+
inset-inline: 0 auto;
|
|
100
|
+
inline-size: min(100% - 3rem, 20rem);
|
|
101
|
+
max-block-size: none;
|
|
102
|
+
background: var(--pm-color-bg-surface);
|
|
103
|
+
box-shadow: var(--pm-elevation-4);
|
|
104
|
+
&::backdrop { background: var(--pm-color-overlay); }
|
|
105
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
106
|
+
transition: translate var(--pm-duration-moderate) var(--pm-ease-emphasized), display var(--pm-duration-moderate) allow-discrete, overlay var(--pm-duration-moderate) allow-discrete;
|
|
107
|
+
@starting-style { translate: -100% 0; }
|
|
108
|
+
&:dir(rtl) { @starting-style { translate: 100% 0; } }
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
package/src/reset.css
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* Targeted reset: no `*` selectors, so web components and lower layers stay overridable. */
|
|
2
|
+
@layer pm.reset {
|
|
3
|
+
:where(html) {
|
|
4
|
+
-webkit-text-size-adjust: none;
|
|
5
|
+
text-size-adjust: none;
|
|
6
|
+
interpolate-size: allow-keywords;
|
|
7
|
+
}
|
|
8
|
+
:where(body) { margin: 0; min-block-size: 100dvh; }
|
|
9
|
+
:where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) { margin-block: 0; }
|
|
10
|
+
:where(ul[role="list"], ol[role="list"]) { list-style: none; margin: 0; padding: 0; }
|
|
11
|
+
:where(img, picture, video, canvas, svg) { display: block; max-inline-size: 100%; block-size: auto; }
|
|
12
|
+
:where(input, button, textarea, select) { font: inherit; letter-spacing: inherit; }
|
|
13
|
+
:where(button) { color: inherit; }
|
|
14
|
+
:where(textarea:not([rows])) { min-block-size: 6em; }
|
|
15
|
+
:where([class^="pm-"], [class*=" pm-"]),
|
|
16
|
+
:where([class^="pm-"], [class*=" pm-"])::before,
|
|
17
|
+
:where([class^="pm-"], [class*=" pm-"])::after { box-sizing: border-box; }
|
|
18
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/* Typography: long-form prose and text utilities. Families, sizes, weights, leading, tracking and measure are
|
|
2
|
+
tokens (--pm-font-*, --pm-font-size-*, --pm-font-weight-*, --pm-line-height-*, --pm-tracking-*, --pm-measure-*);
|
|
3
|
+
switch every family at once with data-font="<pairing>" on any element. */
|
|
4
|
+
@layer pm.components {
|
|
5
|
+
/* ---------- Prose: <article class="pm-prose"> for Markdown/CMS output ---------- */
|
|
6
|
+
:where(.pm-prose) {
|
|
7
|
+
max-inline-size: var(--pm-prose-measure, var(--pm-measure-normal));
|
|
8
|
+
font-family: var(--pm-font-body);
|
|
9
|
+
font-size: var(--pm-prose-size, var(--pm-font-size-md));
|
|
10
|
+
line-height: var(--pm-line-height-relaxed);
|
|
11
|
+
color: var(--pm-color-fg);
|
|
12
|
+
overflow-wrap: break-word;
|
|
13
|
+
hyphens: auto;
|
|
14
|
+
|
|
15
|
+
& > :where(* + *) { margin-block-start: 1.1em; }
|
|
16
|
+
& :where(h1, h2, h3, h4, h5, h6) {
|
|
17
|
+
font-family: var(--pm-font-display);
|
|
18
|
+
line-height: var(--pm-line-height-tight);
|
|
19
|
+
letter-spacing: var(--pm-tracking-tight);
|
|
20
|
+
text-wrap: balance;
|
|
21
|
+
scroll-margin-block-start: 5rem;
|
|
22
|
+
}
|
|
23
|
+
& :where(h1) { font-size: var(--pm-font-size-4xl); font-weight: var(--pm-font-weight-bold); }
|
|
24
|
+
& :where(h2) { font-size: var(--pm-font-size-2xl); font-weight: var(--pm-font-weight-bold); margin-block-start: 2em; }
|
|
25
|
+
& :where(h3) { font-size: var(--pm-font-size-xl); font-weight: var(--pm-font-weight-semibold); margin-block-start: 1.6em; }
|
|
26
|
+
& :where(h4, h5, h6) { font-size: var(--pm-font-size-lg); font-weight: var(--pm-font-weight-semibold); margin-block-start: 1.4em; }
|
|
27
|
+
& :where(h1, h2, h3, h4, h5, h6) + :where(*) { margin-block-start: 0.6em; }
|
|
28
|
+
& :where(p, li) { text-wrap: pretty; }
|
|
29
|
+
& :where(.pm-lead, p.lead) { font-size: var(--pm-font-size-lg); color: var(--pm-color-fg-muted); }
|
|
30
|
+
& :where(strong, b) { font-weight: var(--pm-font-weight-semibold); color: var(--pm-color-fg); }
|
|
31
|
+
& :where(a) { color: var(--pm-color-accent-text); text-decoration-line: underline; text-underline-offset: 0.2em; }
|
|
32
|
+
& :where(ul, ol) { padding-inline-start: 1.4em; }
|
|
33
|
+
& :where(li + li, li > ul, li > ol) { margin-block-start: 0.4em; }
|
|
34
|
+
& :where(li::marker) { color: var(--pm-color-fg-muted); }
|
|
35
|
+
& :where(ol > li::marker) { font-variant-numeric: tabular-nums; }
|
|
36
|
+
& :where(blockquote) {
|
|
37
|
+
margin-inline: 0;
|
|
38
|
+
padding-inline-start: 1em;
|
|
39
|
+
border-inline-start: 3px solid var(--pm-color-accent-border);
|
|
40
|
+
color: var(--pm-color-fg-muted);
|
|
41
|
+
font-style: italic;
|
|
42
|
+
}
|
|
43
|
+
& :where(hr) { border: 0; border-block-start: 1px solid var(--pm-color-border); margin-block: 2.5em; }
|
|
44
|
+
& :where(code):not(:where(pre *)) {
|
|
45
|
+
padding: 0.12em 0.36em;
|
|
46
|
+
border-radius: var(--pm-radius-xs, 4px);
|
|
47
|
+
background: var(--pm-color-bg-muted);
|
|
48
|
+
font-family: var(--pm-font-mono);
|
|
49
|
+
font-size: 0.88em;
|
|
50
|
+
}
|
|
51
|
+
& :where(pre) {
|
|
52
|
+
padding: 1em 1.2em;
|
|
53
|
+
border: 1px solid var(--pm-color-border);
|
|
54
|
+
border-radius: var(--pm-radius-lg);
|
|
55
|
+
background: var(--pm-color-bg-subtle);
|
|
56
|
+
font-family: var(--pm-font-mono);
|
|
57
|
+
font-size: 0.85em;
|
|
58
|
+
line-height: var(--pm-line-height-normal);
|
|
59
|
+
overflow-x: auto;
|
|
60
|
+
tab-size: 2;
|
|
61
|
+
}
|
|
62
|
+
& :where(kbd) {
|
|
63
|
+
padding: 0.1em 0.4em;
|
|
64
|
+
border: 1px solid var(--pm-color-border-strong);
|
|
65
|
+
border-block-end-width: 2px;
|
|
66
|
+
border-radius: var(--pm-radius-sm);
|
|
67
|
+
font-family: var(--pm-font-sans);
|
|
68
|
+
font-size: 0.85em;
|
|
69
|
+
}
|
|
70
|
+
& :where(mark) { background: var(--pm-color-warning-soft); color: inherit; padding-inline: 0.15em; border-radius: 2px; }
|
|
71
|
+
& :where(abbr[title]) { text-decoration: underline dotted; cursor: help; }
|
|
72
|
+
& :where(img, video, svg, canvas, iframe) { max-inline-size: 100%; block-size: auto; border-radius: var(--pm-radius-md); }
|
|
73
|
+
& :where(figure) { margin-inline: 0; }
|
|
74
|
+
& :where(figcaption) { margin-block-start: 0.6em; color: var(--pm-color-fg-muted); font-size: var(--pm-font-size-sm); text-align: center; }
|
|
75
|
+
& :where(table) { inline-size: 100%; border-collapse: collapse; font-size: 0.92em; font-variant-numeric: tabular-nums; }
|
|
76
|
+
& :where(th, td) { padding: 0.55em 0.7em; border-block-end: 1px solid var(--pm-color-border); text-align: start; vertical-align: top; }
|
|
77
|
+
& :where(th) { color: var(--pm-color-fg-muted); font-weight: var(--pm-font-weight-semibold); }
|
|
78
|
+
& :where(dt) { font-weight: var(--pm-font-weight-semibold); }
|
|
79
|
+
& :where(dd) { margin-inline-start: 1.2em; color: var(--pm-color-fg-muted); }
|
|
80
|
+
& :where(details) { padding: 0.6em 0.9em; border: 1px solid var(--pm-color-border); border-radius: var(--pm-radius-md); }
|
|
81
|
+
& :where(summary) { cursor: pointer; font-weight: var(--pm-font-weight-semibold); }
|
|
82
|
+
|
|
83
|
+
&:where([data-size="sm"]) { --pm-prose-size: var(--pm-font-size-sm); }
|
|
84
|
+
&:where([data-size="lg"]) { --pm-prose-size: var(--pm-font-size-lg); }
|
|
85
|
+
&:where([data-measure="narrow"]) { --pm-prose-measure: var(--pm-measure-narrow); }
|
|
86
|
+
&:where([data-measure="wide"]) { --pm-prose-measure: var(--pm-measure-wide); }
|
|
87
|
+
&:where([data-measure="none"]) { --pm-prose-measure: none; }
|
|
88
|
+
/* Narrow screens: tables scroll inside the text column instead of widening the page. */
|
|
89
|
+
@media (width < 40rem) { & :where(table) { display: block; overflow-x: auto; } }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
@layer pm.utilities {
|
|
94
|
+
/* ---------- Families ---------- */
|
|
95
|
+
.pm-font-sans { font-family: var(--pm-font-sans); }
|
|
96
|
+
.pm-font-serif { font-family: var(--pm-font-serif); }
|
|
97
|
+
.pm-font-display { font-family: var(--pm-font-display); }
|
|
98
|
+
.pm-font-mono { font-family: var(--pm-font-mono); }
|
|
99
|
+
.pm-font-body { font-family: var(--pm-font-body); }
|
|
100
|
+
|
|
101
|
+
/* ---------- Sizes (fluid: larger steps shrink slightly on small screens) ---------- */
|
|
102
|
+
.pm-text-2xs { font-size: calc(var(--pm-font-size-xs) * 0.9); }
|
|
103
|
+
.pm-text-md { font-size: var(--pm-font-size-md); }
|
|
104
|
+
.pm-text-lg { font-size: var(--pm-font-size-lg); }
|
|
105
|
+
.pm-text-xl { font-size: var(--pm-font-size-xl); }
|
|
106
|
+
.pm-text-2xl { font-size: var(--pm-font-size-2xl); line-height: var(--pm-line-height-snug); }
|
|
107
|
+
.pm-text-3xl { font-size: var(--pm-font-size-3xl); line-height: var(--pm-line-height-tight); }
|
|
108
|
+
.pm-text-4xl { font-size: var(--pm-font-size-4xl); line-height: var(--pm-line-height-tight); }
|
|
109
|
+
.pm-text-5xl { font-size: var(--pm-font-size-5xl); line-height: var(--pm-line-height-tight); letter-spacing: var(--pm-tracking-tighter); }
|
|
110
|
+
/* Headings by look, independent of the element (keep h1–h6 for document structure). */
|
|
111
|
+
.pm-display { font-family: var(--pm-font-display); font-size: var(--pm-font-size-5xl); font-weight: var(--pm-font-weight-bold); line-height: 1.05; letter-spacing: var(--pm-tracking-tighter); text-wrap: balance; }
|
|
112
|
+
.pm-heading { font-family: var(--pm-font-display); font-weight: var(--pm-font-weight-semibold); line-height: var(--pm-line-height-tight); letter-spacing: var(--pm-tracking-tight); text-wrap: balance; }
|
|
113
|
+
.pm-lead { font-size: var(--pm-font-size-lg); line-height: var(--pm-line-height-relaxed); color: var(--pm-color-fg-muted); text-wrap: pretty; }
|
|
114
|
+
.pm-eyebrow { font-size: var(--pm-font-size-xs); font-weight: var(--pm-font-weight-semibold); letter-spacing: var(--pm-tracking-widest); text-transform: uppercase; color: var(--pm-color-accent-text); }
|
|
115
|
+
.pm-caption { font-size: var(--pm-font-size-xs); color: var(--pm-color-fg-muted); }
|
|
116
|
+
|
|
117
|
+
/* ---------- Weight, style, leading, tracking ---------- */
|
|
118
|
+
.pm-weight-regular { font-weight: var(--pm-font-weight-regular); }
|
|
119
|
+
.pm-weight-medium { font-weight: var(--pm-font-weight-medium); }
|
|
120
|
+
.pm-weight-semibold { font-weight: var(--pm-font-weight-semibold); }
|
|
121
|
+
.pm-weight-bold { font-weight: var(--pm-font-weight-bold); }
|
|
122
|
+
.pm-italic { font-style: italic; }
|
|
123
|
+
.pm-leading-tight { line-height: var(--pm-line-height-tight); }
|
|
124
|
+
.pm-leading-snug { line-height: var(--pm-line-height-snug); }
|
|
125
|
+
.pm-leading-normal { line-height: var(--pm-line-height-normal); }
|
|
126
|
+
.pm-leading-relaxed { line-height: var(--pm-line-height-relaxed); }
|
|
127
|
+
.pm-tracking-tight { letter-spacing: var(--pm-tracking-tight); }
|
|
128
|
+
.pm-tracking-wide { letter-spacing: var(--pm-tracking-wide); }
|
|
129
|
+
.pm-uppercase { text-transform: uppercase; letter-spacing: var(--pm-tracking-wider); }
|
|
130
|
+
|
|
131
|
+
/* ---------- Colour, alignment, wrapping ---------- */
|
|
132
|
+
.pm-text-fg { color: var(--pm-color-fg); }
|
|
133
|
+
.pm-text-accent { color: var(--pm-color-accent-text); }
|
|
134
|
+
.pm-text-success { color: var(--pm-color-success-text); }
|
|
135
|
+
.pm-text-warning { color: var(--pm-color-warning-text); }
|
|
136
|
+
.pm-text-danger { color: var(--pm-color-danger-text); }
|
|
137
|
+
.pm-text-start { text-align: start; }
|
|
138
|
+
.pm-text-center { text-align: center; }
|
|
139
|
+
.pm-text-end { text-align: end; }
|
|
140
|
+
.pm-balance { text-wrap: balance; }
|
|
141
|
+
.pm-pretty { text-wrap: pretty; }
|
|
142
|
+
.pm-nowrap { white-space: nowrap; }
|
|
143
|
+
.pm-measure { max-inline-size: var(--pm-measure-normal); }
|
|
144
|
+
.pm-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-inline-size: 0; }
|
|
145
|
+
.pm-line-clamp {
|
|
146
|
+
display: -webkit-box;
|
|
147
|
+
-webkit-box-orient: vertical;
|
|
148
|
+
-webkit-line-clamp: var(--pm-lines, 2);
|
|
149
|
+
line-clamp: var(--pm-lines, 2);
|
|
150
|
+
overflow: hidden;
|
|
151
|
+
}
|
|
152
|
+
.pm-tabular { font-variant-numeric: tabular-nums; }
|
|
153
|
+
.pm-slashed-zero { font-variant-numeric: slashed-zero; }
|
|
154
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* Utilities: layout primitives, a11y helpers, motion presets, scroll-driven reveals. */
|
|
2
|
+
|
|
3
|
+
@layer pm.utilities {
|
|
4
|
+
/* ---------- Layout primitives ---------- */
|
|
5
|
+
.pm-stack { display: flex; flex-direction: column; gap: var(--pm-gap, var(--pm-space-4)); }
|
|
6
|
+
.pm-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--pm-gap, var(--pm-space-2)); }
|
|
7
|
+
.pm-grid {
|
|
8
|
+
display: grid;
|
|
9
|
+
gap: var(--pm-gap, var(--pm-space-4));
|
|
10
|
+
grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--pm-grid-min, 16rem)), 1fr));
|
|
11
|
+
}
|
|
12
|
+
.pm-container { inline-size: min(100% - 2 * var(--pm-space-4), var(--pm-container, 72rem)); margin-inline: auto; }
|
|
13
|
+
.pm-center { display: grid; place-items: center; }
|
|
14
|
+
.pm-spacer { flex: 1; }
|
|
15
|
+
.pm-divider { border: 0; border-block-start: 1px solid var(--pm-color-border); margin: 0; }
|
|
16
|
+
.pm-muted { color: var(--pm-color-fg-muted); }
|
|
17
|
+
.pm-text-sm { font-size: var(--pm-font-size-sm); }
|
|
18
|
+
.pm-text-xs { font-size: var(--pm-font-size-xs); }
|
|
19
|
+
.pm-gradient-text {
|
|
20
|
+
background: linear-gradient(110deg in oklch, var(--pm-color-accent-text), var(--pm-color-secondary-text));
|
|
21
|
+
background-clip: text;
|
|
22
|
+
color: transparent;
|
|
23
|
+
@media (forced-colors: active) { background: none; color: CanvasText; }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* ---------- Accessibility ---------- */
|
|
27
|
+
.pm-visually-hidden:not(:focus, :active) {
|
|
28
|
+
position: absolute;
|
|
29
|
+
/* Explicit offsets: without them the box keeps its static position, which inside a horizontal scroller can lie
|
|
30
|
+
outside the viewport and widen the page. */
|
|
31
|
+
inset-block-start: 0;
|
|
32
|
+
inset-inline-start: 0;
|
|
33
|
+
inline-size: 1px;
|
|
34
|
+
block-size: 1px;
|
|
35
|
+
margin: -1px;
|
|
36
|
+
padding: 0;
|
|
37
|
+
border: 0;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
clip-path: inset(50%);
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ---------- Motion presets: data-animate="fade|scale|slide-up|slide-down|blur|pop" ----------
|
|
44
|
+
Entry animations play on insertion via @starting-style; spatial movement only without reduced motion. */
|
|
45
|
+
[data-animate] {
|
|
46
|
+
transition: opacity var(--pm-duration-slow) var(--pm-ease-standard);
|
|
47
|
+
@starting-style { opacity: 0; }
|
|
48
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
49
|
+
transition:
|
|
50
|
+
opacity var(--pm-duration-slow) var(--pm-ease-standard),
|
|
51
|
+
translate var(--pm-duration-slow) var(--pm-ease-spring),
|
|
52
|
+
scale var(--pm-duration-slow) var(--pm-ease-spring),
|
|
53
|
+
filter var(--pm-duration-slow) var(--pm-ease-standard);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
57
|
+
[data-animate="scale"] { @starting-style { scale: 0.95; } }
|
|
58
|
+
[data-animate="pop"] { @starting-style { scale: 0.8; } }
|
|
59
|
+
[data-animate="slide-up"] { @starting-style { translate: 0 1rem; } }
|
|
60
|
+
[data-animate="slide-down"] { @starting-style { translate: 0 -1rem; } }
|
|
61
|
+
[data-animate="blur"] { @starting-style { filter: blur(8px); } }
|
|
62
|
+
/* Stagger children: uses sibling-index() where available, else a fixed nth-child ladder. */
|
|
63
|
+
[data-stagger] > * { transition-delay: calc(var(--pm-stagger-i, 0) * 45ms); }
|
|
64
|
+
[data-stagger] > :nth-child(2) { --pm-stagger-i: 1; }
|
|
65
|
+
[data-stagger] > :nth-child(3) { --pm-stagger-i: 2; }
|
|
66
|
+
[data-stagger] > :nth-child(4) { --pm-stagger-i: 3; }
|
|
67
|
+
[data-stagger] > :nth-child(5) { --pm-stagger-i: 4; }
|
|
68
|
+
[data-stagger] > :nth-child(6) { --pm-stagger-i: 5; }
|
|
69
|
+
[data-stagger] > :nth-child(n + 7) { --pm-stagger-i: 6; }
|
|
70
|
+
@supports (order: sibling-index()) {
|
|
71
|
+
[data-stagger] > * { --pm-stagger-i: calc(sibling-index() - 1); }
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ---------- Scroll-driven reveal (progressive; content is fully visible without support) ---------- */
|
|
76
|
+
@supports (animation-timeline: view()) {
|
|
77
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
78
|
+
[data-reveal] {
|
|
79
|
+
animation: pm-reveal linear both;
|
|
80
|
+
animation-timeline: view();
|
|
81
|
+
animation-range: entry 0% entry 60%;
|
|
82
|
+
}
|
|
83
|
+
[data-parallax] {
|
|
84
|
+
animation: pm-parallax linear both;
|
|
85
|
+
animation-timeline: view();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
@keyframes pm-reveal {
|
|
90
|
+
from { opacity: 0; translate: 0 2rem; scale: 0.98; }
|
|
91
|
+
}
|
|
92
|
+
@keyframes pm-parallax {
|
|
93
|
+
from { translate: 0 calc(var(--pm-parallax, 40px) * -1); }
|
|
94
|
+
to { translate: 0 var(--pm-parallax, 40px); }
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* View transitions: the theme switcher uses ::view-transition-new(root); keep its blend normal. */
|
|
98
|
+
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; }
|
|
99
|
+
}
|