@aitrien/motifspec 1.25.1 → 1.27.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/CHANGELOG.md +31 -0
- package/dist/codex.css +232 -4
- package/dist/codex.js +301 -3
- package/dist/contrast.md +9 -1
- package/dist/icons.svg +1 -0
- package/dist/tokens.css +9 -3
- package/dist/tokens.js +103 -5
- package/dist/tokens.json +103 -5
- package/docs/components/_groups.json +2 -0
- package/docs/components/alert.md +134 -0
- package/docs/components/breadcrumb.md +76 -0
- package/docs/components/button-and-link.md +19 -1
- package/docs/components/callout.md +2 -1
- package/docs/components/choice.md +104 -0
- package/docs/components/date-picker.md +108 -0
- package/docs/components/dialog.md +148 -0
- package/docs/components/docs-shell.md +7 -1
- package/docs/components/field.md +181 -0
- package/docs/components/icon.md +3 -0
- package/docs/components/status.md +1 -1
- package/docs/components/toast.md +101 -0
- package/docs/hugo.md +4 -1
- package/docs/layouts/dashboard.md +5 -5
- package/docs/layouts/documentation.md +1 -1
- package/icons/manifest.json +8 -4
- package/icons/svg/calendar_today.svg +1 -0
- package/layouts/_partials/motifspec/alert.html +21 -0
- package/layouts/_partials/motifspec/breadcrumb.html +12 -0
- package/layouts/_partials/motifspec/field.html +53 -0
- package/package.json +1 -1
- package/scripts/lib.mjs +7 -0
- package/tokens/color.json +76 -2
- package/tokens/motion.json +15 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Every release of MotifSpec (named brand-codex until 1.10.0), newest first. Entries before 1.10.0 keep the names they were released under. Versions follow the rules in `CONVENTIONS.md`: renaming or removing a semantic token is major, adding tokens, components or icons is minor, and changing a value or fixing a description is a patch. `npm run build` fails if the version in `package.json` has no entry here.
|
|
4
4
|
|
|
5
|
+
## [1.27.0] - 2026-11-19
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Field (`field.md`, shared): a text field, select or text area with its label on the top border. The label rests where the text goes and moves to the border when the field has focus or a value, with no script. Focus doubles the field's border in `color.accent.border`, with no ring outside it. Hints, errors, "(optional)", disabled fields, `--mono` and `--short` controls, and fieldsets. In Hugo, `motifspec/field.html` writes one.
|
|
9
|
+
- Choice (`choice.md`, shared): checkboxes, radio buttons and switches (a checkbox with `role="switch"`), as native inputs in the accent colour.
|
|
10
|
+
- Date picker (`date-picker.md`, shared): a date field with a calendar, opened from a button `codex.js` shows. The month and the year open grids of their own (twenty years at a time), the keyboard moves through each, and the calendar is a fixed size, opening above the field when there's more room there and scrolling with it.
|
|
11
|
+
- Dialog (`dialog.md`, shared): a native `<dialog>` with a head, a close button and the actions in a recessed band; `--wide` for a form. `[data-dialog-open]` and `[data-dialog-close]` open and close it, and a click outside closes it unless it has `data-dialog-keep`. On a phone it docks to the bottom, and a form fills the screen.
|
|
12
|
+
- A danger button (`cx-button--danger`) for confirming a destructive action in a dialog, on the new `color.status.danger.fill`, `color.status.danger.fill-hover` and `color.text.on-danger`.
|
|
13
|
+
- `color.surface.selected` for the chosen item among options, such as a calendar's date, and the `calendar` icon.
|
|
14
|
+
- A Forms group on the Components page, and the dialog in Messages.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- The dashboard layout's form controls and dialog are available.
|
|
18
|
+
- A component preview grows while a dialog or calendar is open in it.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- An alert no longer takes the full height of a flex column, such as a dashboard's main region.
|
|
22
|
+
|
|
23
|
+
## [1.26.0] - 2026-11-18
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- Alert (`alert.md`, shared): a message about the page or the system at the top of the main column, in four kinds (info, success, warning and danger) with an optional dismiss button. With a key, a dismissed alert stays dismissed on later pages. In Hugo, `motifspec/alert.html` writes one.
|
|
27
|
+
- Toast (`toast.md`, shared): a short confirmation at the bottom of the screen, sent with a `cx-toast` event and shown by `codex.js` in one polite live region per page. It stays for the new `motion.duration.toast` (6 seconds), and the time starts again while the pointer or focus is on it.
|
|
28
|
+
- Breadcrumb (`breadcrumb.md`, documentation layout): the trail from the home page to the page's section, first in the page head. In Hugo, `motifspec/breadcrumb.html` writes it from the page's ancestors.
|
|
29
|
+
- A Messages group on the Components page, with the callout, alert and toast.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- The dashboard layout's alerts are alerts (`alert.md`), not callouts. motifspec.com shows a deprecated page's notice as an alert, and the breadcrumb on every page below a section.
|
|
33
|
+
- `color.surface.inverse` and `color.text.inverse` are for toasts as well as tooltips.
|
|
34
|
+
- The primitive behind `motion.duration.drift` is now `primitive.motion.duration.7`; its value hasn't changed.
|
|
35
|
+
|
|
5
36
|
## [1.25.1] - 2026-11-18
|
|
6
37
|
|
|
7
38
|
### Changed
|
package/dist/codex.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-latin-wght.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
|
|
3
3
|
@font-face { font-family: "Yarndings 12"; src: url("../fonts/yarndings-12-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
|
|
4
4
|
|
|
5
|
-
/* MotifSpec 1.
|
|
5
|
+
/* MotifSpec 1.27.0 — generated from tokens/*.json. Do not edit.
|
|
6
6
|
Themes: semantic colours use light-dark(); color-scheme follows the system unless
|
|
7
7
|
<html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
|
|
8
8
|
:root {
|
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
--cx-color-surface-hover: light-dark(var(--cx-primitive-color-ash-100), var(--cx-primitive-color-ash-800));
|
|
105
105
|
--cx-color-surface-inverse: light-dark(var(--cx-primitive-color-ash-900), var(--cx-primitive-color-ash-100));
|
|
106
106
|
--cx-color-surface-highlight: light-dark(var(--cx-primitive-color-sap-100), var(--cx-primitive-color-sap-800));
|
|
107
|
+
--cx-color-surface-selected: light-dark(var(--cx-primitive-color-sap-100), var(--cx-primitive-color-sap-800));
|
|
107
108
|
|
|
108
109
|
/* color.text */
|
|
109
110
|
--cx-color-text-primary: light-dark(var(--cx-primitive-color-ash-950), var(--cx-primitive-color-ash-100));
|
|
@@ -112,6 +113,7 @@
|
|
|
112
113
|
--cx-color-text-accent: light-dark(var(--cx-primitive-color-sap-700), var(--cx-primitive-color-sap-300));
|
|
113
114
|
--cx-color-text-inverse: light-dark(var(--cx-primitive-color-ash-50), var(--cx-primitive-color-ash-900));
|
|
114
115
|
--cx-color-text-on-accent: light-dark(var(--cx-primitive-color-ash-0), var(--cx-primitive-color-ash-1000));
|
|
116
|
+
--cx-color-text-on-danger: light-dark(var(--cx-primitive-color-ash-0), var(--cx-primitive-color-ash-1000));
|
|
115
117
|
|
|
116
118
|
/* color.link */
|
|
117
119
|
--cx-color-link-rest: light-dark(var(--cx-primitive-color-sap-800), var(--cx-primitive-color-sap-300));
|
|
@@ -145,6 +147,8 @@
|
|
|
145
147
|
--cx-color-status-danger-text: light-dark(var(--cx-primitive-color-madder-700), var(--cx-primitive-color-madder-300));
|
|
146
148
|
--cx-color-status-danger-surface: light-dark(var(--cx-primitive-color-madder-50), var(--cx-primitive-color-madder-950));
|
|
147
149
|
--cx-color-status-danger-border: light-dark(var(--cx-primitive-color-madder-600), var(--cx-primitive-color-madder-400));
|
|
150
|
+
--cx-color-status-danger-fill: light-dark(var(--cx-primitive-color-madder-700), var(--cx-primitive-color-madder-300));
|
|
151
|
+
--cx-color-status-danger-fill-hover: light-dark(var(--cx-primitive-color-madder-800), var(--cx-primitive-color-madder-200));
|
|
148
152
|
--cx-color-status-info-text: light-dark(var(--cx-primitive-color-woad-700), var(--cx-primitive-color-woad-300));
|
|
149
153
|
--cx-color-status-info-surface: light-dark(var(--cx-primitive-color-woad-50), var(--cx-primitive-color-woad-950));
|
|
150
154
|
--cx-color-status-info-border: light-dark(var(--cx-primitive-color-woad-600), var(--cx-primitive-color-woad-400));
|
|
@@ -194,7 +198,8 @@
|
|
|
194
198
|
--cx-primitive-motion-duration-3: 320ms;
|
|
195
199
|
--cx-primitive-motion-duration-4: 1600ms;
|
|
196
200
|
--cx-primitive-motion-duration-5: 3200ms;
|
|
197
|
-
--cx-primitive-motion-duration-6:
|
|
201
|
+
--cx-primitive-motion-duration-6: 6000ms;
|
|
202
|
+
--cx-primitive-motion-duration-7: 60000ms;
|
|
198
203
|
|
|
199
204
|
/* primitive.motion.easing */
|
|
200
205
|
--cx-primitive-motion-easing-out-strong: cubic-bezier(0.2, 0, 0, 1);
|
|
@@ -212,8 +217,9 @@
|
|
|
212
217
|
--cx-motion-duration-base: var(--cx-primitive-motion-duration-2);
|
|
213
218
|
--cx-motion-duration-slow: var(--cx-primitive-motion-duration-3);
|
|
214
219
|
--cx-motion-duration-plate: var(--cx-primitive-motion-duration-4);
|
|
215
|
-
--cx-motion-duration-drift: var(--cx-primitive-motion-duration-
|
|
220
|
+
--cx-motion-duration-drift: var(--cx-primitive-motion-duration-7);
|
|
216
221
|
--cx-motion-duration-settle: var(--cx-primitive-motion-duration-5);
|
|
222
|
+
--cx-motion-duration-toast: var(--cx-primitive-motion-duration-6);
|
|
217
223
|
--cx-motion-duration-pulse: var(--cx-primitive-motion-duration-5); /* Deprecated: Unused since the contour plate; removed in 2.0.0. */
|
|
218
224
|
|
|
219
225
|
/* motion.easing */
|
|
@@ -517,7 +523,7 @@ p, li, dd, figcaption { text-wrap: pretty; }
|
|
|
517
523
|
.cx-skip-link:focus { transform: none; }
|
|
518
524
|
|
|
519
525
|
/* Shared label voice: mono, uppercase, tracked. */
|
|
520
|
-
.cx-eyebrow, .cx-label dt, .cx-table thead th, .cx-toc summary, .cx-code__bar, .cx-callout__title, .cx-footer h2, .cx-figure__plate, .cx-catalogue__name {
|
|
526
|
+
.cx-eyebrow, .cx-label dt, .cx-table thead th, .cx-toc summary, .cx-code__bar, .cx-callout__title, .cx-footer h2, .cx-figure__plate, .cx-catalogue__name, .cx-breadcrumb {
|
|
521
527
|
font-family: var(--cx-font-family-mono);
|
|
522
528
|
font-size: var(--cx-font-size-label);
|
|
523
529
|
font-weight: var(--cx-font-weight-ui);
|
|
@@ -1005,6 +1011,8 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
|
|
|
1005
1011
|
.cx-button:hover { background: var(--cx-color-surface-hover); }
|
|
1006
1012
|
.cx-button--primary { border-color: var(--cx-color-accent-fill-rest); background: var(--cx-color-accent-fill-rest); color: var(--cx-color-text-on-accent); }
|
|
1007
1013
|
.cx-button--primary:hover { border-color: var(--cx-color-accent-fill-hover); background: var(--cx-color-accent-fill-hover); }
|
|
1014
|
+
.cx-button--danger { border-color: var(--cx-color-status-danger-fill); background: var(--cx-color-status-danger-fill); color: var(--cx-color-text-on-danger); }
|
|
1015
|
+
.cx-button--danger:hover { border-color: var(--cx-color-status-danger-fill-hover); background: var(--cx-color-status-danger-fill-hover); }
|
|
1008
1016
|
.cx-button[disabled], .cx-button[aria-disabled="true"] { cursor: not-allowed; border-style: dashed; background: transparent; color: var(--cx-color-text-muted); }
|
|
1009
1017
|
.cx-button--sm { min-height: var(--cx-size-target-min); padding-inline: var(--cx-space-inset-md); }
|
|
1010
1018
|
.cx-button__arrow { display: inline-block; transition: transform var(--cx-motion-duration-fast) var(--cx-motion-easing-standard); }
|
|
@@ -1018,6 +1026,18 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
|
|
|
1018
1026
|
.cx-link:hover, .cx-back:hover { color: var(--cx-color-link-hover); text-decoration-thickness: var(--cx-border-width-emphasis); }
|
|
1019
1027
|
.cx-back { font-family: var(--cx-font-family-mono); font-size: var(--cx-font-size-label); font-weight: var(--cx-font-weight-ui); letter-spacing: var(--cx-font-tracking-label); text-transform: uppercase; text-decoration: none; }
|
|
1020
1028
|
|
|
1029
|
+
/* ------------------------------------------------------------ breadcrumb (breadcrumb.md, documentation layout) */
|
|
1030
|
+
/* The trail from the home page to the page's parent, above the h1. The separators are hidden from assistive
|
|
1031
|
+
technology (the alternative text after the slash is empty); the list already says how the links relate. */
|
|
1032
|
+
.cx-breadcrumb__list { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--cx-space-inline-sm); margin: 0; padding: 0; list-style: none; }
|
|
1033
|
+
.cx-breadcrumb__list > li { display: inline-flex; align-items: center; gap: var(--cx-space-inline-sm); margin: 0; }
|
|
1034
|
+
.cx-breadcrumb__list > li + li::before { content: "/"; content: "/" / ""; color: var(--cx-color-text-muted); }
|
|
1035
|
+
.cx-breadcrumb a {
|
|
1036
|
+
display: inline-flex; align-items: center; min-height: var(--cx-size-target-min); color: var(--cx-color-text-secondary);
|
|
1037
|
+
text-decoration: none; text-underline-offset: var(--cx-space-inline-xs);
|
|
1038
|
+
}
|
|
1039
|
+
.cx-breadcrumb a:hover { color: var(--cx-color-text-primary); text-decoration: underline; text-decoration-thickness: var(--cx-border-width-hairline); }
|
|
1040
|
+
|
|
1021
1041
|
/* ------------------------------------------------------------ prose */
|
|
1022
1042
|
.cx-prose { min-width: 0; }
|
|
1023
1043
|
.cx-prose > * { margin-block: 0; }
|
|
@@ -1164,6 +1184,214 @@ a.cx-tag:hover { border-color: var(--cx-color-accent-border); color: var(--cx-co
|
|
|
1164
1184
|
.cx-callout--warning { --_border: var(--cx-color-status-warning-border); --_bg: var(--cx-color-status-warning-surface); --_title: var(--cx-color-status-warning-text); }
|
|
1165
1185
|
.cx-callout--danger { --_border: var(--cx-color-status-danger-border); --_bg: var(--cx-color-status-danger-surface); --_title: var(--cx-color-status-danger-text); }
|
|
1166
1186
|
|
|
1187
|
+
/* ------------------------------------------------------------ alert (alert.md) */
|
|
1188
|
+
/* A message about the page or the system, at the top of the main column: icon, body, and an optional dismiss button
|
|
1189
|
+
that codex.js shows. The emphasis rule along the top sets it apart from a callout, which sits in the running text. */
|
|
1190
|
+
.cx-alert {
|
|
1191
|
+
--_border: var(--cx-color-status-info-border); --_bg: var(--cx-color-status-info-surface); --_ink: var(--cx-color-status-info-text);
|
|
1192
|
+
display: flex; align-items: flex-start; gap: var(--cx-space-inline-md); padding: var(--cx-space-inset-md);
|
|
1193
|
+
border: var(--cx-border-width-hairline) solid var(--_border); border-block-start-width: var(--cx-border-width-emphasis);
|
|
1194
|
+
background: var(--_bg); color: var(--cx-color-text-primary); line-height: var(--cx-font-line-height-ui);
|
|
1195
|
+
width: 100%; /* a whole row in a flex row too; flex-basis would take the full height in a flex column */
|
|
1196
|
+
}
|
|
1197
|
+
.cx-alert[hidden] { display: none; }
|
|
1198
|
+
:where(main) > .cx-alert { margin-block-end: var(--cx-space-stack-lg); }
|
|
1199
|
+
.cx-alert__icon { flex: none; color: var(--_ink); margin-block-start: calc((1lh - var(--cx-size-icon-md)) / 2); } /* centred on the first line */
|
|
1200
|
+
.cx-alert__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--cx-space-stack-xs); }
|
|
1201
|
+
.cx-alert__body > * { margin: 0; max-width: var(--cx-size-measure-prose); }
|
|
1202
|
+
.cx-alert__title { font-weight: var(--cx-font-weight-strong); }
|
|
1203
|
+
.cx-alert--success { --_border: var(--cx-color-status-success-border); --_bg: var(--cx-color-status-success-surface); --_ink: var(--cx-color-status-success-text); }
|
|
1204
|
+
.cx-alert--warning { --_border: var(--cx-color-status-warning-border); --_bg: var(--cx-color-status-warning-surface); --_ink: var(--cx-color-status-warning-text); }
|
|
1205
|
+
.cx-alert--danger { --_border: var(--cx-color-status-danger-border); --_bg: var(--cx-color-status-danger-surface); --_ink: var(--cx-color-status-danger-text); }
|
|
1206
|
+
.cx-alert__dismiss, .cx-toast__dismiss {
|
|
1207
|
+
flex: none; display: inline-grid; place-items: center; inline-size: var(--cx-size-target-min); block-size: var(--cx-size-target-min);
|
|
1208
|
+
margin: calc(var(--cx-space-inset-xs) * -1); padding: 0; border: 0; border-radius: var(--cx-radius-control);
|
|
1209
|
+
background: transparent; color: inherit; cursor: pointer;
|
|
1210
|
+
}
|
|
1211
|
+
.cx-alert__dismiss[hidden] { display: none; }
|
|
1212
|
+
.cx-alert__dismiss:hover { background: var(--cx-color-surface-hover); }
|
|
1213
|
+
.cx-alert__dismiss:focus-visible { outline: var(--cx-border-focus-width) solid var(--cx-color-focus-ring); outline-offset: var(--cx-border-focus-offset); }
|
|
1214
|
+
|
|
1215
|
+
/* ------------------------------------------------------------ toast (toast.md) */
|
|
1216
|
+
/* codex.js keeps one region per page, fixed at the end of the viewport, and adds a toast to it on a cx-toast event.
|
|
1217
|
+
The region is a polite live region, so each toast is read once without moving focus. */
|
|
1218
|
+
.cx-toasts {
|
|
1219
|
+
position: fixed; z-index: 40; inset-block-end: var(--cx-space-gutter-page); inset-inline: var(--cx-space-gutter-page);
|
|
1220
|
+
display: flex; flex-direction: column; align-items: flex-end; gap: var(--cx-space-stack-sm); pointer-events: none;
|
|
1221
|
+
}
|
|
1222
|
+
.cx-toast {
|
|
1223
|
+
display: flex; align-items: center; gap: var(--cx-space-inline-sm); max-width: var(--cx-size-column-card);
|
|
1224
|
+
padding: var(--cx-space-inset-sm) var(--cx-space-inset-sm) var(--cx-space-inset-sm) var(--cx-space-inset-md);
|
|
1225
|
+
border-radius: var(--cx-radius-control); background: var(--cx-color-surface-inverse); color: var(--cx-color-text-inverse);
|
|
1226
|
+
font-size: var(--cx-font-size-small); line-height: var(--cx-font-line-height-ui); pointer-events: auto;
|
|
1227
|
+
}
|
|
1228
|
+
.cx-toast__text { flex: 1; min-width: 0; margin: 0; }
|
|
1229
|
+
.cx-toast__dismiss { margin: 0; }
|
|
1230
|
+
.cx-toast__dismiss:focus-visible { outline: var(--cx-border-focus-width) solid var(--cx-color-text-inverse); outline-offset: calc(var(--cx-border-focus-width) * -2); }
|
|
1231
|
+
.cx-toasts .cx-toast {
|
|
1232
|
+
opacity: 0; transform: translateY(var(--cx-motion-distance-nudge));
|
|
1233
|
+
transition: opacity var(--cx-motion-duration-base) var(--cx-motion-easing-enter), transform var(--cx-motion-duration-base) var(--cx-motion-easing-enter);
|
|
1234
|
+
}
|
|
1235
|
+
.cx-toasts .cx-toast.is-shown { opacity: 1; transform: none; }
|
|
1236
|
+
.cx-toasts .cx-toast.is-leaving { transition-timing-function: var(--cx-motion-easing-exit); }
|
|
1237
|
+
|
|
1238
|
+
/* ------------------------------------------------------------ field (field.md) */
|
|
1239
|
+
/* A text field, select or text area with its label on the top border. The label rests where the text goes and moves
|
|
1240
|
+
up to the border when the field has focus or a value: the control's placeholder is " " (or an example), so
|
|
1241
|
+
:placeholder-shown means empty. The label's lower half is the field's own surface, hiding the border behind it,
|
|
1242
|
+
and its upper half is clear, so it sits on whatever the field is on. */
|
|
1243
|
+
.cx-field { display: flex; flex-direction: column; gap: var(--cx-space-stack-xs); width: 100%; min-width: 0; } /* fills its container, in a flex row too */
|
|
1244
|
+
.cx-field__box { position: relative; display: flex; margin-block-start: var(--cx-space-inset-xs); --_field: var(--cx-color-surface-raised); }
|
|
1245
|
+
.cx-field__control {
|
|
1246
|
+
flex: 1; min-width: 0; width: 100%; margin: 0; min-height: calc(var(--cx-size-target-control) + var(--cx-space-inset-xs) * 2);
|
|
1247
|
+
padding: var(--cx-space-inset-xs) var(--cx-space-inset-sm); border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); border-radius: var(--cx-radius-control);
|
|
1248
|
+
background: var(--_field); color: var(--cx-color-text-primary); font: inherit; font-size: var(--cx-font-size-body); line-height: var(--cx-font-line-height-ui);
|
|
1249
|
+
}
|
|
1250
|
+
.cx-field__control--mono { font-family: var(--cx-font-family-mono); font-size: var(--cx-font-size-small); }
|
|
1251
|
+
.cx-field__control--short { flex: none; max-width: var(--cx-size-column-sidebar); }
|
|
1252
|
+
textarea.cx-field__control { min-height: calc(var(--cx-size-target-control) * 2.5); resize: vertical; }
|
|
1253
|
+
select.cx-field__control { appearance: none; padding-inline-end: calc(var(--cx-space-inset-sm) * 2 + var(--cx-size-icon-md)); cursor: pointer; }
|
|
1254
|
+
.cx-field__box > .cx-icon { position: absolute; inset-inline-end: var(--cx-space-inset-sm); top: 50%; translate: 0 -50%; color: var(--cx-color-text-secondary); pointer-events: none; }
|
|
1255
|
+
.cx-field__control::placeholder { color: transparent; }
|
|
1256
|
+
.cx-field__control:focus::placeholder { color: var(--cx-color-text-muted); }
|
|
1257
|
+
.cx-field__control:hover:not(:disabled, :focus-visible) { border-color: var(--cx-color-text-secondary); }
|
|
1258
|
+
/* focus: the field's own border turns accent and doubles, with no ring outside it; the inner line changes from the
|
|
1259
|
+
field's surface to accent, so the change shows without colour vision too */
|
|
1260
|
+
.cx-field__control:focus-visible { outline: none; border-color: var(--cx-color-accent-border); box-shadow: inset 0 0 0 var(--cx-border-width-hairline) var(--cx-color-accent-border); }
|
|
1261
|
+
.cx-field__control[aria-invalid="true"]:not(:focus-visible) { border-color: var(--cx-color-status-danger-border); box-shadow: inset 0 0 0 var(--cx-border-width-hairline) var(--cx-color-status-danger-border); }
|
|
1262
|
+
.cx-field__control:disabled { --_field: var(--cx-color-surface-sunken); color: var(--cx-color-text-muted); border-style: dashed; cursor: not-allowed; }
|
|
1263
|
+
.cx-field__box:has(.cx-field__control:disabled) { --_field: var(--cx-color-surface-sunken); }
|
|
1264
|
+
.cx-field__label {
|
|
1265
|
+
position: absolute; inset-inline-start: calc(var(--cx-space-inset-sm) + var(--cx-border-width-hairline)); top: 50%; translate: 0 -50%;
|
|
1266
|
+
max-width: calc(100% - var(--cx-space-inset-sm) * 2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; pointer-events: none;
|
|
1267
|
+
color: var(--cx-color-text-secondary); font-size: var(--cx-font-size-body); line-height: var(--cx-font-line-height-ui);
|
|
1268
|
+
transition-property: top, translate, font-size, color, padding, margin; transition-duration: var(--cx-motion-duration-base); transition-timing-function: var(--cx-motion-easing-standard);
|
|
1269
|
+
}
|
|
1270
|
+
.cx-field__box--area > .cx-field__label { top: var(--cx-space-inset-sm); translate: 0 0; }
|
|
1271
|
+
.cx-field__control:is(:focus, :not(:placeholder-shown), :autofill, :disabled) + .cx-field__label, select.cx-field__control + .cx-field__label {
|
|
1272
|
+
top: 0; translate: 0 -50%; font-size: var(--cx-font-size-label); padding-inline: var(--cx-space-inset-xs); margin-inline-start: calc(var(--cx-space-inset-xs) * -1);
|
|
1273
|
+
background: linear-gradient(to bottom, transparent 50%, var(--_field) 50%);
|
|
1274
|
+
}
|
|
1275
|
+
.cx-field__control:focus + .cx-field__label { color: var(--cx-color-text-accent); font-weight: var(--cx-font-weight-strong); }
|
|
1276
|
+
.cx-field__control[aria-invalid="true"] + .cx-field__label { color: var(--cx-color-status-danger-text); }
|
|
1277
|
+
.cx-field__optional { color: var(--cx-color-text-muted); }
|
|
1278
|
+
.cx-field__hint { margin: 0; font-size: var(--cx-font-size-small); color: var(--cx-color-text-secondary); line-height: var(--cx-font-line-height-ui); }
|
|
1279
|
+
.cx-field__error { margin: 0; display: flex; align-items: center; gap: var(--cx-space-inline-xs); font-size: var(--cx-font-size-small); font-weight: var(--cx-font-weight-strong); color: var(--cx-color-status-danger-text); line-height: var(--cx-font-line-height-ui); }
|
|
1280
|
+
.cx-field__error[hidden] { display: none; }
|
|
1281
|
+
.cx-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--cx-space-stack-md); }
|
|
1282
|
+
.cx-fieldset > legend { padding: 0; margin-block-end: var(--cx-space-stack-sm); font-size: var(--cx-font-size-body); font-weight: var(--cx-font-weight-strong); line-height: var(--cx-font-line-height-ui); }
|
|
1283
|
+
@media (prefers-reduced-motion: reduce) { .cx-field__label { transition: none; } }
|
|
1284
|
+
|
|
1285
|
+
/* ------------------------------------------------------------ choice (choice.md) */
|
|
1286
|
+
/* A checkbox, radio button or switch with its label beside it: native inputs, in the accent colour */
|
|
1287
|
+
.cx-choices { display: flex; flex-direction: column; gap: var(--cx-space-stack-sm); }
|
|
1288
|
+
.cx-choice { display: flex; align-items: flex-start; gap: var(--cx-space-inline-sm); min-height: var(--cx-size-target-min); font-size: var(--cx-font-size-small); line-height: var(--cx-font-line-height-ui); cursor: pointer; }
|
|
1289
|
+
.cx-choice:has(input:disabled) { color: var(--cx-color-text-muted); cursor: not-allowed; }
|
|
1290
|
+
.cx-choice__text { display: flex; flex-direction: column; gap: var(--cx-space-stack-xs); padding-block-start: var(--cx-border-width-emphasis); }
|
|
1291
|
+
.cx-choice input { flex: none; margin: 0; cursor: inherit; }
|
|
1292
|
+
.cx-choice input:is([type="checkbox"]:not([role="switch"]), [type="radio"]) { width: var(--cx-size-icon-md); height: var(--cx-size-icon-md); accent-color: var(--cx-color-accent-fill-rest); }
|
|
1293
|
+
.cx-choice input[role="switch"] {
|
|
1294
|
+
appearance: none; width: var(--cx-size-target-touch); height: var(--cx-size-target-min); border-radius: var(--cx-radius-pill);
|
|
1295
|
+
border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); background-color: var(--cx-color-surface-sunken);
|
|
1296
|
+
background-image: radial-gradient(circle closest-side, var(--cx-color-text-secondary) 70%, transparent 74%);
|
|
1297
|
+
background-size: var(--cx-size-target-min) 100%; background-repeat: no-repeat; background-position: left center;
|
|
1298
|
+
transition: background-position var(--cx-motion-duration-fast) var(--cx-motion-easing-standard);
|
|
1299
|
+
}
|
|
1300
|
+
.cx-choice input[role="switch"]:checked { border-color: var(--cx-color-accent-fill-rest); background-color: var(--cx-color-accent-fill-rest); background-image: radial-gradient(circle closest-side, var(--cx-color-text-on-accent) 70%, transparent 74%); background-position: right center; }
|
|
1301
|
+
.cx-choice input[role="switch"]:disabled { border-style: dashed; }
|
|
1302
|
+
.cx-choice input:focus-visible { outline: var(--cx-border-focus-width) solid var(--cx-color-focus-ring); outline-offset: var(--cx-border-focus-offset); }
|
|
1303
|
+
|
|
1304
|
+
/* ------------------------------------------------------------ date picker (date-picker.md) */
|
|
1305
|
+
/* A date field with a button that opens a calendar: codex.js shows the button and builds one calendar for the page.
|
|
1306
|
+
The calendar is a fixed size (seven touch-size days), so neither arrow nor either button moves as months change. */
|
|
1307
|
+
.cx-field__box--date > .cx-field__control { border-inline-end: 0; }
|
|
1308
|
+
.cx-date__button {
|
|
1309
|
+
flex: none; display: grid; place-items: center; width: calc(var(--cx-size-target-control) + var(--cx-space-inset-xs) * 2); padding: 0;
|
|
1310
|
+
border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); background: var(--_field); color: var(--cx-color-text-secondary); cursor: pointer;
|
|
1311
|
+
}
|
|
1312
|
+
.cx-date__button[hidden] { display: none; }
|
|
1313
|
+
.cx-field__box--date:has(.cx-date__button[hidden]) > .cx-field__control { border-inline-end: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); }
|
|
1314
|
+
.cx-date__button:hover { background: var(--cx-color-surface-hover); color: var(--cx-color-text-primary); }
|
|
1315
|
+
.cx-date__button:focus-visible { outline: none; border-color: var(--cx-color-accent-border); box-shadow: inset 0 0 0 var(--cx-border-width-hairline) var(--cx-color-accent-border); color: var(--cx-color-text-primary); }
|
|
1316
|
+
.cx-calendar {
|
|
1317
|
+
position: absolute; inset: auto; box-sizing: content-box; width: calc(var(--cx-size-target-touch) * 7); margin: 0; padding: var(--cx-space-inset-sm);
|
|
1318
|
+
border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); background: var(--cx-color-surface-raised); color: var(--cx-color-text-primary);
|
|
1319
|
+
}
|
|
1320
|
+
.cx-calendar__head { display: grid; grid-template-columns: var(--cx-size-target-control) minmax(0, 1fr) var(--cx-size-target-control); align-items: center; padding-block-end: var(--cx-space-inset-xs); }
|
|
1321
|
+
.cx-calendar__pickers { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--cx-space-inline-xs); }
|
|
1322
|
+
.cx-calendar__nav, .cx-calendar__pick, .cx-calendar__day, .cx-calendar__cell, .cx-calendar__foot button {
|
|
1323
|
+
margin: 0; padding: 0; border: 0; border-radius: var(--cx-radius-pill); background: transparent; color: var(--cx-color-text-primary); font: inherit; cursor: pointer;
|
|
1324
|
+
}
|
|
1325
|
+
.cx-calendar__nav { display: grid; place-items: center; width: var(--cx-size-target-control); height: var(--cx-size-target-control); color: var(--cx-color-text-secondary); }
|
|
1326
|
+
.cx-calendar__pick { display: inline-flex; align-items: center; justify-content: center; gap: var(--cx-space-inline-xs); width: 100%; min-height: var(--cx-size-target-control); white-space: nowrap; font-weight: var(--cx-font-weight-strong); font-variant-numeric: tabular-nums; }
|
|
1327
|
+
.cx-calendar__pick .cx-icon { color: var(--cx-color-text-secondary); transition: transform var(--cx-motion-duration-fast) var(--cx-motion-easing-standard); }
|
|
1328
|
+
.cx-calendar__pick[aria-expanded="true"] { background: var(--cx-color-surface-selected); }
|
|
1329
|
+
.cx-calendar__pick[aria-expanded="true"] .cx-icon { transform: rotate(180deg); }
|
|
1330
|
+
.cx-calendar__grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
|
|
1331
|
+
.cx-calendar__grid th { padding-block: var(--cx-space-inset-xs); font-family: var(--cx-font-family-mono); font-size: var(--cx-font-size-label); font-weight: var(--cx-font-weight-ui); letter-spacing: var(--cx-font-tracking-label); text-transform: uppercase; color: var(--cx-color-text-muted); }
|
|
1332
|
+
.cx-calendar__grid td { padding: 0; }
|
|
1333
|
+
.cx-calendar__day { display: grid; place-items: center; width: var(--cx-size-target-touch); height: var(--cx-size-target-touch); font-size: var(--cx-font-size-small); font-variant-numeric: tabular-nums; }
|
|
1334
|
+
.cx-calendar__day.is-other { color: var(--cx-color-text-muted); }
|
|
1335
|
+
.cx-calendar__list { display: grid; gap: var(--cx-space-inset-xs); align-content: center; min-height: calc(var(--cx-size-target-touch) * 6 + var(--cx-font-size-label) * 1.6 + var(--cx-space-inset-xs) * 2); }
|
|
1336
|
+
.cx-calendar__list[hidden], .cx-calendar__grid[hidden] { display: none; }
|
|
1337
|
+
.cx-calendar__list--months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
1338
|
+
.cx-calendar__list--years { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
1339
|
+
.cx-calendar__cell { min-height: var(--cx-size-target-control); font-size: var(--cx-font-size-small); font-variant-numeric: tabular-nums; }
|
|
1340
|
+
.cx-calendar__nav:hover, .cx-calendar__pick:hover, .cx-calendar__day:hover, .cx-calendar__cell:hover { background: var(--cx-color-surface-hover); color: var(--cx-color-text-primary); }
|
|
1341
|
+
.cx-calendar :is(.cx-calendar__day, .cx-calendar__cell)[aria-current="date"] { box-shadow: inset 0 0 0 var(--cx-border-width-hairline) var(--cx-color-border-strong); font-weight: var(--cx-font-weight-strong); }
|
|
1342
|
+
.cx-calendar :is(.cx-calendar__day, .cx-calendar__cell)[aria-pressed="true"] { background: var(--cx-color-surface-selected); font-weight: var(--cx-font-weight-strong); }
|
|
1343
|
+
.cx-calendar__foot { display: flex; justify-content: space-between; gap: var(--cx-space-inline-sm); margin-block-start: var(--cx-space-inset-xs); padding-block-start: var(--cx-space-inset-xs); border-block-start: var(--cx-border-width-hairline) solid var(--cx-color-border-subtle); }
|
|
1344
|
+
.cx-calendar__foot button { min-height: var(--cx-size-target-control); padding-inline: var(--cx-space-inset-sm); border-radius: 0; color: var(--cx-color-text-accent); font-size: var(--cx-font-size-small); font-weight: var(--cx-font-weight-strong); }
|
|
1345
|
+
.cx-calendar__foot button:hover { text-decoration: underline; }
|
|
1346
|
+
.cx-calendar button:focus-visible { outline: var(--cx-border-focus-width) solid var(--cx-color-focus-ring); outline-offset: calc(var(--cx-border-focus-width) * -1); }
|
|
1347
|
+
@media (prefers-reduced-motion: reduce) { .cx-calendar__pick .cx-icon { transition: none; } }
|
|
1348
|
+
|
|
1349
|
+
/* ------------------------------------------------------------ dialog (dialog.md) */
|
|
1350
|
+
/* A native <dialog> opened with showModal(): a head with the title and a close button, the body, and the actions in a
|
|
1351
|
+
recessed band. It fades and rises in; on a phone it docks to the bottom, and a wide one (a form) fills the screen. */
|
|
1352
|
+
.cx-dialog {
|
|
1353
|
+
width: min(100% - 2 * var(--cx-space-gutter-page), var(--cx-size-measure-caption));
|
|
1354
|
+
padding: 0; border: var(--cx-border-width-hairline) solid var(--cx-color-border-strong); background: var(--cx-color-surface-raised); color: var(--cx-color-text-primary);
|
|
1355
|
+
flex-direction: column;
|
|
1356
|
+
}
|
|
1357
|
+
.cx-dialog:modal { max-height: calc(100% - 2 * var(--cx-space-gutter-page)); overflow: hidden; } /* the window's height, only when open */
|
|
1358
|
+
.cx-dialog--wide { width: min(100% - 2 * var(--cx-space-gutter-page), 1.6 * var(--cx-size-column-card)); }
|
|
1359
|
+
.cx-dialog[open] { display: flex; }
|
|
1360
|
+
.cx-dialog > form { display: contents; }
|
|
1361
|
+
.cx-dialog::backdrop { background: color-mix(in srgb, var(--cx-color-scrim) var(--cx-color-wash-scrim), transparent); }
|
|
1362
|
+
.cx-dialog__head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--cx-space-inline-sm); padding: var(--cx-space-inset-md) var(--cx-space-inset-lg); border-block-end: var(--cx-border-width-hairline) solid var(--cx-color-border-subtle); }
|
|
1363
|
+
/* two classes, so an article's heading styles (.cx-prose h2) don't reach into a dialog placed in one */
|
|
1364
|
+
.cx-dialog .cx-dialog__title { margin: 0; padding: 0; border: 0; font-size: var(--cx-font-size-heading-4); font-weight: var(--cx-font-weight-heading); line-height: var(--cx-font-line-height-heading); letter-spacing: normal; text-wrap: balance; }
|
|
1365
|
+
.cx-dialog .cx-dialog__head > * { margin-block: 0; }
|
|
1366
|
+
.cx-dialog__close {
|
|
1367
|
+
flex: none; display: grid; place-items: center; width: var(--cx-size-target-control); height: var(--cx-size-target-control); margin-inline-end: calc(var(--cx-space-inset-sm) * -1);
|
|
1368
|
+
padding: 0; border: 0; border-radius: var(--cx-radius-pill); background: transparent; color: var(--cx-color-text-secondary); cursor: pointer;
|
|
1369
|
+
}
|
|
1370
|
+
.cx-dialog__close:hover { background: var(--cx-color-surface-hover); color: var(--cx-color-text-primary); }
|
|
1371
|
+
.cx-dialog__close:focus-visible { outline: var(--cx-border-focus-width) solid var(--cx-color-focus-ring); outline-offset: calc(var(--cx-border-focus-width) * -1); }
|
|
1372
|
+
.cx-dialog__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--cx-space-stack-md); padding: var(--cx-space-inset-lg); }
|
|
1373
|
+
.cx-dialog .cx-dialog__body > p { margin: 0; color: var(--cx-color-text-secondary); max-width: var(--cx-size-measure-prose); }
|
|
1374
|
+
.cx-dialog__actions { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--cx-space-inline-sm); padding: var(--cx-space-inset-md) var(--cx-space-inset-lg); border-block-start: var(--cx-border-width-hairline) solid var(--cx-color-border-subtle); background: var(--cx-color-surface-sunken); }
|
|
1375
|
+
.cx-dialog, .cx-dialog::backdrop {
|
|
1376
|
+
transition: opacity var(--cx-motion-duration-base) var(--cx-motion-easing-enter), translate var(--cx-motion-duration-base) var(--cx-motion-easing-enter),
|
|
1377
|
+
overlay var(--cx-motion-duration-base) allow-discrete, display var(--cx-motion-duration-base) allow-discrete;
|
|
1378
|
+
}
|
|
1379
|
+
dialog.cx-dialog:not([open]), dialog.cx-dialog:not([open])::backdrop { opacity: 0; transition-timing-function: var(--cx-motion-easing-exit); }
|
|
1380
|
+
dialog.cx-dialog:not([open]) { translate: 0 calc(6 * var(--cx-motion-distance-nudge)); }
|
|
1381
|
+
@starting-style {
|
|
1382
|
+
.cx-dialog[open], .cx-dialog[open]::backdrop { opacity: 0; }
|
|
1383
|
+
.cx-dialog[open] { translate: 0 calc(6 * var(--cx-motion-distance-nudge)); }
|
|
1384
|
+
}
|
|
1385
|
+
@media (prefers-reduced-motion: reduce) { .cx-dialog, .cx-dialog::backdrop { transition: none; } }
|
|
1386
|
+
html:has(.cx-dialog[open]) { overflow: hidden; }
|
|
1387
|
+
@media (width < 48rem) {
|
|
1388
|
+
.cx-dialog:not(.cx-dialog--wide) { width: 100%; max-width: none; margin: auto 0 0; border-width: var(--cx-border-width-hairline) 0 0; }
|
|
1389
|
+
.cx-dialog:not(.cx-dialog--wide) .cx-dialog__actions { flex-direction: column-reverse; }
|
|
1390
|
+
.cx-dialog:not(.cx-dialog--wide) .cx-dialog__actions .cx-button { width: 100%; justify-content: center; }
|
|
1391
|
+
.cx-dialog--wide { width: 100%; max-width: none; margin: 0; border-width: 0; }
|
|
1392
|
+
.cx-dialog--wide:modal { height: 100%; max-height: none; }
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1167
1395
|
/* ------------------------------------------------------------ data table */
|
|
1168
1396
|
.cx-table { position: relative; min-width: 0; overflow-x: auto; border: var(--cx-border-width-hairline) solid var(--cx-color-border-default); background: var(--cx-color-surface-raised); }
|
|
1169
1397
|
.cx-table table { width: 100%; border-collapse: collapse; font-size: var(--cx-font-size-small); line-height: var(--cx-font-line-height-ui); }
|