@metacensus/library-ui 0.17.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/site/links.js +7 -5
- package/dist/site/links.js.map +1 -1
- package/dist/tools/Dialog.d.ts +21 -0
- package/dist/tools/Dialog.js +52 -0
- package/dist/tools/Dialog.js.map +1 -0
- package/package.json +1 -1
- package/src/chrome/Footer.astro +5 -2
- package/src/css/styles.css +49 -2
- package/src/css/tokens.css +1 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ Components render on the server: no router, auth or API client, and no browser g
|
|
|
34
34
|
|
|
35
35
|
- Marks: `MetaCensusMark`, `MetaCensusLockup`, `MetaCensusWordmark` (the lockup's letters alone, in `WORDMARK_VIEWBOX`), `MetaCensusArrow`, `LogoArrowMorph`, and the shared geometry, including the lockup's spacing (`LOCKUP_VIEWBOX`, and `LOCKUP_MARK_BOX` for the mark's box within it).
|
|
36
36
|
- Chrome: `Header` (`nav` and `actions` slots, which wrap on a narrow screen; with no `nav`, the `actions` sit at the end of the row), `Footer` (`brand` replaces the linked lockup and its link is the consumer's; `tagline`; link columns as children), `Nav` (`links`).
|
|
37
|
-
- Tools: `cn`, `Button`, `Notice`, `Chip`, `CiteThisPage` with the formatters `formatRis`, `formatBibtex` and `formatCitationText`, the form kit (`Field`, `Label`, `Input`, `Textarea`, `Select`, `Checkbox`, `RadioGroup`, `FieldError`), `useTheme`, `useStill`, `DisplayControls`, `displayScript`.
|
|
37
|
+
- Tools: `cn`, `Button`, `Notice`, `Chip`, `Dialog`, `CiteThisPage` with the formatters `formatRis`, `formatBibtex` and `formatCitationText`, the form kit (`Field`, `Label`, `Input`, `Textarea`, `Select`, `Checkbox`, `RadioGroup`, `FieldError`), `useTheme`, `useStill`, `DisplayControls`, `displayScript`.
|
|
38
38
|
- People: `ContributorCard` (a person's photo, name, role, flavor chip and bio, whose bio floats open on hover or focus until Escape), `ContributorFlavorKey`, and `AudienceIcon` for each of `AUDIENCES`, labelled from `AUDIENCE_LABELS`. The floating card is portaled into `<body>`, so import `tokens.css` and set the theme on `:root`, not on a wrapper.
|
|
39
39
|
|
|
40
40
|
- Marks take `variant`: `auto` (the default: solid on every ground, over a Soft Lavender halo on dark that spills about one mark-height past its box, so its container must not clip it), `solid` or `reversed`. Mark usage is in [TRADEMARKS.md](TRADEMARKS.md).
|
|
@@ -42,6 +42,7 @@ Components render on the server: no router, auth or API client, and no browser g
|
|
|
42
42
|
- `Nav`'s mobile menu is a checkbox and CSS, so it works without JS.
|
|
43
43
|
- `Button` takes `variant`: `primary` (the default; one per view), `secondary`, `text`, `danger` or `inverse`. A solid Garnet fill marks only a risky action: one that destroys, discards, revokes or cannot be undone. A vote, a filter or a choice between options is not risky. `inverse` is a white fill for the call to action on a `--mc-fill-solid` or `--mc-night` ground, where `primary` is the ground's own colour or nearly so. Use it on those grounds only: it reads the same in light and dark, and `secondary` inside `.dark` is its quieter sibling.
|
|
44
44
|
- `Notice` takes `tone`: `alert` (the default, which reads the `--mc-alert-*` roles), `info` (the blue tint) or `success` (the purple tint fill with the accent ink, since the palette has no green). It renders `role="note"`; pass `role="alert"` for an error.
|
|
45
|
+
- `Dialog` is a native `<dialog>` opened with `showModal`: `open` is yours, `onClose` fires when Escape, the close control or a press on the backdrop closes it (not when `open` goes false), and focus returns to what opened it. Give it a `title`, its heading and name, or a `label`; `closeLabel` replaces "Close". Size it with `className`.
|
|
45
46
|
- `Button` and `Notice` follow the guidelines' illustrated Actions and Callout patterns. Those patterns do not bind yet: the guidelines have yet to state their shape.
|
|
46
47
|
- Display: inline `displayScript` in `<head>` so the stored choices are on `<html>` before first paint. `DisplayControls` is a round icon button fixed at the viewport's bottom-left corner; hover, focus or a tap opens a panel with the theme (`system`, the OS, `light` or `dark`) and a switch that stops animations. Render it once, from the layout; the panel may cover content on a phone. `useTheme` and `useStill` read and set the same choices. Stopped animations put `still` on `<html>`, whether the viewer chose it or the OS prefers reduced motion, so a page styles its own animations from `:root.still`, as the marks' halo does. With no stored choice the theme and `still` follow the system.
|
|
47
48
|
|
|
@@ -215,7 +216,7 @@ A step is `--mc-<family>-<step>`, as `--mc-purple-bold`. `--mc-white` and `--mc-
|
|
|
215
216
|
| `--mc-surface` | grey tint | grey bold, deeper |
|
|
216
217
|
| `--mc-hairline` | grey tint | grey bold, deepest |
|
|
217
218
|
| `--mc-ink` | grey bold | grey tint |
|
|
218
|
-
| `--mc-ink-secondary` | grey
|
|
219
|
+
| `--mc-ink-secondary` | grey bold | grey mid |
|
|
219
220
|
| `--mc-line-input` | grey mid | grey mid |
|
|
220
221
|
| `--mc-series` | blue bold | blue mid |
|
|
221
222
|
| `--mc-ink-accent` | purple bold | purple tint |
|
|
@@ -244,7 +245,7 @@ The default for a chip, pill, badge or callout: the family's tint as the fill, i
|
|
|
244
245
|
|
|
245
246
|
### Slate Mist
|
|
246
247
|
|
|
247
|
-
`--mc-grey-mid` is for text demoted in place: copy that stops being the subject and becomes context for what replaced it. Copy that is merely secondary starts in Charcoal, which is `--mc-ink`.
|
|
248
|
+
`--mc-grey-mid` is for text demoted in place: copy that stops being the subject and becomes context for what replaced it. Copy that is merely secondary starts in Charcoal, which is `--mc-ink`. `--mc-ink-secondary` is Charcoal in light, where Slate Mist is about 3.2:1 on white, and Slate Mist in dark, where it clears 4.5:1 on the night ground, so it holds small text in both. For an outline, use `--mc-line-input`.
|
|
248
249
|
|
|
249
250
|
### Shape (provisional)
|
|
250
251
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { Nav, type NavLink } from './chrome/Nav.js';
|
|
|
6
6
|
export { Button } from './tools/Button.js';
|
|
7
7
|
export { Chip } from './tools/Chip.js';
|
|
8
8
|
export { cn } from './tools/cn.js';
|
|
9
|
+
export { Dialog } from './tools/Dialog.js';
|
|
9
10
|
export { formatBibtex, formatCitationText, formatRis, type Citation, } from './tools/cite.js';
|
|
10
11
|
export { CiteThisPage } from './tools/CiteThisPage.js';
|
|
11
12
|
export { Checkbox, Field, FieldError, Input, Label, RadioGroup, Select, Textarea, } from './tools/form.js';
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { Nav } from './chrome/Nav.js';
|
|
|
6
6
|
export { Button } from './tools/Button.js';
|
|
7
7
|
export { Chip } from './tools/Chip.js';
|
|
8
8
|
export { cn } from './tools/cn.js';
|
|
9
|
+
export { Dialog } from './tools/Dialog.js';
|
|
9
10
|
export { formatBibtex, formatCitationText, formatRis, } from './tools/cite.js';
|
|
10
11
|
export { CiteThisPage } from './tools/CiteThisPage.js';
|
|
11
12
|
export { Checkbox, Field, FieldError, Input, Label, RadioGroup, Select, Textarea, } from './tools/form.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AACzB,cAAc,qBAAqB,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAgB,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAA;AAClC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,SAAS,GAEV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EACL,QAAQ,EACR,KAAK,EACL,UAAU,EACV,KAAK,EACL,K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Y,GAEb,MAAM,0BAA0B,CAAA;AACjC,OAAO,EACL,eAAe,EACf,oBAAoB,GAErB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EACL,eAAe,EACf,aAAa,EACb,QAAQ,EACR,QAAQ,GAET,MAAM,oBAAoB,CAAA"}
|
package/dist/site/links.js
CHANGED
|
@@ -16,7 +16,7 @@ export const SECTION_LINKS = [
|
|
|
16
16
|
];
|
|
17
17
|
export const FOOTER_COLUMNS = [
|
|
18
18
|
{
|
|
19
|
-
label: '
|
|
19
|
+
label: 'Explore',
|
|
20
20
|
links: [
|
|
21
21
|
...SECTION_LINKS,
|
|
22
22
|
BLOG_LINK,
|
|
@@ -24,7 +24,7 @@ export const FOOTER_COLUMNS = [
|
|
|
24
24
|
],
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
label: '
|
|
27
|
+
label: 'Get involved',
|
|
28
28
|
links: [
|
|
29
29
|
{ label: 'Join us', href: JOIN_PATH },
|
|
30
30
|
{
|
|
@@ -36,9 +36,11 @@ export const FOOTER_COLUMNS = [
|
|
|
36
36
|
],
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
label: '
|
|
40
|
-
links: [
|
|
39
|
+
label: 'About',
|
|
40
|
+
links: [
|
|
41
|
+
{ label: 'GitHub', href: 'https://github.com/metacensus' },
|
|
42
|
+
{ label: 'Legal', href: LEGAL_PATH },
|
|
43
|
+
],
|
|
41
44
|
},
|
|
42
|
-
{ label: 'About this site', links: [{ label: 'Legal', href: LEGAL_PATH }] },
|
|
43
45
|
];
|
|
44
46
|
//# sourceMappingURL=links.js.map
|
package/dist/site/links.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.js","sourceRoot":"","sources":["../../src/site/links.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAA;AACnC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAA;AAEpC,kEAAkE;AAClE,MAAM,C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Aa,EAAE,IAAI,EAAE,WAAW,EAAE;IAC3C,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE;IACrC,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE;IAC7C,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,EAAE;CAC5C,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAGrB;IACJ;QACE,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE;YACL,GAAG,aAAa;YAChB,SAAS;YACT,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,YAAY,EAAE;SAC/C;KACF;IACD;QACE,KAAK,EAAE,cAAc;QACrB,KAAK,EAAE;YACL,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC;gBACE,KAAK,EAAE,sBAAsB;gBAC7B,IAAI,EAAE,iCAAiC;aACxC;YACD,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE;YACvC,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE;SACtC;KACF;IACD;QACE,KAAK,EAAE,OAAO;QACd,KAAK,EAAE;YACL,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,+BAA+B,EAAE;YAC1D,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE;SACrC;KACF;CACF,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type DialogHTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
type Naming = {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
label?: undefined;
|
|
5
|
+
} | {
|
|
6
|
+
title?: undefined;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
type DialogProps = Naming & Omit<DialogHTMLAttributes<HTMLDialogElement>, 'open' | 'title' | 'onClose'> & {
|
|
10
|
+
open: boolean;
|
|
11
|
+
/** Called when the dialog closes by Escape, the close control or a press
|
|
12
|
+
* on the backdrop; not when `open` goes false. */
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
closeLabel?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
/** A modal on the native `<dialog>`: the browser gives the inert background,
|
|
17
|
+
* Escape and the top layer, and this returns focus to the opener. `open` is
|
|
18
|
+
* the parent's truth: set it false in `onClose`. A `title` is the visible heading and names the dialog;
|
|
19
|
+
* without one, `label` does. */
|
|
20
|
+
export declare function Dialog({ open, onClose, title, label, closeLabel, className, children, ...props }: DialogProps): import("react").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useRef, } from 'react';
|
|
3
|
+
import { Button } from './Button.js';
|
|
4
|
+
import { cn } from './cn.js';
|
|
5
|
+
/** A modal on the native `<dialog>`: the browser gives the inert background,
|
|
6
|
+
* Escape and the top layer, and this returns focus to the opener. `open` is
|
|
7
|
+
* the parent's truth: set it false in `onClose`. A `title` is the visible heading and names the dialog;
|
|
8
|
+
* without one, `label` does. */
|
|
9
|
+
export function Dialog({ open, onClose, title, label, closeLabel = 'Close', className, children, ...props }) {
|
|
10
|
+
const ref = useRef(null);
|
|
11
|
+
const opener = useRef(null);
|
|
12
|
+
const closing = useRef(false);
|
|
13
|
+
const pressedOutside = useRef(false);
|
|
14
|
+
const headingId = useId();
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const dialog = ref.current;
|
|
17
|
+
if (open && !dialog.open) {
|
|
18
|
+
opener.current = document.activeElement;
|
|
19
|
+
dialog.showModal();
|
|
20
|
+
}
|
|
21
|
+
else if (!open && dialog.open) {
|
|
22
|
+
// The close event this raises is the parent's own doing; `closed` skips it.
|
|
23
|
+
closing.current = true;
|
|
24
|
+
dialog.close();
|
|
25
|
+
}
|
|
26
|
+
}, [open]);
|
|
27
|
+
const closed = () => {
|
|
28
|
+
const back = opener.current;
|
|
29
|
+
opener.current = null;
|
|
30
|
+
if (back instanceof HTMLElement && back.isConnected)
|
|
31
|
+
back.focus({ preventScroll: true });
|
|
32
|
+
if (closing.current)
|
|
33
|
+
closing.current = false;
|
|
34
|
+
else
|
|
35
|
+
onClose();
|
|
36
|
+
};
|
|
37
|
+
// The backdrop is the dialog element itself, outside its box.
|
|
38
|
+
const outside = (event) => {
|
|
39
|
+
const box = event.currentTarget.getBoundingClientRect();
|
|
40
|
+
return (event.target === event.currentTarget &&
|
|
41
|
+
(event.clientX < box.left ||
|
|
42
|
+
event.clientX > box.right ||
|
|
43
|
+
event.clientY < box.top ||
|
|
44
|
+
event.clientY > box.bottom));
|
|
45
|
+
};
|
|
46
|
+
return (_jsxs("dialog", { ...props, ref: ref, className: cn('mc-dialog', className), "aria-labelledby": title !== undefined ? headingId : undefined, "aria-label": label, onClose: closed, onPointerDown: (e) => (pressedOutside.current = outside(e)), onClick: (e) => {
|
|
47
|
+
if (pressedOutside.current && outside(e))
|
|
48
|
+
ref.current.close();
|
|
49
|
+
pressedOutside.current = false;
|
|
50
|
+
}, children: [_jsxs("div", { className: "mc-dialog-header", children: [title !== undefined && (_jsx("h2", { id: headingId, className: "mc-dialog-title", children: title })), _jsx(Button, { variant: "secondary", onClick: () => ref.current.close(), children: closeLabel })] }), _jsx("div", { className: "mc-dialog-body", children: children })] }));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=Dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../src/tools/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,GAIP,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAiB5B;;;iCAGiC;AACjC,MAAM,UAAU,MAAM,CAA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EAAC,gBAAgB,YAAE,QAAQ,GAAO,IACzC,CACV,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
package/src/chrome/Footer.astro
CHANGED
|
@@ -13,8 +13,11 @@ import { FOOTER_COLUMNS } from '@metacensus/library-ui/site-links'
|
|
|
13
13
|
</div>
|
|
14
14
|
<div class="mc-footer-columns">
|
|
15
15
|
{
|
|
16
|
-
FOOTER_COLUMNS.map((column) => (
|
|
17
|
-
<nav class="mc-footer-column" aria-
|
|
16
|
+
FOOTER_COLUMNS.map((column, i) => (
|
|
17
|
+
<nav class="mc-footer-column" aria-labelledby={`mc-footer-column-${i}`}>
|
|
18
|
+
<h2 class="mc-footer-heading" id={`mc-footer-column-${i}`}>
|
|
19
|
+
{column.label}
|
|
20
|
+
</h2>
|
|
18
21
|
{column.links.map((link) => (
|
|
19
22
|
<a href={link.href}>{link.label}</a>
|
|
20
23
|
))}
|
package/src/css/styles.css
CHANGED
|
@@ -227,16 +227,25 @@
|
|
|
227
227
|
.mc-footer-tagline {
|
|
228
228
|
margin: 0.75rem 0 0;
|
|
229
229
|
}
|
|
230
|
+
/* The columns share the row beside the brand in equal tracks, and wrap to as many as fit under it. */
|
|
230
231
|
.mc-footer-columns {
|
|
231
|
-
display:
|
|
232
|
-
flex
|
|
232
|
+
display: grid;
|
|
233
|
+
flex: 1 1 24rem;
|
|
234
|
+
min-width: 0;
|
|
235
|
+
grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
|
|
233
236
|
gap: 2rem;
|
|
237
|
+
max-width: 40rem;
|
|
234
238
|
}
|
|
235
239
|
.mc-footer-column {
|
|
236
240
|
display: flex;
|
|
237
241
|
flex-direction: column;
|
|
238
242
|
gap: 0.75rem;
|
|
239
243
|
}
|
|
244
|
+
.mc-footer-heading {
|
|
245
|
+
margin: 0;
|
|
246
|
+
font-size: 1rem;
|
|
247
|
+
font-weight: 600;
|
|
248
|
+
}
|
|
240
249
|
.mc-footer a {
|
|
241
250
|
color: var(--mc-ink);
|
|
242
251
|
}
|
|
@@ -333,6 +342,44 @@
|
|
|
333
342
|
font-weight: 700;
|
|
334
343
|
}
|
|
335
344
|
|
|
345
|
+
/* Dialog: the native modal; the UA centres it. */
|
|
346
|
+
.mc-dialog {
|
|
347
|
+
display: flex;
|
|
348
|
+
flex-direction: column;
|
|
349
|
+
gap: 1rem;
|
|
350
|
+
box-sizing: border-box;
|
|
351
|
+
max-width: calc(100vw - 2rem);
|
|
352
|
+
max-height: calc(100dvh - 2rem);
|
|
353
|
+
padding: 1rem;
|
|
354
|
+
border: 1px solid var(--mc-hairline);
|
|
355
|
+
border-radius: var(--mc-radius);
|
|
356
|
+
background: var(--mc-card);
|
|
357
|
+
color: var(--mc-ink);
|
|
358
|
+
box-shadow: var(--mc-shadow);
|
|
359
|
+
}
|
|
360
|
+
/* A layered `display` beats the UA's hiding of a closed dialog. */
|
|
361
|
+
.mc-dialog:not([open]) {
|
|
362
|
+
display: none;
|
|
363
|
+
}
|
|
364
|
+
.mc-dialog::backdrop {
|
|
365
|
+
background: color-mix(in srgb, var(--mc-night) 60%, transparent);
|
|
366
|
+
}
|
|
367
|
+
.mc-dialog-header {
|
|
368
|
+
display: flex;
|
|
369
|
+
flex-wrap: wrap;
|
|
370
|
+
align-items: center;
|
|
371
|
+
justify-content: space-between;
|
|
372
|
+
gap: 0.75rem;
|
|
373
|
+
}
|
|
374
|
+
.mc-dialog-title {
|
|
375
|
+
margin: 0;
|
|
376
|
+
font-size: 1.25rem;
|
|
377
|
+
}
|
|
378
|
+
.mc-dialog-body {
|
|
379
|
+
min-height: 0;
|
|
380
|
+
overflow: auto;
|
|
381
|
+
}
|
|
382
|
+
|
|
336
383
|
/* Chip: the tint fill, with ink and border from the bold step. */
|
|
337
384
|
.mc-chip {
|
|
338
385
|
display: inline-block;
|
package/src/css/tokens.css
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
color-mix(in srgb, var(--mc-grey-bold) 55%, var(--mc-ground))
|
|
41
41
|
);
|
|
42
42
|
--mc-ink: light-dark(var(--mc-grey-bold), var(--mc-grey-tint));
|
|
43
|
-
--mc-ink-secondary: var(--mc-grey-mid);
|
|
43
|
+
--mc-ink-secondary: light-dark(var(--mc-grey-bold), var(--mc-grey-mid));
|
|
44
44
|
--mc-line-input: var(--mc-grey-mid);
|
|
45
45
|
--mc-series: light-dark(var(--mc-blue-bold), var(--mc-blue-mid));
|
|
46
46
|
--mc-ink-accent: light-dark(var(--mc-purple-bold), var(--mc-purple-tint));
|