@nulib/canopy 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,17 @@
13
13
  padding: 0.5rem 0;
14
14
  }
15
15
 
16
+ // A list's markers are the list's, and its items take them from it: bullets for `ul`,
17
+ // numbers for `ol`. A list that asks for none shows none, as Clover's slider track
18
+ // does. (Set on each item, a bullet beat that, and numbered lists showed bullets.)
19
+ ul {
20
+ list-style: disc;
21
+ }
22
+
23
+ ol {
24
+ list-style: decimal;
25
+ }
26
+
16
27
  ol,
17
28
  ul {
18
29
  padding: 0.5rem 0;
@@ -20,7 +31,6 @@
20
31
 
21
32
  li {
22
33
  margin-bottom: 0.382rem;
23
- list-style: disc;
24
34
  }
25
35
  }
26
36
 
@@ -54,11 +64,11 @@
54
64
  overflow-wrap: anywhere;
55
65
  }
56
66
 
57
- // Reading text, as a magazine sets it (settings/_tokens.scss): a page's prose, the
58
- // paragraphs, lists and quotes Markdown writes, which carry no class (a task list only
59
- // Markdown's own), in the body serif and a step larger. Components keep the
60
- // interface's sans, as does whatever a Clover part draws. A site's own `app/styles`
61
- // base rules come later in the layer and win.
67
+ // Reading text: a page's prose, the paragraphs, lists and quotes Markdown writes,
68
+ // which carry no class (a task list only Markdown's own), in the body face and a step
69
+ // larger, across the whole width of what holds it, as the components beside it are.
70
+ // Components keep the interface's face, as does whatever a Clover part draws. A site's
71
+ // own `app/styles` base rules come later in the layer and win.
62
72
  main
63
73
  :where(p, ul, ol, blockquote):not([class]:not(.contains-task-list)):not(
64
74
  :where(
@@ -72,16 +82,6 @@
72
82
  *
73
83
  ) {
74
84
  @include type.body;
75
- max-inline-size: var(--canopy-measure);
76
- }
77
-
78
- // A picture Markdown sets in a paragraph keeps the column's whole width, as a figure
79
- // runs wider than a magazine's text.
80
- main
81
- :where(p):not([class]:not(.contains-task-list)):has(
82
- > :is(img, picture, video, iframe, svg, a > img)
83
- ) {
84
- max-inline-size: none;
85
85
  }
86
86
 
87
87
  input,
@@ -1,7 +1,7 @@
1
1
  @utility max-w-content {
2
- max-width: 1080px;
2
+ max-width: var(--canopy-container-content, 75rem);
3
3
  }
4
4
 
5
5
  @utility max-w-wide {
6
- max-width: 1300px;
6
+ max-width: var(--canopy-container-wide, 90rem);
7
7
  }
@@ -16,9 +16,11 @@
16
16
  --hero-bg-start: var(--color-gray-50);
17
17
  --hero-bg-mid: var(--color-accent-50);
18
18
  --hero-bg-end: var(--color-accent-200);
19
- // A slide button's dot holds 3:1 on the page (1.4.11); the current one is the
19
+ // A slide button's dot: the muted gray, the hero's ground showing through, at the share
20
+ // the theme's build works out (`--canopy-dot-share`, ui/theme-palette.js): 80%, or
21
+ // nearer solid where 3:1 on that ground needs it (1.4.11). The current one is the
20
22
  // accent, and larger, so its state is not in its color alone.
21
- --hero-dot-bg: var(--color-gray-muted);
23
+ --hero-dot-bg: color-mix(in srgb, var(--color-gray-muted) var(--canopy-dot-share, 100%), transparent);
22
24
  --hero-dot-active-bg: var(--color-accent-default);
23
25
 
24
26
  background: linear-gradient(
@@ -36,11 +38,16 @@
36
38
  display: none;
37
39
  }
38
40
 
41
+ // Its words and carousel within the page's wide column, inset as `<Container>` is, so
42
+ // the headline is level with the sections under it; the hero's ground spans the window.
39
43
  .canopy-interstitial__layout {
40
44
  display: flex;
41
45
  flex-direction: column;
42
46
  min-height: var(--hero-height);
43
47
  width: 100%;
48
+ max-width: var(--canopy-container-wide);
49
+ margin-inline: auto;
50
+ box-sizing: border-box;
44
51
  overflow: hidden;
45
52
  }
46
53
 
@@ -49,22 +56,23 @@
49
56
  display: flex;
50
57
  align-items: center;
51
58
  justify-content: center;
52
- padding: clamp(1.618rem, 5vw, 3rem) clamp(1.618rem, 4vw, 3rem);
59
+ padding: clamp(1.618rem, 5vw, 3rem) 1.618rem;
53
60
  box-sizing: border-box;
54
61
  min-width: 0;
55
62
  }
56
63
 
64
+ // The panel's inset is the column's, so the words start where the sections' do.
57
65
  .canopy-interstitial__body {
58
66
  align-items: flex-start;
59
67
  text-align: left;
60
68
  width: 100%;
61
69
  max-width: none;
62
70
  margin: 0;
71
+ padding-inline: 0;
63
72
  gap: 1.5rem;
64
73
  }
65
74
 
66
- // The carousel: its slide on the stage, the rotation control over the stage's
67
- // corner (first in reading order, `Hero.jsx`), the slide buttons below it.
75
+ // The carousel: its slide on the stage, the slide buttons below it.
68
76
  .canopy-interstitial__media-group {
69
77
  flex: 1;
70
78
  position: relative;
@@ -75,7 +83,7 @@
75
83
  "stage"
76
84
  "dots";
77
85
  align-content: start;
78
- padding: clamp(1.5rem, 4vw, 3rem);
86
+ padding: clamp(1.5rem, 4vw, 3rem) 1.618rem;
79
87
  box-sizing: border-box;
80
88
  min-width: 0;
81
89
  overflow: hidden;
@@ -85,13 +93,6 @@
85
93
  grid-area: stage;
86
94
  }
87
95
 
88
- .canopy-interstitial__rotation {
89
- grid-area: stage;
90
- align-self: start;
91
- justify-self: start;
92
- margin: 0.618rem;
93
- }
94
-
95
96
  .canopy-interstitial__caption {
96
97
  position: static;
97
98
  margin: 1.5rem auto 0;
@@ -213,8 +214,7 @@
213
214
  // (`hero-slider-runtime.js`).
214
215
  &__slide[hidden],
215
216
  &__nav[hidden],
216
- &__pagination[hidden],
217
- &__rotation[hidden] {
217
+ &__pagination[hidden] {
218
218
  display: none;
219
219
  }
220
220
 
@@ -415,38 +415,8 @@
415
415
  }
416
416
  }
417
417
 
418
- // The rotation control: drawn as previous and next are, its glyph the state it will
419
- // set (pause while the slides rotate, play once they are stopped).
420
- &__rotation {
421
- @include buttons.canopy-button-base(0.25rem, 0.25rem);
422
- position: relative;
423
- z-index: 5;
424
- width: 2.618rem;
425
- height: 2.618rem;
426
- border: none;
427
- border-radius: var(--canopy-radius-pill);
428
- color: var(--color-gray-50);
429
- background-color: var(--color-accent-default);
430
-
431
- &:hover {
432
- background-color: var(--color-accent-hover);
433
- }
434
-
435
- svg {
436
- display: block;
437
- width: 1rem;
438
- height: 1rem;
439
- }
440
- }
441
-
442
- &__rotation[data-rotation="on"] &__rotation-icon--play,
443
- &__rotation[data-rotation="off"] &__rotation-icon--pause {
444
- display: none;
445
- }
446
-
447
418
  // The hero clips what spills out of it, so its controls draw their focus inside:
448
419
  // the page's ground on the accent, 4.5:1 (2.4.7).
449
- &__rotation:focus-visible,
450
420
  &__nav-btn:focus-visible {
451
421
  outline: 2px solid var(--color-gray-50);
452
422
  outline-offset: -5px;
@@ -523,8 +493,7 @@
523
493
 
524
494
  // The centered hero (`variant="centered"`), after Clover's homepage: the headline at
525
495
  // display size, its words a lede and its links under it, all centered on the page's own
526
- // ground; the carousel under them in a raised card, each picture whole. The rotation
527
- // control keeps its corner of the stage, first in reading order (2.2.2).
496
+ // ground; the carousel under them in a raised card, each picture whole.
528
497
  .canopy-interstitial--hero-centered {
529
498
  margin-top: 0;
530
499
  padding-top: 0;
@@ -618,8 +587,4 @@
618
587
  margin: 0;
619
588
  padding: 0 0 1rem;
620
589
  }
621
-
622
- .canopy-interstitial__rotation {
623
- margin: 0.75rem;
624
- }
625
590
  }
@@ -1,4 +1,5 @@
1
1
  @use "../settings/type";
2
+ @use "../settings/focus" as focus;
2
3
  @layer components {
3
4
  .canopy-work--layout {
4
5
  --canopy-work-gap: clamp(1.5rem, 3vw, 2.75rem);
@@ -27,11 +28,99 @@
27
28
  box-shadow: var(--canopy-card-shadow);
28
29
  }
29
30
 
31
+ // The viewer's toggle (`lib/components/viewer-runtime-entry.js`): from 961px, where the
32
+ // viewer and the work's words sit side by side, it spreads the viewer across the column
33
+ // and stacks the words under it, and back (Mat, 2026-11-18). It straddles the viewer's
34
+ // corner beside Clover's own controls: 36px, its edge 3:1 (1.4.11, 2.5.8), its icon the
35
+ // way it will go.
36
+ .canopy-work--primary {
37
+ position: relative;
38
+ }
39
+
40
+ .canopy-work__widen {
41
+ display: none;
42
+ }
43
+
44
+ @media (min-width: 961px) {
45
+ .canopy-work__widen {
46
+ position: absolute;
47
+ top: 1.5rem;
48
+ inset-inline-end: -1.125rem;
49
+ z-index: 3;
50
+ display: inline-flex;
51
+ align-items: center;
52
+ justify-content: center;
53
+ box-sizing: border-box;
54
+ width: 2.25rem;
55
+ height: 2.25rem;
56
+ padding: 0;
57
+ border: 1px solid var(--canopy-control-edge);
58
+ border-radius: var(--canopy-radius-pill);
59
+ background-color: var(--canopy-surface-raised);
60
+ color: var(--color-gray-default);
61
+ cursor: pointer;
62
+
63
+ &:hover {
64
+ border-color: var(--color-gray-muted);
65
+ }
66
+
67
+ &:focus-visible {
68
+ @include focus.focus-ring;
69
+ }
70
+
71
+ svg {
72
+ width: 1.25rem;
73
+ height: 1.25rem;
74
+ }
75
+ }
76
+
77
+ .canopy-work__widen[aria-pressed="true"] .canopy-work__widen-icon--widen,
78
+ .canopy-work__widen[aria-pressed="false"] .canopy-work__widen-icon--narrow {
79
+ display: none;
80
+ }
81
+
82
+ .canopy-work--layout[data-viewer="wide"] {
83
+ flex-direction: column;
84
+
85
+ > .canopy-work--primary,
86
+ > .canopy-work--secondary {
87
+ flex-basis: auto;
88
+ width: 100%;
89
+ }
90
+ }
91
+ }
92
+
93
+ // The work's metadata (`<Metadata>`, `dl.clover-metadata`) in columns wherever it has the
94
+ // column's whole width, under a wide viewer or under 961px: three at most, fewer where
95
+ // a column would be under 16rem (Mat, 2026-11-18: "try three columns max"), read across,
96
+ // then down. Its references, attribution and id keep the whole width ("don't do
97
+ // columns here").
98
+ @mixin metadata-columns {
99
+ --canopy-metadata-gap: var(--canopy-space-l);
100
+ display: grid;
101
+ grid-template-columns: repeat(
102
+ auto-fill,
103
+ minmax(max(min(100%, 16rem), calc((100% - 2 * var(--canopy-metadata-gap)) / 3)), 1fr)
104
+ );
105
+ column-gap: var(--canopy-metadata-gap);
106
+ // Each label and its value at the top of its cell, its value right under it, however
107
+ // tall the row's other cells are.
108
+ align-items: start;
109
+ }
110
+
111
+ .canopy-work--layout[data-viewer="wide"] .canopy-work--secondary dl.clover-metadata {
112
+ @include metadata-columns;
113
+ }
114
+
30
115
  @media (max-width: 960px) {
31
116
  .canopy-work--layout {
32
117
  flex-direction: column;
33
118
  }
34
119
 
120
+ .canopy-work--secondary dl.clover-metadata {
121
+ @include metadata-columns;
122
+ }
123
+
35
124
  .canopy-work--primary,
36
125
  .canopy-work--secondary {
37
126
  flex-basis: 100%;
@@ -50,6 +139,11 @@
50
139
  padding: 0;
51
140
  }
52
141
 
142
+ // The metadata set apart from the references above it and the attribution under it.
143
+ dl.clover-metadata {
144
+ margin-block: var(--canopy-space-l);
145
+ }
146
+
53
147
  dl > div {
54
148
  display: grid;
55
149
  gap: 0.2rem;
@@ -3,9 +3,10 @@
3
3
  @use "../buttons" as buttons;
4
4
  @use "../../settings/type";
5
5
 
6
- // The header (`CanopyHeader`): 64px, solid, the brand at its start, the search field and
7
- // the primary navigation after it, the language switch and the compact layout's two
8
- // buttons at its end. Sticky only where the window is tall enough to spare it: zoomed in,
6
+ // The header (`CanopyHeader`): 64px, solid, the brand at its start; at its end the search,
7
+ // the primary navigation, then the language switch and the compact layout's two buttons.
8
+ // At desktop widths the search is a button that opens into its field (the header's
9
+ // script); the field grows from the button toward the brand. Sticky only where the window is tall enough to spare it: zoomed in,
9
10
  // it scrolls away with the page (1.4.10), and the page leaves room under it for whatever
10
11
  // takes focus (2.4.11).
11
12
  @layer components {
@@ -65,8 +66,80 @@
65
66
  .canopy-header__desktop-search {
66
67
  display: none;
67
68
  flex: 1 1 20rem;
69
+ justify-content: flex-end;
68
70
  min-width: 0;
69
71
  max-width: 36rem;
72
+ margin-inline-start: auto;
73
+ }
74
+
75
+ .canopy-header__desktop-search[data-expanded="false"] {
76
+ flex: 0 0 auto;
77
+
78
+ .canopy-header__search-field {
79
+ display: none;
80
+ }
81
+ }
82
+
83
+ .canopy-header__desktop-search[data-expanded="true"] .canopy-header__search-toggle {
84
+ display: none;
85
+ }
86
+
87
+ .canopy-header__search-field {
88
+ width: 100%;
89
+ }
90
+
91
+ // The button the search opens from: the field's own pill and edge (3:1, 1.4.11), its
92
+ // icon and word, 44px tall (2.5.8).
93
+ .canopy-header__search-toggle {
94
+ display: inline-flex;
95
+ align-items: center;
96
+ gap: 0.5rem;
97
+ box-sizing: border-box;
98
+ min-height: 2.75rem;
99
+ padding: 0 1.125rem 0 0.875rem;
100
+ border: 1px solid var(--canopy-control-edge);
101
+ border-radius: var(--canopy-radius-pill);
102
+ background-color: var(--color-gray-50);
103
+ color: var(--color-gray-default);
104
+ cursor: pointer;
105
+ @include type.ui;
106
+
107
+ svg {
108
+ width: 1.25rem;
109
+ height: 1.25rem;
110
+ flex-shrink: 0;
111
+ }
112
+
113
+ &:hover {
114
+ border-color: var(--color-gray-muted);
115
+ }
116
+
117
+ &:focus-visible {
118
+ @include focus.focus-ring;
119
+ }
120
+
121
+ &[hidden] {
122
+ display: none;
123
+ }
124
+ }
125
+
126
+ // Opened, the field grows out of the button, where motion is welcome. Its suggestions
127
+ // are not clipped: only the field's pill is, and only as it grows.
128
+ @media (prefers-reduced-motion: no-preference) {
129
+ .canopy-header__desktop-search[data-canopy-header-search="ready"][data-expanded="true"]
130
+ .canopy-search-form {
131
+ animation: canopy-header-search-open 200ms var(--canopy-ease) backwards;
132
+ }
133
+ }
134
+
135
+ @keyframes canopy-header-search-open {
136
+ from {
137
+ clip-path: inset(0 0 0 calc(100% - 8rem) round var(--canopy-radius-pill));
138
+ }
139
+
140
+ to {
141
+ clip-path: inset(0 round var(--canopy-radius-pill));
142
+ }
70
143
  }
71
144
 
72
145
  .canopy-header__desktop-search [data-canopy-search-form] {
@@ -272,17 +345,29 @@
272
345
  }
273
346
 
274
347
  .canopy-header__desktop-search {
275
- display: block;
348
+ display: flex;
276
349
  }
277
350
 
351
+ // The primary navigation at the header's end, after the search and before the
352
+ // actions: the first of them takes the room the actions' margin would, so they stay
353
+ // together.
278
354
  .canopy-header__desktop-nav {
279
355
  display: flex;
356
+ margin-inline-start: auto;
357
+ }
358
+
359
+ .canopy-header__desktop-search ~ .canopy-header__desktop-nav {
360
+ margin-inline-start: 0;
280
361
  }
281
362
 
282
363
  .canopy-header__actions {
283
364
  display: flex;
284
365
  }
285
366
 
367
+ .canopy-header__desktop-nav ~ .canopy-header__actions {
368
+ margin-left: 0;
369
+ }
370
+
286
371
  .canopy-header__search-trigger {
287
372
  display: none;
288
373
  }
@@ -1,8 +1,7 @@
1
1
  @use "../../settings/focus" as focus;
2
2
 
3
- // The brand (`CanopyBrand`): the site's mark and its title, in the page's text. Under the
4
- // pointer or keyboard focus, the brush stroke draws under the title (`--canopy-swoosh`),
5
- // at once where motion is reduced.
3
+ // The brand (`CanopyBrand`): the site's mark and its title, in the page's text, with the
4
+ // focus ring of every control.
6
5
  @layer components {
7
6
  .canopy-logo {
8
7
  display: flex;
@@ -42,45 +41,14 @@
42
41
 
43
42
  span {
44
43
  display: block;
45
- position: relative;
46
- isolation: isolate;
47
44
  min-width: 0;
48
45
  max-width: 100%;
49
46
  white-space: nowrap;
50
47
  overflow: hidden;
51
48
  text-overflow: ellipsis;
52
- padding-bottom: 0.3em;
53
- margin-bottom: -0.3em;
54
49
  line-height: 1.5;
55
50
  }
56
51
 
57
- span::after {
58
- content: "";
59
- position: absolute;
60
- left: -0.04em;
61
- right: -0.06em;
62
- bottom: 0;
63
- height: 0.42em;
64
- rotate: 1.5deg;
65
- z-index: -1;
66
- background: linear-gradient(
67
- to right,
68
- color-mix(in srgb, var(--color-accent-600) 30%, transparent),
69
- var(--color-accent-600)
70
- );
71
- mask: var(--canopy-swoosh) center / 100% 100% no-repeat;
72
- clip-path: inset(0 100% 0 0);
73
- }
74
-
75
- &:is(:hover, :focus-visible) span::after {
76
- clip-path: inset(0 0 0 0);
77
- }
78
- }
79
-
80
- @media (prefers-reduced-motion: no-preference) {
81
- .canopy-logo span::after {
82
- transition: clip-path 480ms var(--canopy-ease);
83
- }
84
52
  }
85
53
 
86
54
  html.dark .canopy-logo {
@@ -1,5 +1,61 @@
1
+ @use "../../settings/focus" as focus;
2
+
1
3
  // The slider is Clover 4's Items (`clover-items`), which draws itself from Clover's
2
- // tokens; Canopy keeps only the room above it.
4
+ // tokens. Canopy keeps the room above it (a golden step more since 2.0.2), and sets its
5
+ // previous and next a golden step in from the track's edges (`--canopy-space-s`), off the
6
+ // cards' corners, where Clover has them at the edge (`--clover-space-2xs`). A vertical
7
+ // slider keeps Clover's.
3
8
  .canopy-slider {
4
- margin: 1.618rem 0 0;
9
+ margin: var(--canopy-space-xl) 0 0;
10
+ }
11
+
12
+ // Under Canopy's header (a facet's slider) the track follows it at the header's own
13
+ // distance, Clover's, not a slider's room above it.
14
+ .canopy-slider__header + [data-canopy-slider] .canopy-slider {
15
+ margin-top: 0;
16
+ }
17
+
18
+ @layer components {
19
+ .clover-items.canopy-slider:not([data-orientation="vertical"]) {
20
+ .clover-items-scroll-prev {
21
+ inset-inline-start: var(--canopy-space-s);
22
+ }
23
+
24
+ .clover-items-scroll-next {
25
+ inset-inline-end: var(--canopy-space-s);
26
+ }
27
+ }
28
+
29
+ // A facet's slider (`<RelatedItems>`): its value is its heading and the link to every
30
+ // work with that value on the search page, where Clover's header had "View all" beside
31
+ // it (lib/build/mdx.js, `makeHeader`). The title's own color and weight, underlined, as
32
+ // a link in running text is (C11); the page's "View all" goes with it, unseen, so a
33
+ // screen reader hears where it goes (2.4.4), the value first (2.5.3).
34
+ .canopy-slider__title-link {
35
+ color: inherit;
36
+ text-decoration-line: underline;
37
+ text-decoration-thickness: 1px;
38
+ text-underline-offset: 0.15em;
39
+ border-radius: var(--canopy-radius-sm);
40
+
41
+ &:hover {
42
+ text-decoration-thickness: max(2px, 0.1em);
43
+ }
44
+
45
+ &:focus-visible {
46
+ @include focus.focus-ring;
47
+ }
48
+ }
49
+
50
+ .canopy-slider__more {
51
+ position: absolute;
52
+ width: 1px;
53
+ height: 1px;
54
+ margin: -1px;
55
+ padding: 0;
56
+ overflow: hidden;
57
+ clip-path: inset(50%);
58
+ white-space: nowrap;
59
+ border: 0;
60
+ }
5
61
  }
@@ -10,7 +10,6 @@
10
10
  @use "./footer";
11
11
  @use "./modal";
12
12
  @use "./interstitial-hero";
13
- @use "./swoosh";
14
13
  @use "./band";
15
14
  @use "./feature";
16
15
  @use "./iiif";