@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.
@@ -32,7 +32,6 @@
32
32
  --canopy-tracking-tight: -0.02em;
33
33
  --canopy-tracking-snug: -0.01em;
34
34
  --canopy-tracking-label: 0.06em;
35
- --canopy-measure: 70ch;
36
35
  --canopy-radius-none: 0;
37
36
  --canopy-radius-sm: 4px;
38
37
  --canopy-radius-md: 8px;
@@ -62,7 +61,6 @@
62
61
  --canopy-band-text: #fff;
63
62
  --canopy-band-muted: color-mix(in srgb, #fff 72%, #000);
64
63
  --canopy-band-edge: transparent;
65
- --canopy-swoosh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cpath d='M3 14.5c34-4.2 74-6.1 118-6.6 52-.6 107 .9 175-3.4 2.2-.1 3.6 1.6 3.4 3.4-.2 1.6-1.4 2.7-3 2.9-69 6.3-122 5.3-175 5.9-41 .5-79 2.3-115 6.5-2.4.3-4.5-1.4-4.7-3.8-.2-2.3 1.4-4.5 3.7-4.9z'/%3E%3C/svg%3E");
66
64
  --canopy-ease: cubic-bezier(0.65, 0, 0.35, 1);
67
65
  --canopy-space-3xs: 0.146rem;
68
66
  --canopy-space-2xs: 0.236rem;
@@ -72,6 +70,8 @@
72
70
  --canopy-space-l: 1.618rem;
73
71
  --canopy-space-xl: 2.618rem;
74
72
  --canopy-space-2xl: 4.236rem;
73
+ --canopy-container-content: 75rem;
74
+ --canopy-container-wide: 90rem;
75
75
  --canopy-sticky-top: 0px;
76
76
  }
77
77
  :root.dark {
@@ -104,6 +104,12 @@
104
104
  line-height: 1.618;
105
105
  padding: 0.5rem 0;
106
106
  }
107
+ ul {
108
+ list-style: disc;
109
+ }
110
+ ol {
111
+ list-style: decimal;
112
+ }
107
113
  ol,
108
114
  ul {
109
115
  padding: 0.5rem 0;
@@ -112,7 +118,6 @@
112
118
  ol li,
113
119
  ul li {
114
120
  margin-bottom: 0.382rem;
115
- list-style: disc;
116
121
  }
117
122
  a {
118
123
  text-decoration: none;
@@ -143,10 +148,6 @@
143
148
  font-weight: var(--canopy-weight-regular);
144
149
  line-height: 1.618;
145
150
  letter-spacing: normal;
146
- max-inline-size: var(--canopy-measure);
147
- }
148
- main :where(p):not([class]:not(.contains-task-list)):has(> :is(img, picture, video, iframe, svg, a > img)) {
149
- max-inline-size: none;
150
151
  }
151
152
  input,
152
153
  textarea,
@@ -423,10 +424,10 @@ section[data-footnotes] ul li,
423
424
  }
424
425
 
425
426
  @utility max-w-content {
426
- max-width: 1080px;
427
+ max-width: var(--canopy-container-content, 75rem);
427
428
  }
428
429
  @utility max-w-wide {
429
- max-width: 1300px;
430
+ max-width: var(--canopy-container-wide, 90rem);
430
431
  }
431
432
  @layer components {
432
433
  .canopy-type-display {
@@ -1284,8 +1285,68 @@ section[data-footnotes] ul li,
1284
1285
  .canopy-header__desktop-search {
1285
1286
  display: none;
1286
1287
  flex: 1 1 20rem;
1288
+ justify-content: flex-end;
1287
1289
  min-width: 0;
1288
1290
  max-width: 36rem;
1291
+ margin-inline-start: auto;
1292
+ }
1293
+ .canopy-header__desktop-search[data-expanded=false] {
1294
+ flex: 0 0 auto;
1295
+ }
1296
+ .canopy-header__desktop-search[data-expanded=false] .canopy-header__search-field {
1297
+ display: none;
1298
+ }
1299
+ .canopy-header__desktop-search[data-expanded=true] .canopy-header__search-toggle {
1300
+ display: none;
1301
+ }
1302
+ .canopy-header__search-field {
1303
+ width: 100%;
1304
+ }
1305
+ .canopy-header__search-toggle {
1306
+ display: inline-flex;
1307
+ align-items: center;
1308
+ gap: 0.5rem;
1309
+ box-sizing: border-box;
1310
+ min-height: 2.75rem;
1311
+ padding: 0 1.125rem 0 0.875rem;
1312
+ border: 1px solid var(--canopy-control-edge);
1313
+ border-radius: var(--canopy-radius-pill);
1314
+ background-color: var(--color-gray-50);
1315
+ color: var(--color-gray-default);
1316
+ cursor: pointer;
1317
+ font-family: var(--default-font-family);
1318
+ font-size: var(--canopy-text-md);
1319
+ font-weight: var(--canopy-weight-regular);
1320
+ line-height: 1.5;
1321
+ letter-spacing: normal;
1322
+ }
1323
+ .canopy-header__search-toggle svg {
1324
+ width: 1.25rem;
1325
+ height: 1.25rem;
1326
+ flex-shrink: 0;
1327
+ }
1328
+ .canopy-header__search-toggle:hover {
1329
+ border-color: var(--color-gray-muted);
1330
+ }
1331
+ .canopy-header__search-toggle:focus-visible {
1332
+ outline: var(--canopy-focus-width) solid var(--canopy-focus-color);
1333
+ outline-offset: var(--canopy-focus-offset);
1334
+ }
1335
+ .canopy-header__search-toggle[hidden] {
1336
+ display: none;
1337
+ }
1338
+ @media (prefers-reduced-motion: no-preference) {
1339
+ .canopy-header__desktop-search[data-canopy-header-search=ready][data-expanded=true] .canopy-search-form {
1340
+ animation: canopy-header-search-open 200ms var(--canopy-ease) backwards;
1341
+ }
1342
+ }
1343
+ @keyframes canopy-header-search-open {
1344
+ from {
1345
+ clip-path: inset(0 0 0 calc(100% - 8rem) round var(--canopy-radius-pill));
1346
+ }
1347
+ to {
1348
+ clip-path: inset(0 round var(--canopy-radius-pill));
1349
+ }
1289
1350
  }
1290
1351
  .canopy-header__desktop-search [data-canopy-search-form] {
1291
1352
  width: 100%;
@@ -1488,14 +1549,21 @@ section[data-footnotes] ul li,
1488
1549
  display: none;
1489
1550
  }
1490
1551
  .canopy-header__desktop-search {
1491
- display: block;
1552
+ display: flex;
1492
1553
  }
1493
1554
  .canopy-header__desktop-nav {
1494
1555
  display: flex;
1556
+ margin-inline-start: auto;
1557
+ }
1558
+ .canopy-header__desktop-search ~ .canopy-header__desktop-nav {
1559
+ margin-inline-start: 0;
1495
1560
  }
1496
1561
  .canopy-header__actions {
1497
1562
  display: flex;
1498
1563
  }
1564
+ .canopy-header__desktop-nav ~ .canopy-header__actions {
1565
+ margin-left: 0;
1566
+ }
1499
1567
  .canopy-header__search-trigger {
1500
1568
  display: none;
1501
1569
  }
@@ -1539,38 +1607,13 @@ section[data-footnotes] ul li,
1539
1607
  }
1540
1608
  .canopy-logo span {
1541
1609
  display: block;
1542
- position: relative;
1543
- isolation: isolate;
1544
1610
  min-width: 0;
1545
1611
  max-width: 100%;
1546
1612
  white-space: nowrap;
1547
1613
  overflow: hidden;
1548
1614
  text-overflow: ellipsis;
1549
- padding-bottom: 0.3em;
1550
- margin-bottom: -0.3em;
1551
1615
  line-height: 1.5;
1552
1616
  }
1553
- .canopy-logo span::after {
1554
- content: "";
1555
- position: absolute;
1556
- left: -0.04em;
1557
- right: -0.06em;
1558
- bottom: 0;
1559
- height: 0.42em;
1560
- rotate: 1.5deg;
1561
- z-index: -1;
1562
- background: linear-gradient(to right, color-mix(in srgb, var(--color-accent-600) 30%, transparent), var(--color-accent-600));
1563
- mask: var(--canopy-swoosh) center/100% 100% no-repeat;
1564
- clip-path: inset(0 100% 0 0);
1565
- }
1566
- .canopy-logo:is(:hover, :focus-visible) span::after {
1567
- clip-path: inset(0 0 0 0);
1568
- }
1569
- @media (prefers-reduced-motion: no-preference) {
1570
- .canopy-logo span::after {
1571
- transition: clip-path 480ms var(--canopy-ease);
1572
- }
1573
- }
1574
1617
  html.dark .canopy-logo svg circle.canopy-logo-backlight {
1575
1618
  fill: var(--color-accent-200) !important;
1576
1619
  color: var(--color-accent-200) !important;
@@ -1969,7 +2012,7 @@ section[data-footnotes] ul li,
1969
2012
  --hero-bg-start: var(--color-gray-50);
1970
2013
  --hero-bg-mid: var(--color-accent-50);
1971
2014
  --hero-bg-end: var(--color-accent-200);
1972
- --hero-dot-bg: var(--color-gray-muted);
2015
+ --hero-dot-bg: color-mix(in srgb, var(--color-gray-muted) var(--canopy-dot-share, 100%), transparent);
1973
2016
  --hero-dot-active-bg: var(--color-accent-default);
1974
2017
  background: linear-gradient(173deg, var(--hero-bg-start) 5rem, var(--hero-bg-mid) 61.8%, var(--hero-bg-end) 100%);
1975
2018
  min-height: var(--hero-height);
@@ -1985,6 +2028,9 @@ section[data-footnotes] ul li,
1985
2028
  flex-direction: column;
1986
2029
  min-height: var(--hero-height);
1987
2030
  width: 100%;
2031
+ max-width: var(--canopy-container-wide);
2032
+ margin-inline: auto;
2033
+ box-sizing: border-box;
1988
2034
  overflow: hidden;
1989
2035
  }
1990
2036
  .canopy-interstitial--hero .canopy-interstitial__panel {
@@ -1992,7 +2038,7 @@ section[data-footnotes] ul li,
1992
2038
  display: flex;
1993
2039
  align-items: center;
1994
2040
  justify-content: center;
1995
- padding: clamp(1.618rem, 5vw, 3rem) clamp(1.618rem, 4vw, 3rem);
2041
+ padding: clamp(1.618rem, 5vw, 3rem) 1.618rem;
1996
2042
  box-sizing: border-box;
1997
2043
  min-width: 0;
1998
2044
  }
@@ -2002,6 +2048,7 @@ section[data-footnotes] ul li,
2002
2048
  width: 100%;
2003
2049
  max-width: none;
2004
2050
  margin: 0;
2051
+ padding-inline: 0;
2005
2052
  gap: 1.5rem;
2006
2053
  }
2007
2054
  .canopy-interstitial--hero .canopy-interstitial__media-group {
@@ -2012,7 +2059,7 @@ section[data-footnotes] ul li,
2012
2059
  grid-template-columns: minmax(0, 1fr);
2013
2060
  grid-template-areas: "stage" "dots";
2014
2061
  align-content: start;
2015
- padding: clamp(1.5rem, 4vw, 3rem);
2062
+ padding: clamp(1.5rem, 4vw, 3rem) 1.618rem;
2016
2063
  box-sizing: border-box;
2017
2064
  min-width: 0;
2018
2065
  overflow: hidden;
@@ -2020,12 +2067,6 @@ section[data-footnotes] ul li,
2020
2067
  .canopy-interstitial--hero .canopy-interstitial__slider {
2021
2068
  grid-area: stage;
2022
2069
  }
2023
- .canopy-interstitial--hero .canopy-interstitial__rotation {
2024
- grid-area: stage;
2025
- align-self: start;
2026
- justify-self: start;
2027
- margin: 0.618rem;
2028
- }
2029
2070
  .canopy-interstitial--hero .canopy-interstitial__caption {
2030
2071
  position: static;
2031
2072
  margin: 1.5rem auto 0;
@@ -2130,7 +2171,7 @@ section[data-footnotes] ul li,
2130
2171
  justify-content: center;
2131
2172
  align-items: stretch;
2132
2173
  }
2133
- .canopy-interstitial__slide[hidden], .canopy-interstitial__nav[hidden], .canopy-interstitial__pagination[hidden], .canopy-interstitial__rotation[hidden] {
2174
+ .canopy-interstitial__slide[hidden], .canopy-interstitial__nav[hidden], .canopy-interstitial__pagination[hidden] {
2134
2175
  display: none;
2135
2176
  }
2136
2177
  .canopy-interstitial__slide-link {
@@ -2314,41 +2355,7 @@ section[data-footnotes] ul li,
2314
2355
  .canopy-interstitial__nav-btn:hover {
2315
2356
  background-color: var(--color-accent-hover) !important;
2316
2357
  }
2317
- .canopy-interstitial__rotation {
2318
- display: inline-flex;
2319
- align-items: center;
2320
- justify-content: center;
2321
- gap: 0.35rem;
2322
- padding: 0.25rem 0.25rem;
2323
- border: 1px solid currentColor;
2324
- border-radius: var(--canopy-radius-md);
2325
- color: inherit;
2326
- font: inherit;
2327
- text-decoration: none;
2328
- cursor: pointer;
2329
- line-height: 1.4;
2330
- transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
2331
- position: relative;
2332
- z-index: 5;
2333
- width: 2.618rem;
2334
- height: 2.618rem;
2335
- border: none;
2336
- border-radius: var(--canopy-radius-pill);
2337
- color: var(--color-gray-50);
2338
- background-color: var(--color-accent-default);
2339
- }
2340
- .canopy-interstitial__rotation:hover {
2341
- background-color: var(--color-accent-hover);
2342
- }
2343
- .canopy-interstitial__rotation svg {
2344
- display: block;
2345
- width: 1rem;
2346
- height: 1rem;
2347
- }
2348
- .canopy-interstitial__rotation[data-rotation=on] .canopy-interstitial__rotation-icon--play, .canopy-interstitial__rotation[data-rotation=off] .canopy-interstitial__rotation-icon--pause {
2349
- display: none;
2350
- }
2351
- .canopy-interstitial__rotation:focus-visible, .canopy-interstitial__nav-btn:focus-visible {
2358
+ .canopy-interstitial__nav-btn:focus-visible {
2352
2359
  outline: 2px solid var(--color-gray-50);
2353
2360
  outline-offset: -5px;
2354
2361
  }
@@ -2494,45 +2501,7 @@ section[data-footnotes] ul li,
2494
2501
  margin: 0;
2495
2502
  padding: 0 0 1rem;
2496
2503
  }
2497
- .canopy-interstitial--hero-centered .canopy-interstitial__rotation {
2498
- margin: 0.75rem;
2499
- }
2500
2504
 
2501
- @layer components {
2502
- .canopy-swoosh {
2503
- display: inline-block;
2504
- max-width: 100%;
2505
- position: relative;
2506
- isolation: isolate;
2507
- z-index: 0;
2508
- }
2509
- .canopy-swoosh::after {
2510
- content: "";
2511
- position: absolute;
2512
- bottom: -0.1em;
2513
- left: -0.04em;
2514
- right: -0.06em;
2515
- height: 0.42em;
2516
- rotate: 1.5deg;
2517
- z-index: -1;
2518
- background: linear-gradient(to right, color-mix(in srgb, var(--color-accent-600) 30%, transparent), var(--color-accent-600));
2519
- mask: var(--canopy-swoosh) center/100% 100% no-repeat;
2520
- pointer-events: none;
2521
- }
2522
- @media (prefers-reduced-motion: no-preference) {
2523
- .canopy-swoosh::after {
2524
- animation: canopy-swoosh-draw 700ms var(--canopy-ease) 300ms both;
2525
- }
2526
- }
2527
- @keyframes canopy-swoosh-draw {
2528
- from {
2529
- clip-path: inset(0 100% 0 0);
2530
- }
2531
- to {
2532
- clip-path: inset(0 0 0 0);
2533
- }
2534
- }
2535
- }
2536
2505
  @layer components {
2537
2506
  .canopy-band {
2538
2507
  --canopy-focus-color: var(--canopy-band-text);
@@ -2711,9 +2680,46 @@ section[data-footnotes] ul li,
2711
2680
  }
2712
2681
 
2713
2682
  .canopy-slider {
2714
- margin: 1.618rem 0 0;
2683
+ margin: var(--canopy-space-xl) 0 0;
2715
2684
  }
2716
2685
 
2686
+ .canopy-slider__header + [data-canopy-slider] .canopy-slider {
2687
+ margin-top: 0;
2688
+ }
2689
+
2690
+ @layer components {
2691
+ .clover-items.canopy-slider:not([data-orientation=vertical]) .clover-items-scroll-prev {
2692
+ inset-inline-start: var(--canopy-space-s);
2693
+ }
2694
+ .clover-items.canopy-slider:not([data-orientation=vertical]) .clover-items-scroll-next {
2695
+ inset-inline-end: var(--canopy-space-s);
2696
+ }
2697
+ .canopy-slider__title-link {
2698
+ color: inherit;
2699
+ text-decoration-line: underline;
2700
+ text-decoration-thickness: 1px;
2701
+ text-underline-offset: 0.15em;
2702
+ border-radius: var(--canopy-radius-sm);
2703
+ }
2704
+ .canopy-slider__title-link:hover {
2705
+ text-decoration-thickness: max(2px, 0.1em);
2706
+ }
2707
+ .canopy-slider__title-link:focus-visible {
2708
+ outline: var(--canopy-focus-width) solid var(--canopy-focus-color);
2709
+ outline-offset: var(--canopy-focus-offset);
2710
+ }
2711
+ .canopy-slider__more {
2712
+ position: absolute;
2713
+ width: 1px;
2714
+ height: 1px;
2715
+ margin: -1px;
2716
+ padding: 0;
2717
+ overflow: hidden;
2718
+ clip-path: inset(50%);
2719
+ white-space: nowrap;
2720
+ border: 0;
2721
+ }
2722
+ }
2717
2723
  .canopy-image-story.storiiies-viewer {
2718
2724
  --storiiies-viewer-container-bg: var(--color-gray-200);
2719
2725
  --storiiies-viewer-font-family: var(--default-font-family);
@@ -3844,10 +3850,73 @@ section[data-footnotes] ul li,
3844
3850
  background-color: var(--canopy-surface-raised);
3845
3851
  box-shadow: var(--canopy-card-shadow);
3846
3852
  }
3853
+ .canopy-work--primary {
3854
+ position: relative;
3855
+ }
3856
+ .canopy-work__widen {
3857
+ display: none;
3858
+ }
3859
+ @media (min-width: 961px) {
3860
+ .canopy-work__widen {
3861
+ position: absolute;
3862
+ top: 1.5rem;
3863
+ inset-inline-end: -1.125rem;
3864
+ z-index: 3;
3865
+ display: inline-flex;
3866
+ align-items: center;
3867
+ justify-content: center;
3868
+ box-sizing: border-box;
3869
+ width: 2.25rem;
3870
+ height: 2.25rem;
3871
+ padding: 0;
3872
+ border: 1px solid var(--canopy-control-edge);
3873
+ border-radius: var(--canopy-radius-pill);
3874
+ background-color: var(--canopy-surface-raised);
3875
+ color: var(--color-gray-default);
3876
+ cursor: pointer;
3877
+ }
3878
+ .canopy-work__widen:hover {
3879
+ border-color: var(--color-gray-muted);
3880
+ }
3881
+ .canopy-work__widen:focus-visible {
3882
+ outline: var(--canopy-focus-width) solid var(--canopy-focus-color);
3883
+ outline-offset: var(--canopy-focus-offset);
3884
+ }
3885
+ .canopy-work__widen svg {
3886
+ width: 1.25rem;
3887
+ height: 1.25rem;
3888
+ }
3889
+ .canopy-work__widen[aria-pressed=true] .canopy-work__widen-icon--widen,
3890
+ .canopy-work__widen[aria-pressed=false] .canopy-work__widen-icon--narrow {
3891
+ display: none;
3892
+ }
3893
+ .canopy-work--layout[data-viewer=wide] {
3894
+ flex-direction: column;
3895
+ }
3896
+ .canopy-work--layout[data-viewer=wide] > .canopy-work--primary,
3897
+ .canopy-work--layout[data-viewer=wide] > .canopy-work--secondary {
3898
+ flex-basis: auto;
3899
+ width: 100%;
3900
+ }
3901
+ }
3902
+ .canopy-work--layout[data-viewer=wide] .canopy-work--secondary dl.clover-metadata {
3903
+ --canopy-metadata-gap: var(--canopy-space-l);
3904
+ display: grid;
3905
+ grid-template-columns: repeat(auto-fill, minmax(max(min(100%, 16rem), (100% - 2 * var(--canopy-metadata-gap)) / 3), 1fr));
3906
+ column-gap: var(--canopy-metadata-gap);
3907
+ align-items: start;
3908
+ }
3847
3909
  @media (max-width: 960px) {
3848
3910
  .canopy-work--layout {
3849
3911
  flex-direction: column;
3850
3912
  }
3913
+ .canopy-work--secondary dl.clover-metadata {
3914
+ --canopy-metadata-gap: var(--canopy-space-l);
3915
+ display: grid;
3916
+ grid-template-columns: repeat(auto-fill, minmax(max(min(100%, 16rem), (100% - 2 * var(--canopy-metadata-gap)) / 3), 1fr));
3917
+ column-gap: var(--canopy-metadata-gap);
3918
+ align-items: start;
3919
+ }
3851
3920
  .canopy-work--primary,
3852
3921
  .canopy-work--secondary {
3853
3922
  flex-basis: 100%;
@@ -3865,6 +3934,9 @@ section[data-footnotes] ul li,
3865
3934
  body.canopy-type-work main dl {
3866
3935
  padding: 0;
3867
3936
  }
3937
+ body.canopy-type-work main dl.clover-metadata {
3938
+ margin-block: var(--canopy-space-l);
3939
+ }
3868
3940
  body.canopy-type-work main dl > div {
3869
3941
  display: grid;
3870
3942
  gap: 0.2rem;
@@ -13,8 +13,6 @@
13
13
  // Dark mode: the values that differ are under `:root.dark` (every dark appearance sets the
14
14
  // class), and under the system's dark scheme for `appearance: auto` before its script runs.
15
15
 
16
- $canopy-swoosh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' preserveAspectRatio='none'%3E%3Cpath d='M3 14.5c34-4.2 74-6.1 118-6.6 52-.6 107 .9 175-3.4 2.2-.1 3.6 1.6 3.4 3.4-.2 1.6-1.4 2.7-3 2.9-69 6.3-122 5.3-175 5.9-41 .5-79 2.3-115 6.5-2.4.3-4.5-1.4-4.7-3.8-.2-2.3 1.4-4.5 3.7-4.9z'/%3E%3C/svg%3E");
17
-
18
16
  @mixin canopy-dark-tokens {
19
17
  // A raised surface is lighter than the page in the dark, where a shadow does not read.
20
18
  --canopy-surface-raised: var(--color-gray-300);
@@ -74,9 +72,6 @@ $canopy-swoosh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg
74
72
  --canopy-tracking-tight: -0.02em;
75
73
  --canopy-tracking-snug: -0.01em;
76
74
  --canopy-tracking-label: 0.06em;
77
- // Reading text's longest line, a magazine column's: about 70 characters (under the
78
- // 80 WCAG 1.4.8 advises).
79
- --canopy-measure: 70ch;
80
75
 
81
76
  // ── Shape ──────────────────────────────────────────────────────────────────────
82
77
  // What sits inside a rounded thing takes a smaller step, so corners nest.
@@ -131,11 +126,6 @@ $canopy-swoosh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg
131
126
  --canopy-band-muted: color-mix(in srgb, #fff 72%, #000);
132
127
  --canopy-band-edge: transparent;
133
128
 
134
- // ── The brush stroke ───────────────────────────────────────────────────────────
135
- // A hand-drawn swoosh, used as a mask over the accent (`<Swoosh>`, the wordmark), so
136
- // it takes the site's accent whatever it is.
137
- --canopy-swoosh: #{$canopy-swoosh};
138
-
139
129
  // ── Motion ─────────────────────────────────────────────────────────────────────
140
130
  --canopy-ease: cubic-bezier(0.65, 0, 0.35, 1);
141
131
 
@@ -152,6 +142,12 @@ $canopy-swoosh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg
152
142
  --canopy-space-xl: 2.618rem;
153
143
  --canopy-space-2xl: 4.236rem;
154
144
 
145
+ // The page's columns: a page's own (`<Container>`, `max-w-content`) and a wide one for
146
+ // sections side by side (`variant="wide"`, `max-w-wide`, the featured hero's). Wider in
147
+ // 2.0.2 (1080 and 1300px before), so a wide window keeps less of itself empty.
148
+ --canopy-container-content: 75rem;
149
+ --canopy-container-wide: 90rem;
150
+
155
151
  // ── Layout ─────────────────────────────────────────────────────────────────────
156
152
  // How far down the window what sticks must stand to clear the sticky header: 4rem
157
153
  // while the header sticks (`header/_header.scss`), none otherwise.
@@ -94,6 +94,39 @@
94
94
  transition: color 150ms cubic-bezier(0.22, 1, 0.36, 1);
95
95
  }
96
96
 
97
+ /*
98
+ * The card's ring and shadow reach past the room Clover leaves around its items for
99
+ * their focus rings (`--clover-items-ring-room`), and the track, a scroll box, clipped
100
+ * them at its edges. The track takes more room and gives it back as margin, so the
101
+ * cards stay where they were: a rem above and below, for the whole shadow, and a pixel
102
+ * at the sides, for the ring of the cards at either end. No more, so nothing of a card
103
+ * scrolled out of view shows past the column's edge.
104
+ */
105
+ .canopy-slider {
106
+ --canopy-card-room-block: 1rem;
107
+ --canopy-card-room-inline: 1px;
108
+ }
109
+
110
+ .canopy-slider .clover-items-viewport {
111
+ margin-block: calc(-1 * (var(--clover-items-ring-room) + var(--canopy-card-room-block)));
112
+ margin-inline: calc(-1 * (var(--clover-items-ring-room) + var(--canopy-card-room-inline)));
113
+ padding-block: calc(var(--clover-items-ring-room) + var(--canopy-card-room-block));
114
+ padding-inline: calc(
115
+ var(--clover-items-ring-room) + var(--clover-items-inset, 0px) +
116
+ var(--canopy-card-room-inline)
117
+ );
118
+ scroll-padding-inline: calc(
119
+ var(--clover-items-ring-room) + var(--clover-items-inset, 0px) +
120
+ var(--canopy-card-room-inline)
121
+ );
122
+ }
123
+
124
+ /* Clover's shades at the track's ends, that show it scrolls: the cards' own edges do. */
125
+ .canopy-slider .clover-items-frame::before,
126
+ .canopy-slider .clover-items-frame::after {
127
+ content: none;
128
+ }
129
+
97
130
  /*
98
131
  * 1.x `figcaption` and its `span`: the card's caption, padded, in the text's color, the
99
132
  * accent while its card is pointed at or focused. Its three lines are Clover 4's own
@@ -243,6 +243,30 @@ function accentHoverCss(scale, appearance) {
243
243
  )}%, ${far})`;
244
244
  }
245
245
 
246
+ // A slide button's dot over the hero's ground (`_interstitial-hero.scss`, `--hero-dot-bg`):
247
+ // the muted gray at 80%, the ground showing through (Mat, 2026-11-18: "more translucent"),
248
+ // or as much nearer solid as this theme needs to hold 3:1 on the darkest of that ground,
249
+ // accent 200 (WCAG 1.4.11). A browser lays a translucent color over what is under it in
250
+ // sRGB, so this mixes there too. A black accent, whose 200 is a mid gray, needs 95%.
251
+ const DOT_SHARE = 0.8;
252
+ const NON_TEXT_CONTRAST = 3;
253
+ function srgbOver(fg, bg, share) {
254
+ const channels = (hex) => [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16));
255
+ const [x, y] = [channels(normalizeHex(fg)), channels(normalizeHex(bg))];
256
+ return `#${x
257
+ .map((v, i) => Math.round(v * share + y[i] * (1 - share)).toString(16).padStart(2, "0"))
258
+ .join("")}`;
259
+ }
260
+ function dotShare(brandScale, grayScale) {
261
+ const ground = brandScale && brandScale["200"];
262
+ const dot = grayScale && grayScale["800"];
263
+ if (!ground || !dot) return 1;
264
+ for (let pct = Math.round(DOT_SHARE * 100); pct < 100; pct += 1) {
265
+ if (contrast(srgbOver(dot, ground, pct / 100), ground) >= NON_TEXT_CONTRAST) return pct / 100;
266
+ }
267
+ return 1;
268
+ }
269
+
246
270
  function buildVariablesMap(brandScale, grayScale, options = {}) {
247
271
  const appearance = scaleAppearance(options.appearance);
248
272
  const vars = {};
@@ -264,6 +288,9 @@ function buildVariablesMap(brandScale, grayScale, options = {}) {
264
288
  if (grayScale["900"]) vars["--color-gray-default"] = grayScale["900"];
265
289
  if (grayScale["800"]) vars["--color-gray-muted"] = grayScale["800"];
266
290
  }
291
+ if (brandScale && grayScale) {
292
+ vars["--canopy-dot-share"] = `${Math.round(dotShare(brandScale, grayScale) * 100)}%`;
293
+ }
267
294
  if (brandScale) {
268
295
  for (const [prop, token] of Object.entries(CLOVER_ACCENT_TOKENS)) {
269
296
  vars[prop] = `var(${token})`;
@@ -325,6 +352,8 @@ module.exports = {
325
352
  accentHover,
326
353
  accentHoverCss,
327
354
  appearanceVariablesToCss,
355
+ dotShare,
356
+ srgbOver,
328
357
  contrast,
329
358
  normalizePaletteName,
330
359
  normalizeAccentName,
package/ui/theme.js CHANGED
@@ -12,8 +12,9 @@ const {
12
12
  variablesToCss,
13
13
  } = require("./theme-palette");
14
14
 
15
- const DEFAULT_ACCENT = "indigo";
16
- const DEFAULT_GRAY = "slate";
15
+ // A site that names no colors: gold on sand (Mat, 2026-11-18; indigo on slate until 2.0.2).
16
+ const DEFAULT_ACCENT = "gold";
17
+ const DEFAULT_GRAY = "sand";
17
18
  const DEBUG_FLAG_RAW = String(process.env.CANOPY_DEBUG_THEME || "");
18
19
  const DEBUG_ENABLED = /^(1|true|yes|on)$/i.test(DEBUG_FLAG_RAW.trim());
19
20
 
@@ -140,6 +141,8 @@ function loadCanopyTheme(options = {}) {
140
141
  }
141
142
 
142
143
  module.exports = {
144
+ DEFAULT_ACCENT,
145
+ DEFAULT_GRAY,
143
146
  loadCanopyTheme,
144
147
  toTailwindScale,
145
148
  normalizeAccentName,
@@ -1,50 +0,0 @@
1
- // `<Swoosh>`: the brush stroke under its words, after Clover's homepage. An SVG shape
2
- // (`--canopy-swoosh`) used as a mask over the accent's solid step, faint where the pen
3
- // comes down and full where it lifts, so it takes the site's accent whatever it is. It
4
- // sits behind the letters, at their foot, so they read over it, and it rises a little to
5
- // the right. Drawn in once from the left as the page loads; at once where motion is
6
- // reduced. An inline block, so a phrase wider than the line wraps inside it rather than
7
- // push the page sideways (1.4.10), the stroke under its last line.
8
- @layer components {
9
- .canopy-swoosh {
10
- display: inline-block;
11
- max-width: 100%;
12
- position: relative;
13
- isolation: isolate;
14
- z-index: 0;
15
- }
16
-
17
- .canopy-swoosh::after {
18
- content: "";
19
- position: absolute;
20
- bottom: -0.1em;
21
- left: -0.04em;
22
- right: -0.06em;
23
- height: 0.42em;
24
- rotate: 1.5deg;
25
- z-index: -1;
26
- background: linear-gradient(
27
- to right,
28
- color-mix(in srgb, var(--color-accent-600) 30%, transparent),
29
- var(--color-accent-600)
30
- );
31
- mask: var(--canopy-swoosh) center / 100% 100% no-repeat;
32
- pointer-events: none;
33
- }
34
-
35
- @media (prefers-reduced-motion: no-preference) {
36
- .canopy-swoosh::after {
37
- animation: canopy-swoosh-draw 700ms var(--canopy-ease) 300ms both;
38
- }
39
- }
40
-
41
- @keyframes canopy-swoosh-draw {
42
- from {
43
- clip-path: inset(0 100% 0 0);
44
- }
45
-
46
- to {
47
- clip-path: inset(0 0 0 0);
48
- }
49
- }
50
- }