@misoto22/design 0.3.1 → 0.6.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 +124 -0
- package/bin/misoto22-design.mjs +205 -0
- package/dist/agent/Accordion.md +41 -0
- package/dist/agent/Alert.md +42 -0
- package/dist/agent/AppShell.md +40 -0
- package/dist/agent/AreaChart.md +68 -0
- package/dist/agent/Article.md +41 -0
- package/dist/agent/Avatar.md +32 -0
- package/dist/agent/Badge.md +40 -0
- package/dist/agent/BarChart.md +65 -0
- package/dist/agent/BarList.md +40 -0
- package/dist/agent/BigNumber.md +45 -0
- package/dist/agent/BoxPlot.md +58 -0
- package/dist/agent/Breadcrumb.md +32 -0
- package/dist/agent/BulletChart.md +48 -0
- package/dist/agent/Button.md +56 -0
- package/dist/agent/Calendar.md +42 -0
- package/dist/agent/Card.md +49 -0
- package/dist/agent/Checkbox.md +35 -0
- package/dist/agent/Collapsible.md +46 -0
- package/dist/agent/Combobox.md +50 -0
- package/dist/agent/Command.md +93 -0
- package/dist/agent/ComposedChart.md +57 -0
- package/dist/agent/ContextMenu.md +59 -0
- package/dist/agent/DatePicker.md +75 -0
- package/dist/agent/Diagram.md +46 -0
- package/dist/agent/Dialog.md +52 -0
- package/dist/agent/DropdownMenu.md +70 -0
- package/dist/agent/EmptyState.md +37 -0
- package/dist/agent/ErrorState.md +41 -0
- package/dist/agent/Facet.md +82 -0
- package/dist/agent/Field.md +37 -0
- package/dist/agent/FigureBand.md +37 -0
- package/dist/agent/FloatingIconButton.md +38 -0
- package/dist/agent/FunnelChart.md +52 -0
- package/dist/agent/Heatmap.md +53 -0
- package/dist/agent/Histogram.md +63 -0
- package/dist/agent/Input.md +30 -0
- package/dist/agent/Kbd.md +29 -0
- package/dist/agent/LineChart.md +60 -0
- package/dist/agent/LinkArrow.md +29 -0
- package/dist/agent/NativeSelect.md +40 -0
- package/dist/agent/NavItem.md +35 -0
- package/dist/agent/Pagination.md +43 -0
- package/dist/agent/PieChart.md +55 -0
- package/dist/agent/Popover.md +57 -0
- package/dist/agent/Progress.md +33 -0
- package/dist/agent/RadarChart.md +54 -0
- package/dist/agent/RadialChart.md +57 -0
- package/dist/agent/RadioGroup.md +44 -0
- package/dist/agent/SankeyChart.md +61 -0
- package/dist/agent/ScatterChart.md +54 -0
- package/dist/agent/ScrollArea.md +40 -0
- package/dist/agent/SearchableMenu.md +46 -0
- package/dist/agent/Select.md +75 -0
- package/dist/agent/Separator.md +35 -0
- package/dist/agent/Sheet.md +57 -0
- package/dist/agent/Skeleton.md +73 -0
- package/dist/agent/Slider.md +39 -0
- package/dist/agent/Sparkline.md +45 -0
- package/dist/agent/Spinner.md +39 -0
- package/dist/agent/StatusDot.md +36 -0
- package/dist/agent/StatusPill.md +28 -0
- package/dist/agent/Steps.md +44 -0
- package/dist/agent/Switch.md +29 -0
- package/dist/agent/Table.md +85 -0
- package/dist/agent/Tabs.md +48 -0
- package/dist/agent/Tag.md +35 -0
- package/dist/agent/Textarea.md +26 -0
- package/dist/agent/Toast.md +26 -0
- package/dist/agent/ToggleGroup.md +44 -0
- package/dist/agent/Tooltip.md +51 -0
- package/dist/agent/TreemapChart.md +52 -0
- package/dist/agent/WaterfallChart.md +62 -0
- package/dist/agent/catalog.json +1791 -0
- package/dist/agent/index.md +131 -0
- package/dist/article.css +393 -0
- package/dist/charts/AreaChart/AreaChart.d.ts +191 -0
- package/dist/charts/AreaChart/AreaChart.js +480 -0
- package/dist/charts/AreaChart/AreaChart.js.map +1 -0
- package/dist/charts/BarChart/BarChart.d.ts +179 -0
- package/dist/charts/BarChart/BarChart.js +591 -0
- package/dist/charts/BarChart/BarChart.js.map +1 -0
- package/dist/charts/BarList/BarList.d.ts +57 -0
- package/dist/charts/BarList/BarList.js +71 -0
- package/dist/charts/BarList/BarList.js.map +1 -0
- package/dist/charts/BigNumber/BigNumber.d.ts +56 -0
- package/dist/charts/BigNumber/BigNumber.js +31 -0
- package/dist/charts/BigNumber/BigNumber.js.map +1 -0
- package/dist/charts/BoxPlot/BoxPlot.d.ts +177 -0
- package/dist/charts/BoxPlot/BoxPlot.js +495 -0
- package/dist/charts/BoxPlot/BoxPlot.js.map +1 -0
- package/dist/charts/BulletChart/BulletChart.d.ts +100 -0
- package/dist/charts/BulletChart/BulletChart.js +162 -0
- package/dist/charts/BulletChart/BulletChart.js.map +1 -0
- package/dist/charts/ComposedChart/ComposedChart.d.ts +171 -0
- package/dist/charts/ComposedChart/ComposedChart.js +667 -0
- package/dist/charts/ComposedChart/ComposedChart.js.map +1 -0
- package/dist/charts/Facet/Facet.d.ts +240 -0
- package/dist/charts/Facet/Facet.js +133 -0
- package/dist/charts/Facet/Facet.js.map +1 -0
- package/dist/charts/Facet/panels.d.ts +187 -0
- package/dist/charts/Facet/panels.js +203 -0
- package/dist/charts/Facet/panels.js.map +1 -0
- package/dist/charts/FunnelChart/FunnelChart.d.ts +101 -0
- package/dist/charts/FunnelChart/FunnelChart.js +147 -0
- package/dist/charts/FunnelChart/FunnelChart.js.map +1 -0
- package/dist/charts/Heatmap/Heatmap.d.ts +78 -0
- package/dist/charts/Heatmap/Heatmap.js +108 -0
- package/dist/charts/Heatmap/Heatmap.js.map +1 -0
- package/dist/charts/Histogram/Histogram.d.ts +165 -0
- package/dist/charts/Histogram/Histogram.js +350 -0
- package/dist/charts/Histogram/Histogram.js.map +1 -0
- package/dist/charts/LineChart/LineChart.d.ts +167 -0
- package/dist/charts/LineChart/LineChart.js +486 -0
- package/dist/charts/LineChart/LineChart.js.map +1 -0
- package/dist/charts/PieChart/PieChart.d.ts +128 -0
- package/dist/charts/PieChart/PieChart.js +309 -0
- package/dist/charts/PieChart/PieChart.js.map +1 -0
- package/dist/charts/RadarChart/RadarChart.d.ts +123 -0
- package/dist/charts/RadarChart/RadarChart.js +299 -0
- package/dist/charts/RadarChart/RadarChart.js.map +1 -0
- package/dist/charts/RadialChart/RadialChart.d.ts +124 -0
- package/dist/charts/RadialChart/RadialChart.js +257 -0
- package/dist/charts/RadialChart/RadialChart.js.map +1 -0
- package/dist/charts/SankeyChart/SankeyChart.d.ts +137 -0
- package/dist/charts/SankeyChart/SankeyChart.js +501 -0
- package/dist/charts/SankeyChart/SankeyChart.js.map +1 -0
- package/dist/charts/ScatterChart/ScatterChart.d.ts +128 -0
- package/dist/charts/ScatterChart/ScatterChart.js +269 -0
- package/dist/charts/ScatterChart/ScatterChart.js.map +1 -0
- package/dist/charts/Sparkline/Sparkline.d.ts +53 -0
- package/dist/charts/Sparkline/Sparkline.js +93 -0
- package/dist/charts/Sparkline/Sparkline.js.map +1 -0
- package/dist/charts/TreemapChart/TreemapChart.d.ts +93 -0
- package/dist/charts/TreemapChart/TreemapChart.js +118 -0
- package/dist/charts/TreemapChart/TreemapChart.js.map +1 -0
- package/dist/charts/WaterfallChart/WaterfallChart.d.ts +164 -0
- package/dist/charts/WaterfallChart/WaterfallChart.js +319 -0
- package/dist/charts/WaterfallChart/WaterfallChart.js.map +1 -0
- package/dist/charts/index.d.ts +41 -0
- package/dist/charts/index.js +128 -0
- package/dist/charts/index.js.map +1 -0
- package/dist/charts/lib/annotations.d.ts +103 -0
- package/dist/charts/lib/annotations.js +99 -0
- package/dist/charts/lib/annotations.js.map +1 -0
- package/dist/charts/lib/axis.d.ts +18 -0
- package/dist/charts/lib/axis.js +21 -0
- package/dist/charts/lib/axis.js.map +1 -0
- package/dist/charts/lib/background.d.ts +33 -0
- package/dist/charts/lib/background.js +173 -0
- package/dist/charts/lib/background.js.map +1 -0
- package/dist/charts/lib/brush.d.ts +94 -0
- package/dist/charts/lib/brush.js +535 -0
- package/dist/charts/lib/brush.js.map +1 -0
- package/dist/charts/lib/chart.d.ts +94 -0
- package/dist/charts/lib/chart.js +134 -0
- package/dist/charts/lib/chart.js.map +1 -0
- package/dist/charts/lib/dot.d.ts +29 -0
- package/dist/charts/lib/dot.js +78 -0
- package/dist/charts/lib/dot.js.map +1 -0
- package/dist/charts/lib/empty.d.ts +31 -0
- package/dist/charts/lib/empty.js +13 -0
- package/dist/charts/lib/empty.js.map +1 -0
- package/dist/charts/lib/export.d.ts +103 -0
- package/dist/charts/lib/export.js +204 -0
- package/dist/charts/lib/export.js.map +1 -0
- package/dist/charts/lib/figure.d.ts +61 -0
- package/dist/charts/lib/figure.js +59 -0
- package/dist/charts/lib/figure.js.map +1 -0
- package/dist/charts/lib/format.d.ts +46 -0
- package/dist/charts/lib/format.js +56 -0
- package/dist/charts/lib/format.js.map +1 -0
- package/dist/charts/lib/legend.d.ts +45 -0
- package/dist/charts/lib/legend.js +117 -0
- package/dist/charts/lib/legend.js.map +1 -0
- package/dist/charts/lib/loading.d.ts +48 -0
- package/dist/charts/lib/loading.js +105 -0
- package/dist/charts/lib/loading.js.map +1 -0
- package/dist/charts/lib/paint.d.ts +154 -0
- package/dist/charts/lib/paint.js +551 -0
- package/dist/charts/lib/paint.js.map +1 -0
- package/dist/charts/lib/sonify-control.d.ts +163 -0
- package/dist/charts/lib/sonify-control.js +172 -0
- package/dist/charts/lib/sonify-control.js.map +1 -0
- package/dist/charts/lib/sonify.d.ts +248 -0
- package/dist/charts/lib/sonify.js +262 -0
- package/dist/charts/lib/sonify.js.map +1 -0
- package/dist/charts/lib/toolbar.d.ts +143 -0
- package/dist/charts/lib/toolbar.js +156 -0
- package/dist/charts/lib/toolbar.js.map +1 -0
- package/dist/charts/lib/tooltip.d.ts +59 -0
- package/dist/charts/lib/tooltip.js +135 -0
- package/dist/charts/lib/tooltip.js.map +1 -0
- package/dist/charts/lib/values.d.ts +56 -0
- package/dist/charts/lib/values.js +71 -0
- package/dist/charts/lib/values.js.map +1 -0
- package/dist/charts/lib/zoom.d.ts +139 -0
- package/dist/charts/lib/zoom.js +314 -0
- package/dist/charts/lib/zoom.js.map +1 -0
- package/dist/components/AppShell/AppShell.d.ts +15 -1
- package/dist/components/AppShell/AppShell.js +8 -4
- package/dist/components/AppShell/AppShell.js.map +1 -1
- package/dist/components/Article/Article.d.ts +51 -0
- package/dist/components/Article/Article.js +21 -0
- package/dist/components/Article/Article.js.map +1 -0
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +1 -1
- package/dist/components/Calendar/Calendar.js +259 -24
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/Collapsible/Collapsible.d.ts +15 -1
- package/dist/components/Collapsible/Collapsible.js +18 -0
- package/dist/components/Collapsible/Collapsible.js.map +1 -1
- package/dist/components/Combobox/Combobox.js +1 -1
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/Command/Command.js +7 -7
- package/dist/components/Command/Command.js.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +2 -2
- package/dist/components/ContextMenu/ContextMenu.js.map +1 -1
- package/dist/components/Diagram/Diagram.d.ts +81 -0
- package/dist/components/Diagram/Diagram.js +139 -0
- package/dist/components/Diagram/Diagram.js.map +1 -0
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +2 -2
- package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/components/FigureBand/FigureBand.js +41 -30
- package/dist/components/FigureBand/FigureBand.js.map +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Sheet/Sheet.js +1 -1
- package/dist/components/Sheet/Sheet.js.map +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider.js.map +1 -1
- package/dist/components/Steps/Steps.d.ts +65 -0
- package/dist/components/Steps/Steps.js +55 -0
- package/dist/components/Steps/Steps.js.map +1 -0
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/useSelectionIndicator.js +14 -10
- package/dist/lib/useSelectionIndicator.js.map +1 -1
- package/dist/semantic.css +19 -0
- package/dist/styles.css +1 -1
- package/dist/themes.css +103 -7
- package/dist/tokens.css +193 -10
- package/dist/tokens.d.ts +25 -0
- package/dist/tokens.js +154 -8
- package/dist/tokens.json +154 -8
- package/package.json +45 -20
- package/skills/misoto22-design/SKILL.md +171 -0
- package/skills/misoto22-design/evals/claims.json +95 -0
- package/skills/misoto22-design/rules/a11y.md +115 -0
- package/skills/misoto22-design/rules/composition.md +108 -0
- package/skills/misoto22-design/rules/forms.md +128 -0
- package/skills/misoto22-design/rules/naming.md +155 -0
- package/skills/misoto22-design/rules/tokens.md +131 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# @misoto22/design 0.6.0
|
|
2
|
+
|
|
3
|
+
> Monochrome design system: portable CSS tokens and accessible React 19
|
|
4
|
+
> primitives. Components ship compiled — import them, do not copy them.
|
|
5
|
+
|
|
6
|
+
Install: `npm install @misoto22/design`. Styles: `import '@misoto22/design/styles.css'`.
|
|
7
|
+
|
|
8
|
+
One component, in full, offline:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npx misoto22-design docs <Component>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Theme axes
|
|
15
|
+
|
|
16
|
+
Attributes, independent, and they work on any element — not just the root.
|
|
17
|
+
An unset axis is the default.
|
|
18
|
+
|
|
19
|
+
- `data-chart-palette`: `chroma` (unset = the neutral series ramp)
|
|
20
|
+
- `data-density`: `compact` (unset = comfortable)
|
|
21
|
+
- `data-mode`: `dark` `light` (unset = follows the app)
|
|
22
|
+
- `data-motion`: `snappy` `still` (unset = calm)
|
|
23
|
+
- `data-radius`: `round` `sharp` (unset = the default radius ladder)
|
|
24
|
+
- `data-rules`: `firm` `quiet` (unset = hairline)
|
|
25
|
+
- `data-surface`: `cool` `glass` `warm` (unset = paper)
|
|
26
|
+
- `data-table-density`: `compact` (unset = comfortable — whatever `data-density` is doing around it)
|
|
27
|
+
- `data-type`: `bookish` `grotesk` (unset = editorial)
|
|
28
|
+
|
|
29
|
+
There is no `data-accent` attribute: `--accent` is a CSS custom property,
|
|
30
|
+
re-pointed in a stylesheet.
|
|
31
|
+
|
|
32
|
+
## Components
|
|
33
|
+
|
|
34
|
+
### Actions
|
|
35
|
+
|
|
36
|
+
- **Button** — The system’s action, on the same corner as the field beside it.
|
|
37
|
+
- **FloatingIconButton** — A round action pinned to a screen corner.
|
|
38
|
+
|
|
39
|
+
### Forms
|
|
40
|
+
|
|
41
|
+
- **Field** — A labelled form row: label, control, and the one message below it.
|
|
42
|
+
- **Input** — A single line of text entry.
|
|
43
|
+
- **Textarea** — Multi-line text entry, resizable vertically only.
|
|
44
|
+
- **Select** — A choice from a list, styled the whole way down.
|
|
45
|
+
- **NativeSelect** — The platform’s own picker, restyled where it can be.
|
|
46
|
+
- **Checkbox** — A choice that takes effect when the form is submitted.
|
|
47
|
+
- **RadioGroup** — A set of mutually exclusive choices.
|
|
48
|
+
- **Switch** — A setting that takes effect immediately.
|
|
49
|
+
- **Combobox** — A select you can type into.
|
|
50
|
+
- **DatePicker** — A date — or a span of them — chosen from a calendar.
|
|
51
|
+
- **Slider** — A value chosen along a range.
|
|
52
|
+
- **ToggleGroup** — A segmented control: several options, one strip.
|
|
53
|
+
|
|
54
|
+
### Navigation
|
|
55
|
+
|
|
56
|
+
- **Tabs** — One strip, several panels.
|
|
57
|
+
- **Accordion** — Disclosure rows that open in place.
|
|
58
|
+
- **Breadcrumb** — Where you are, as a path.
|
|
59
|
+
- **Pagination** — Numbered pages, with the middle elided.
|
|
60
|
+
- **NavItem** — A row in a sidebar.
|
|
61
|
+
- **Collapsible** — One thing that opens, on its own.
|
|
62
|
+
|
|
63
|
+
### Overlays
|
|
64
|
+
|
|
65
|
+
- **Dialog** — A modal surface: portal, scrim, centred panel.
|
|
66
|
+
- **DropdownMenu** — A menu of actions.
|
|
67
|
+
- **Tooltip** — A short label on hover and on focus.
|
|
68
|
+
- **Popover** — A panel anchored to a control, holding content you can interact with.
|
|
69
|
+
- **Sheet** — A panel docked to an edge of the viewport.
|
|
70
|
+
- **ContextMenu** — The menu a right-click opens.
|
|
71
|
+
- **SearchableMenu** — A menu of actions you can type into.
|
|
72
|
+
- **Command** — A filterable list of actions — the ⌘K surface.
|
|
73
|
+
|
|
74
|
+
### Feedback
|
|
75
|
+
|
|
76
|
+
- **Spinner** — The one “working” indicator — a ring, never a shimmer.
|
|
77
|
+
- **Skeleton** — The shape of the page, before the page.
|
|
78
|
+
- **Progress** — A bar that fills, or sweeps when the end is unknown.
|
|
79
|
+
- **Alert** — A message about the page, in place.
|
|
80
|
+
- **EmptyState** — A collection with nothing in it — yet.
|
|
81
|
+
- **ErrorState** — A page that could not be shown.
|
|
82
|
+
- **Toast** — A transient confirmation, mounted once near the app root.
|
|
83
|
+
|
|
84
|
+
### Display
|
|
85
|
+
|
|
86
|
+
- **Badge** — A count or a state, set in mono so it reads as metadata.
|
|
87
|
+
- **Tag** — A subject label — a topic, a technology, a filter facet.
|
|
88
|
+
- **Kbd** — A key on a keyboard, set as one.
|
|
89
|
+
- **Avatar** — A person, as a circle, with initials until the image lands.
|
|
90
|
+
- **StatusDot** — The dot beside a status word.
|
|
91
|
+
- **Steps** — A numbered sequence, as a rail — one thing after another, with a rule through them.
|
|
92
|
+
- **StatusPill** — A live state, named: a dot plus an uppercase mono label.
|
|
93
|
+
- **LinkArrow** — The mark on a link that leaves the page.
|
|
94
|
+
- **Separator** — A rule, in the three weights a monochrome page needs.
|
|
95
|
+
- **Diagram** — A flow or architecture figure, drawn out of the system’s own parts.
|
|
96
|
+
- **FigureBand** — A row of counted facts, divided by hairlines and nothing else.
|
|
97
|
+
|
|
98
|
+
### Surfaces
|
|
99
|
+
|
|
100
|
+
- **Article** — The long-form reading surface — everything a Markdown pipeline emits, in this system’s type.
|
|
101
|
+
- **Card** — A bounded surface, with no shadow under it.
|
|
102
|
+
- **AppShell** — Two columns on a desktop, a drawer on a phone.
|
|
103
|
+
- **Calendar** — A month, as a grid of days.
|
|
104
|
+
- **ScrollArea** — A box that scrolls, with a scrollbar that looks the same everywhere.
|
|
105
|
+
|
|
106
|
+
### Data
|
|
107
|
+
|
|
108
|
+
- **Table** — A ruled data table — alignment, sorting and rules all per column.
|
|
109
|
+
- **Heatmap** — A grid of values read by weight.
|
|
110
|
+
- **Sparkline** — A run of numbers at the size of a word.
|
|
111
|
+
- **BarList** — A ranked list, with the bar behind the name rather than beside it.
|
|
112
|
+
- **BigNumber** — One number, at the size of a headline.
|
|
113
|
+
- **BulletChart** — A measure, its target, and the bands that say whether it is any good.
|
|
114
|
+
|
|
115
|
+
### Charts
|
|
116
|
+
|
|
117
|
+
- **AreaChart** — A filled series over a continuous axis, where the area means something.
|
|
118
|
+
- **BarChart** — Discrete categories compared by length.
|
|
119
|
+
- **LineChart** — Several series compared over a continuous axis.
|
|
120
|
+
- **ComposedChart** — Bars and lines over one axis — the volume, and the rate it moved at.
|
|
121
|
+
- **PieChart** — Parts of one whole.
|
|
122
|
+
- **RadarChart** — A profile across several named dimensions.
|
|
123
|
+
- **RadialChart** — Values on an arc — a gauge, or a few totals against one scale.
|
|
124
|
+
- **SankeyChart** — Where a quantity goes as it moves through stages.
|
|
125
|
+
- **ScatterChart** — Two measures against each other, one mark per observation.
|
|
126
|
+
- **FunnelChart** — Stages that only ever narrow.
|
|
127
|
+
- **TreemapChart** — Part of a whole, when the whole has too many parts for a pie — and the parts nest.
|
|
128
|
+
- **BoxPlot** — The spread of a measurement, per category.
|
|
129
|
+
- **Histogram** — The shape of one distribution.
|
|
130
|
+
- **WaterfallChart** — How a total got from one figure to another.
|
|
131
|
+
- **Facet** — The same chart once per group, on one shared scale.
|
package/dist/article.css
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
/* ==========================================================================
|
|
2
|
+
ARTICLE — the long-form reading surface
|
|
3
|
+
--------------------------------------------------------------------------
|
|
4
|
+
The one place in this package that styles TAGS rather than components, and
|
|
5
|
+
the reason is that its input is not JSX: it is whatever a Markdown or MDX
|
|
6
|
+
pipeline produced. There is no component to hang a class on, so the contract
|
|
7
|
+
has to be the element names themselves.
|
|
8
|
+
|
|
9
|
+
Scoped to `[data-m22-article]`, which the `Article` component writes. Nothing
|
|
10
|
+
here leaks: a page that does not opt in is untouched, and a component
|
|
11
|
+
rendered INSIDE an article keeps its own classes, because every rule below
|
|
12
|
+
is a bare element selector at specificity 0,1,1 — a utility on a component
|
|
13
|
+
wins.
|
|
14
|
+
|
|
15
|
+
It reads only tokens. Re-point the palette or move the radius factor and the
|
|
16
|
+
article moves with everything else, which is the whole reason this is here
|
|
17
|
+
rather than in each consuming site: three sites hand-rolling a prose
|
|
18
|
+
stylesheet is three prose stylesheets that drift.
|
|
19
|
+
========================================================================== */
|
|
20
|
+
|
|
21
|
+
[data-m22-article] {
|
|
22
|
+
/* A measure, not a width. A narrower column still wins, and a figure or a
|
|
23
|
+
table opts out of it explicitly below. */
|
|
24
|
+
max-width: var(--w-reading);
|
|
25
|
+
color: var(--ink-2);
|
|
26
|
+
font-family: var(--sans);
|
|
27
|
+
font-size: 1rem;
|
|
28
|
+
font-weight: 300;
|
|
29
|
+
line-height: 1.75;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ─── Headings ─────────────────────────────────────────────────────────────
|
|
33
|
+
The type ladder, unchanged. An article does not get its own scale — it is
|
|
34
|
+
the same five steps every other surface climbs, which is what makes a post
|
|
35
|
+
and a component page read as one publication. */
|
|
36
|
+
|
|
37
|
+
[data-m22-article] :is(h1, h2, h3, h4, h5, h6) {
|
|
38
|
+
margin: 0;
|
|
39
|
+
color: var(--ink);
|
|
40
|
+
font-family: var(--font-heading, var(--serif));
|
|
41
|
+
font-weight: 400;
|
|
42
|
+
line-height: 1.25;
|
|
43
|
+
/* An anchored heading has to clear the masthead it scrolls under. */
|
|
44
|
+
scroll-margin-top: var(--scroll-offset);
|
|
45
|
+
}
|
|
46
|
+
[data-m22-article] h1 {
|
|
47
|
+
font-size: var(--fs-title);
|
|
48
|
+
letter-spacing: -0.02em;
|
|
49
|
+
}
|
|
50
|
+
[data-m22-article] h2 {
|
|
51
|
+
font-size: var(--fs-heading);
|
|
52
|
+
}
|
|
53
|
+
[data-m22-article] h3 {
|
|
54
|
+
font-size: var(--fs-sub);
|
|
55
|
+
}
|
|
56
|
+
[data-m22-article] h4 {
|
|
57
|
+
font-size: var(--fs-item);
|
|
58
|
+
}
|
|
59
|
+
[data-m22-article] :is(h5, h6) {
|
|
60
|
+
font-family: var(--mono);
|
|
61
|
+
font-size: 11px;
|
|
62
|
+
font-weight: 400;
|
|
63
|
+
letter-spacing: 0.2em;
|
|
64
|
+
text-transform: uppercase;
|
|
65
|
+
color: var(--ink-3-aa);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ─── Rhythm ───────────────────────────────────────────────────────────────
|
|
69
|
+
Every block gets air ABOVE it and none below, the first one gets none at
|
|
70
|
+
all, and a heading gets more air above than below so it belongs to what
|
|
71
|
+
follows rather than to what it interrupts.
|
|
72
|
+
|
|
73
|
+
The reset uses `:where()`, and that is the load-bearing part. A plain
|
|
74
|
+
`[data-m22-article] p { margin: 0 }` is specificity 0,1,1 and outranks
|
|
75
|
+
`[data-m22-article] > * + *` at 0,1,0 — so the reset silently won and every
|
|
76
|
+
paragraph in the article lost its spacing, which is exactly the defect this
|
|
77
|
+
replaces. `:where()` contributes nothing, so the reset and the rhythm sit at
|
|
78
|
+
the same weight and source order decides, which is what a reset is for. */
|
|
79
|
+
|
|
80
|
+
[data-m22-article] :where(*) {
|
|
81
|
+
margin: 0;
|
|
82
|
+
}
|
|
83
|
+
[data-m22-article] > * + * {
|
|
84
|
+
margin-block-start: 1.25em;
|
|
85
|
+
}
|
|
86
|
+
/* `:is()` takes the specificity of its heaviest argument, so these two land at
|
|
87
|
+
0,1,1 and win over the general rule above whatever their order. */
|
|
88
|
+
[data-m22-article] > :is(h1, h2, h3, h4, h5, h6) {
|
|
89
|
+
margin-block-start: 2.25em;
|
|
90
|
+
}
|
|
91
|
+
[data-m22-article] > :is(h1, h2, h3, h4, h5, h6) + * {
|
|
92
|
+
margin-block-start: 0.75em;
|
|
93
|
+
}
|
|
94
|
+
[data-m22-article] > :first-child {
|
|
95
|
+
margin-block-start: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/* The opening paragraph carries the piece. Marked, not guessed: an author
|
|
99
|
+
writes `<p class="lead">` (or a pipeline emits it), rather than the
|
|
100
|
+
stylesheet deciding that whatever came first is a standfirst. */
|
|
101
|
+
[data-m22-article] p.lead {
|
|
102
|
+
font-size: var(--fs-item);
|
|
103
|
+
line-height: 1.6;
|
|
104
|
+
color: var(--ink);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* ─── Inline ─────────────────────────────────────────────────────────────── */
|
|
108
|
+
|
|
109
|
+
[data-m22-article] a {
|
|
110
|
+
color: var(--ink);
|
|
111
|
+
text-decoration: underline;
|
|
112
|
+
text-decoration-color: var(--rule-2);
|
|
113
|
+
text-underline-offset: 4px;
|
|
114
|
+
transition: text-decoration-color var(--fast) var(--ease);
|
|
115
|
+
}
|
|
116
|
+
[data-m22-article] a:hover {
|
|
117
|
+
text-decoration-color: var(--ink);
|
|
118
|
+
}
|
|
119
|
+
[data-m22-article] strong {
|
|
120
|
+
color: var(--ink);
|
|
121
|
+
font-weight: 500;
|
|
122
|
+
}
|
|
123
|
+
[data-m22-article] em {
|
|
124
|
+
font-style: italic;
|
|
125
|
+
}
|
|
126
|
+
[data-m22-article] mark {
|
|
127
|
+
background: var(--accent-muted);
|
|
128
|
+
color: var(--ink);
|
|
129
|
+
padding-inline: 0.2em;
|
|
130
|
+
}
|
|
131
|
+
[data-m22-article] abbr[title] {
|
|
132
|
+
text-decoration: underline dotted var(--rule-2);
|
|
133
|
+
text-underline-offset: 3px;
|
|
134
|
+
}
|
|
135
|
+
[data-m22-article] :is(sub, sup) {
|
|
136
|
+
font-size: 0.75em;
|
|
137
|
+
line-height: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ─── Lists ────────────────────────────────────────────────────────────────
|
|
141
|
+
The marker is a token, not a glyph the browser picks: a default disc is a
|
|
142
|
+
filled circle at whatever size the font decides, and this system's only
|
|
143
|
+
filled circle is a status dot. */
|
|
144
|
+
|
|
145
|
+
[data-m22-article] :is(ul, ol) {
|
|
146
|
+
padding-inline-start: 1.4em;
|
|
147
|
+
}
|
|
148
|
+
[data-m22-article] :is(ul, ol) :is(ul, ol) {
|
|
149
|
+
margin-block-start: 0.4em;
|
|
150
|
+
}
|
|
151
|
+
[data-m22-article] li + li {
|
|
152
|
+
margin-block-start: 0.4em;
|
|
153
|
+
}
|
|
154
|
+
/* A paragraph or a fence nested inside a list item is still a block. */
|
|
155
|
+
[data-m22-article] li > * + * {
|
|
156
|
+
margin-block-start: 0.6em;
|
|
157
|
+
}
|
|
158
|
+
[data-m22-article] li::marker {
|
|
159
|
+
color: var(--ink-3-aa);
|
|
160
|
+
font-size: 0.9em;
|
|
161
|
+
}
|
|
162
|
+
[data-m22-article] ul {
|
|
163
|
+
list-style: none;
|
|
164
|
+
padding-inline-start: 1.15em;
|
|
165
|
+
}
|
|
166
|
+
[data-m22-article] ul > li {
|
|
167
|
+
position: relative;
|
|
168
|
+
}
|
|
169
|
+
/* A hairline dash, which is the marker the rest of the system uses. */
|
|
170
|
+
[data-m22-article] ul > li::before {
|
|
171
|
+
content: '';
|
|
172
|
+
position: absolute;
|
|
173
|
+
inset-inline-start: -1.15em;
|
|
174
|
+
inset-block-start: 0.85em;
|
|
175
|
+
width: 0.55em;
|
|
176
|
+
height: 1px;
|
|
177
|
+
background: var(--rule-2);
|
|
178
|
+
}
|
|
179
|
+
/* A task list already has its own marker — the checkbox. Both spellings,
|
|
180
|
+
because a pipeline may wrap the input in a label and `:has()` is what makes
|
|
181
|
+
the rule work either way. */
|
|
182
|
+
[data-m22-article] ul > li:has(input[type='checkbox'])::before {
|
|
183
|
+
content: none;
|
|
184
|
+
}
|
|
185
|
+
[data-m22-article] li:has(input[type='checkbox']) {
|
|
186
|
+
padding-inline-start: 0;
|
|
187
|
+
}
|
|
188
|
+
[data-m22-article] input[type='checkbox'] {
|
|
189
|
+
accent-color: var(--accent);
|
|
190
|
+
margin-inline-end: 0.5em;
|
|
191
|
+
/* A published checklist REPORTS state; it does not collect it. Disabled at
|
|
192
|
+
full opacity, because the dimming a browser applies to a disabled control
|
|
193
|
+
is a hint that it is unavailable, not that it is unticked. */
|
|
194
|
+
opacity: 1;
|
|
195
|
+
}
|
|
196
|
+
[data-m22-article] li:has(input[type='checkbox']) label {
|
|
197
|
+
display: inline;
|
|
198
|
+
cursor: default;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
[data-m22-article] dt {
|
|
202
|
+
color: var(--ink);
|
|
203
|
+
font-weight: 500;
|
|
204
|
+
}
|
|
205
|
+
[data-m22-article] dd {
|
|
206
|
+
margin-block-end: 0.75em;
|
|
207
|
+
padding-inline-start: 1em;
|
|
208
|
+
border-inline-start: 1px solid var(--rule);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* ─── Quotation ────────────────────────────────────────────────────────────
|
|
212
|
+
A rule and a change of face, not italics and not a giant quote mark. */
|
|
213
|
+
|
|
214
|
+
[data-m22-article] blockquote {
|
|
215
|
+
padding-inline-start: 1.25em;
|
|
216
|
+
border-inline-start: 2px solid var(--rule-hard);
|
|
217
|
+
color: var(--ink);
|
|
218
|
+
font-family: var(--serif);
|
|
219
|
+
font-size: var(--fs-item);
|
|
220
|
+
line-height: 1.55;
|
|
221
|
+
}
|
|
222
|
+
[data-m22-article] blockquote p + p {
|
|
223
|
+
margin-block-start: 0.6em;
|
|
224
|
+
}
|
|
225
|
+
[data-m22-article] blockquote cite {
|
|
226
|
+
display: block;
|
|
227
|
+
margin-block-start: 0.75em;
|
|
228
|
+
color: var(--ink-3-aa);
|
|
229
|
+
font-family: var(--mono);
|
|
230
|
+
font-size: 11px;
|
|
231
|
+
font-style: normal;
|
|
232
|
+
letter-spacing: 0.08em;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* ─── Code ─────────────────────────────────────────────────────────────────
|
|
236
|
+
An inline span is a chip; a block is a plate. Neither is a second surface
|
|
237
|
+
colour — both sit on the one elevated step the system has. */
|
|
238
|
+
|
|
239
|
+
[data-m22-article] code {
|
|
240
|
+
background: var(--stone);
|
|
241
|
+
border-radius: var(--radius-sm);
|
|
242
|
+
padding: 0.15em 0.4em;
|
|
243
|
+
color: var(--ink);
|
|
244
|
+
font-family: var(--mono);
|
|
245
|
+
font-size: 0.85em;
|
|
246
|
+
}
|
|
247
|
+
[data-m22-article] pre {
|
|
248
|
+
padding: 1rem 1.125rem;
|
|
249
|
+
overflow-x: auto;
|
|
250
|
+
background: var(--paper-2);
|
|
251
|
+
border: 1px solid var(--rule);
|
|
252
|
+
border-radius: var(--radius-lg);
|
|
253
|
+
font-size: 13px;
|
|
254
|
+
line-height: 1.7;
|
|
255
|
+
scrollbar-width: thin;
|
|
256
|
+
scrollbar-color: var(--rule-2) transparent;
|
|
257
|
+
}
|
|
258
|
+
[data-m22-article] pre code {
|
|
259
|
+
background: none;
|
|
260
|
+
border-radius: 0;
|
|
261
|
+
padding: 0;
|
|
262
|
+
font-size: inherit;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* ─── Figures, media and tables ────────────────────────────────────────────
|
|
266
|
+
These are the three things allowed out of the measure: a table with six
|
|
267
|
+
columns and an image with a subject in it are both unreadable at 46rem. */
|
|
268
|
+
|
|
269
|
+
[data-m22-article] :is(figure, table, .m22-wide) {
|
|
270
|
+
width: 100%;
|
|
271
|
+
max-width: none;
|
|
272
|
+
}
|
|
273
|
+
[data-m22-article] > figure {
|
|
274
|
+
margin-block-start: 2em;
|
|
275
|
+
}
|
|
276
|
+
[data-m22-article] :is(img, video) {
|
|
277
|
+
display: block;
|
|
278
|
+
max-width: 100%;
|
|
279
|
+
height: auto;
|
|
280
|
+
border-radius: var(--radius);
|
|
281
|
+
}
|
|
282
|
+
[data-m22-article] figcaption {
|
|
283
|
+
margin-block-start: 0.75em;
|
|
284
|
+
color: var(--ink-3-aa);
|
|
285
|
+
font-family: var(--mono);
|
|
286
|
+
font-size: 11px;
|
|
287
|
+
letter-spacing: 0.08em;
|
|
288
|
+
line-height: 1.6;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
[data-m22-article] .m22-table-scroll {
|
|
292
|
+
overflow-x: auto;
|
|
293
|
+
scrollbar-width: thin;
|
|
294
|
+
scrollbar-color: var(--rule-2) transparent;
|
|
295
|
+
}
|
|
296
|
+
[data-m22-article] table {
|
|
297
|
+
border-collapse: collapse;
|
|
298
|
+
font-size: 0.9375rem;
|
|
299
|
+
text-align: start;
|
|
300
|
+
}
|
|
301
|
+
[data-m22-article] th {
|
|
302
|
+
padding: 0.65em 1.25em 0.65em 0;
|
|
303
|
+
border-block-end: 1px solid var(--rule-hard);
|
|
304
|
+
color: var(--ink-3-aa);
|
|
305
|
+
font-family: var(--mono);
|
|
306
|
+
font-size: 11px;
|
|
307
|
+
font-weight: 400;
|
|
308
|
+
letter-spacing: 0.2em;
|
|
309
|
+
text-transform: uppercase;
|
|
310
|
+
text-align: start;
|
|
311
|
+
white-space: nowrap;
|
|
312
|
+
}
|
|
313
|
+
[data-m22-article] td {
|
|
314
|
+
padding: 0.65em 1.25em 0.65em 0;
|
|
315
|
+
border-block-end: 1px solid var(--rule);
|
|
316
|
+
color: var(--ink-2);
|
|
317
|
+
vertical-align: baseline;
|
|
318
|
+
}
|
|
319
|
+
[data-m22-article] :is(th, td):last-child {
|
|
320
|
+
padding-inline-end: 0;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
[data-m22-article] > hr {
|
|
324
|
+
margin-block-start: 2.5em;
|
|
325
|
+
}
|
|
326
|
+
[data-m22-article] hr {
|
|
327
|
+
border: 0;
|
|
328
|
+
border-block-start: 1px solid var(--rule);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
[data-m22-article] kbd {
|
|
332
|
+
border: 1px solid var(--rule-2);
|
|
333
|
+
border-radius: var(--radius-sm);
|
|
334
|
+
padding: 0.1em 0.4em;
|
|
335
|
+
color: var(--ink-2);
|
|
336
|
+
font-family: var(--mono);
|
|
337
|
+
font-size: 0.8em;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/* ─── Mathematics ──────────────────────────────────────────────────────────
|
|
341
|
+
MathML, which is why there is no font to load and no second stylesheet: the
|
|
342
|
+
browser sets it in the surrounding face. A display formula is centred and
|
|
343
|
+
allowed to scroll, because a long equation is the one block that genuinely
|
|
344
|
+
cannot wrap. */
|
|
345
|
+
|
|
346
|
+
[data-m22-article] math {
|
|
347
|
+
color: var(--ink);
|
|
348
|
+
font-size: 1.05em;
|
|
349
|
+
}
|
|
350
|
+
[data-m22-article] .m22-math {
|
|
351
|
+
/* `overflow-x: auto` alone turns the OTHER axis into `auto` too, which drew
|
|
352
|
+
a vertical scrollbar down the side of every formula. */
|
|
353
|
+
overflow-x: auto;
|
|
354
|
+
overflow-y: hidden;
|
|
355
|
+
padding-block: 0.35em;
|
|
356
|
+
scrollbar-width: thin;
|
|
357
|
+
scrollbar-color: var(--rule-2) transparent;
|
|
358
|
+
}
|
|
359
|
+
/* A block-level `math` is not affected by the container's `text-align`, so it
|
|
360
|
+
is centred the way any block is: by its own margins. */
|
|
361
|
+
[data-m22-article] math[display='block'] {
|
|
362
|
+
display: block;
|
|
363
|
+
width: fit-content;
|
|
364
|
+
margin-inline: auto;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/* ─── Footnotes ────────────────────────────────────────────────────────────
|
|
368
|
+
Ruled off and set small: they are apparatus, not the piece. */
|
|
369
|
+
|
|
370
|
+
[data-m22-article] > .footnotes {
|
|
371
|
+
margin-block-start: 3em;
|
|
372
|
+
}
|
|
373
|
+
[data-m22-article] .footnotes {
|
|
374
|
+
padding-block-start: 1.5em;
|
|
375
|
+
border-block-start: 1px solid var(--rule);
|
|
376
|
+
font-size: 0.875rem;
|
|
377
|
+
}
|
|
378
|
+
[data-m22-article] .footnotes h2 {
|
|
379
|
+
font-family: var(--mono);
|
|
380
|
+
font-size: 11px;
|
|
381
|
+
letter-spacing: 0.2em;
|
|
382
|
+
text-transform: uppercase;
|
|
383
|
+
color: var(--ink-3-aa);
|
|
384
|
+
}
|
|
385
|
+
/* The reference and its back-arrow keep the underline every other link in the
|
|
386
|
+
article has. Stripping it was a WCAG 1.4.1 failure and axe says so: a link
|
|
387
|
+
inside a block of text has to be distinguishable from the text without
|
|
388
|
+
relying on colour, and ink on --ink-2 is 2.14:1 — well under the 3:1 that
|
|
389
|
+
would let colour carry it alone. */
|
|
390
|
+
[data-m22-article] .footnote-backref {
|
|
391
|
+
/* The glyph is the affordance; a name is not. */
|
|
392
|
+
font-size: 0.9em;
|
|
393
|
+
}
|