@canopy-iiif/app 0.8.3 → 0.8.5

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.
Files changed (36) hide show
  1. package/lib/build/build.js +2 -0
  2. package/lib/build/dev.js +38 -22
  3. package/lib/build/iiif.js +359 -83
  4. package/lib/build/mdx.js +12 -2
  5. package/lib/build/pages.js +15 -1
  6. package/lib/build/styles.js +53 -1
  7. package/lib/common.js +28 -6
  8. package/lib/components/navigation.js +308 -0
  9. package/lib/page-context.js +14 -0
  10. package/lib/search/search-app.jsx +177 -25
  11. package/lib/search/search-form-runtime.js +126 -19
  12. package/lib/search/search.js +130 -18
  13. package/package.json +4 -1
  14. package/ui/dist/index.mjs +204 -101
  15. package/ui/dist/index.mjs.map +4 -4
  16. package/ui/dist/server.mjs +167 -59
  17. package/ui/dist/server.mjs.map +4 -4
  18. package/ui/styles/_variables.scss +1 -0
  19. package/ui/styles/base/_common.scss +27 -5
  20. package/ui/styles/base/_heading.scss +2 -4
  21. package/ui/styles/base/index.scss +1 -0
  22. package/ui/styles/components/_card.scss +47 -4
  23. package/ui/styles/components/_sub-navigation.scss +76 -0
  24. package/ui/styles/components/header/_header.scss +1 -4
  25. package/ui/styles/components/header/_logo.scss +33 -10
  26. package/ui/styles/components/index.scss +1 -0
  27. package/ui/styles/components/search/_filters.scss +5 -7
  28. package/ui/styles/components/search/_form.scss +55 -17
  29. package/ui/styles/components/search/_results.scss +49 -14
  30. package/ui/styles/index.css +344 -56
  31. package/ui/styles/index.scss +2 -4
  32. package/ui/tailwind-canopy-iiif-plugin.js +10 -2
  33. package/ui/tailwind-canopy-iiif-preset.js +21 -19
  34. package/ui/theme.js +303 -0
  35. package/ui/styles/variables.emit.scss +0 -72
  36. package/ui/styles/variables.scss +0 -76
@@ -1,20 +1,121 @@
1
+ /* canopy-theme */
2
+ @layer properties {
3
+ :root {
4
+ --max-w-content: 1080px;
5
+ --color-brand-50: #fdfdfe;
6
+ --color-brand-100: #edf2fe;
7
+ --color-brand-200: #d2deff;
8
+ --color-brand-300: #abbdf9;
9
+ --color-brand-400: #8da4ef;
10
+ --color-brand-500: #3e63dd;
11
+ --color-brand-600: #3358d4;
12
+ --color-brand-700: #3a5bc7;
13
+ --color-brand-800: #1f2d5c;
14
+ --color-brand-900: #1a264e;
15
+ --color-brand-default: #3358d4;
16
+ --color-gray-50: #fcfcfd;
17
+ --color-gray-100: #f0f0f3;
18
+ --color-gray-200: #e0e1e6;
19
+ --color-gray-300: #cdced6;
20
+ --color-gray-400: #b9bbc6;
21
+ --color-gray-500: #8b8d98;
22
+ --color-gray-600: #80838d;
23
+ --color-gray-700: #60646c;
24
+ --color-gray-800: #1c2024;
25
+ --color-gray-900: #181b1f;
26
+ --color-gray-default: #181b1f;
27
+ --color-gray-muted: #80838d;
28
+ --colors-accent: #3358d4 !important;
29
+ --colors-accentAlt: #1f2d5c !important;
30
+ --colors-accentMuted: #8da4ef !important;
31
+ --colors-primary: #181b1f !important;
32
+ --colors-primaryAlt: #181b1f !important;
33
+ --colors-primaryMuted: #181b1f !important;
34
+ --colors-secondary: #fcfcfd !important;
35
+ --colors-secondaryAlt: #fcfcfd !important;
36
+ --colors-secondaryMuted: #fcfcfd !important;
37
+ color-scheme: light;
38
+ }
39
+ :host {
40
+ --max-w-content: 1080px;
41
+ --color-brand-50: #fdfdfe;
42
+ --color-brand-100: #edf2fe;
43
+ --color-brand-200: #d2deff;
44
+ --color-brand-300: #abbdf9;
45
+ --color-brand-400: #8da4ef;
46
+ --color-brand-500: #3e63dd;
47
+ --color-brand-600: #3358d4;
48
+ --color-brand-700: #3a5bc7;
49
+ --color-brand-800: #1f2d5c;
50
+ --color-brand-900: #1a264e;
51
+ --color-brand-default: #3358d4;
52
+ --color-gray-50: #fcfcfd;
53
+ --color-gray-100: #f0f0f3;
54
+ --color-gray-200: #e0e1e6;
55
+ --color-gray-300: #cdced6;
56
+ --color-gray-400: #b9bbc6;
57
+ --color-gray-500: #8b8d98;
58
+ --color-gray-600: #80838d;
59
+ --color-gray-700: #60646c;
60
+ --color-gray-800: #1c2024;
61
+ --color-gray-900: #181b1f;
62
+ --color-gray-default: #181b1f;
63
+ --color-gray-muted: #80838d;
64
+ --colors-accent: #3358d4 !important;
65
+ --colors-accentAlt: #1f2d5c !important;
66
+ --colors-accentMuted: #8da4ef !important;
67
+ --colors-primary: #181b1f !important;
68
+ --colors-primaryAlt: #181b1f !important;
69
+ --colors-primaryMuted: #181b1f !important;
70
+ --colors-secondary: #fcfcfd !important;
71
+ --colors-secondaryAlt: #fcfcfd !important;
72
+ --colors-secondaryMuted: #fcfcfd !important;
73
+ color-scheme: light;
74
+ }
75
+ }
76
+ /* canopy-theme:end */
1
77
  html,
2
78
  body {
3
79
  margin: 0;
4
80
  padding: 0;
5
- font-family: "DM Sans", "-apple-system", "Segoe UI", Roboto, Ubuntu, Helvetica, Arial, sans-serif;
81
+ background: var(--color-gray-50);
82
+ color: var(--color-gray-900);
83
+ }
84
+
85
+ p {
86
+ line-height: 1.55;
87
+ }
88
+
89
+ ol,
90
+ ul {
91
+ padding-left: 1.5rem;
92
+ }
93
+ ol li,
94
+ ul li {
95
+ margin-bottom: 0.25rem;
6
96
  }
7
97
 
8
98
  a {
9
99
  text-decoration: none;
10
- color: #3358d4;
100
+ color: var(--color-brand-default);
11
101
  }
12
102
  a:hover {
13
103
  text-decoration: underline;
14
104
  }
15
105
 
106
+ input,
107
+ textarea,
108
+ select,
109
+ button {
110
+ font-family: inherit;
111
+ }
112
+
113
+ ::selection {
114
+ background-color: var(--color-brand-200);
115
+ }
116
+
16
117
  h1 {
17
- font-family: "DM Serif Display", Georgia, "Times New Roman", serif;
118
+ font-family: var(--font-serif);
18
119
  font-size: 2.618rem;
19
120
  line-height: 1.25;
20
121
  margin: 0 0 1rem 0;
@@ -22,7 +123,7 @@ h1 {
22
123
  }
23
124
 
24
125
  h2 {
25
- font-family: "DM Serif Display", Georgia, "Times New Roman", serif;
126
+ font-family: var(--font-serif);
26
127
  font-size: 1.618rem;
27
128
  line-height: 1.25;
28
129
  margin: 0 0 0.618rem 0;
@@ -30,63 +131,96 @@ h2 {
30
131
  }
31
132
 
32
133
  /* Canopy Card component styles */
33
- .canopy-card {
134
+ .canopy-card, .canopy-annotation-card {
34
135
  display: block;
35
136
  text-decoration: none;
36
137
  color: inherit;
37
- border: 1px solid rgb(230, 231, 234); /* slate-200 */
138
+ border: 1px solid var(--color-gray-200);
38
139
  border-radius: 0.5rem;
39
140
  overflow: hidden;
40
141
  transition: all 150ms cubic-bezier(0.22, 1, 0.36, 1);
41
142
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.05);
42
143
  }
43
- .canopy-card figure {
144
+ .canopy-card figure, .canopy-annotation-card figure {
44
145
  margin: 0;
45
146
  }
46
- .canopy-card .canopy-card-media {
147
+ .canopy-card .canopy-card-media, .canopy-annotation-card .canopy-card-media {
47
148
  position: relative;
48
149
  width: 100%;
49
150
  padding-bottom: var(--canopy-card-padding, 100%);
50
151
  background-color: rgb(229, 231, 235); /* slate-200 */
51
152
  overflow: hidden;
52
153
  }
53
- .canopy-card .canopy-card-media > img {
154
+ .canopy-card .canopy-card-media > img, .canopy-annotation-card .canopy-card-media > img {
54
155
  position: absolute;
55
156
  inset: 0;
56
157
  width: 100%;
57
158
  height: 100%;
58
159
  object-fit: cover;
59
- display: block;
160
+ display: flex;
161
+ justify-content: center;
162
+ text-align: center;
163
+ flex-direction: column;
60
164
  opacity: 0;
61
165
  transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1);
166
+ background: var(--color-gray-100);
167
+ color: var(--color-gray-600);
168
+ font-size: 83.333%;
62
169
  }
63
- .canopy-card[data-image-loaded=true] .canopy-card-media > img {
170
+ .canopy-card[data-image-loaded=true] .canopy-card-media > img, [data-image-loaded=true].canopy-annotation-card .canopy-card-media > img {
64
171
  opacity: 1;
65
172
  }
66
- .canopy-card .canopy-card-image {
173
+ .canopy-card .canopy-card-image, .canopy-annotation-card .canopy-card-image {
67
174
  display: block;
68
175
  width: 100%;
69
176
  height: auto;
70
177
  opacity: 0;
71
178
  transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1);
72
179
  }
73
- .canopy-card[data-image-loaded=true] .canopy-card-image {
180
+ .canopy-card[data-image-loaded=true] .canopy-card-image, [data-image-loaded=true].canopy-annotation-card .canopy-card-image {
74
181
  opacity: 1;
75
182
  }
76
- .canopy-card figcaption {
183
+ .canopy-card figcaption, .canopy-annotation-card figcaption {
77
184
  padding: 1rem;
78
185
  }
79
- .canopy-card figcaption > span:first-child {
186
+ .canopy-card figcaption > span:first-child, .canopy-annotation-card figcaption > span:first-child {
80
187
  display: block;
81
188
  }
82
- .canopy-card figcaption > span + span {
189
+ .canopy-card figcaption > span + span, .canopy-annotation-card figcaption > span + span {
83
190
  display: block;
84
191
  }
85
- .canopy-card:hover, .canopy-card:focus {
192
+ .canopy-card:hover, .canopy-annotation-card:hover, .canopy-card:focus, .canopy-annotation-card:focus {
86
193
  color: var(--color-brand-default);
87
194
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.07), 0 1px 2px 0 rgba(0, 0, 0, 0.07);
88
195
  }
89
196
 
197
+ .canopy-annotation-card {
198
+ padding: 1rem;
199
+ }
200
+ .canopy-annotation-card mark {
201
+ color: var(--color-gray-900);
202
+ background-color: var(--color-brand-300);
203
+ padding: 0.1rem 0.25rem;
204
+ border-radius: 0.25rem;
205
+ margin: 0 -0.25rem;
206
+ }
207
+ .canopy-annotation-card mark mark::before,
208
+ .canopy-annotation-card mark mark::after {
209
+ clip-path: inset(100%);
210
+ clip: rect(1px, 1px, 1px, 1px);
211
+ height: 1px;
212
+ overflow: hidden;
213
+ position: absolute;
214
+ white-space: nowrap;
215
+ width: 1px;
216
+ }
217
+ .canopy-annotation-card mark mark::before {
218
+ content: " [highlight start] ";
219
+ }
220
+ .canopy-annotation-card mark mark::after {
221
+ content: " [highlight end] ";
222
+ }
223
+
90
224
  @layer components {
91
225
  .canopy-header {
92
226
  display: flex;
@@ -94,25 +228,42 @@ h2 {
94
228
  align-items: center;
95
229
  gap: 1.618rem;
96
230
  padding: 0.618rem 1rem;
97
- box-shadow: 5px 5px 19px rgba(0, 0, 0, 0.2);
98
- background: #fff;
231
+ background: var(--color-gray-50);
99
232
  }
100
233
  }
101
- .canopy-logo {
234
+ a.canopy-logo {
102
235
  display: flex;
103
236
  align-items: center;
104
237
  gap: 0.618rem;
105
- font-weight: 400;
106
- font-size: 1.618rem;
107
- font-family: "DM Serif Display", Georgia, "Times New Roman", serif;
108
- color: #121418;
238
+ font-weight: 600;
239
+ font-size: 1.382rem;
240
+ font-family: var(--font-serif);
241
+ color: var(--color-gray-default) !important;
242
+ letter-spacing: -0.025em;
243
+ }
244
+ a.canopy-logo:hover {
245
+ text-decoration: none;
109
246
  }
110
- .canopy-logo img {
247
+ a.canopy-logo svg {
111
248
  height: 1.618rem;
112
249
  margin-bottom: -1px;
113
250
  }
114
- .canopy-logo:hover {
115
- text-decoration: none;
251
+ a.canopy-logo svg circle.canopy-logo-backlight {
252
+ fill: var(--color-brand-900);
253
+ color: var(--color-brand-900);
254
+ }
255
+ a.canopy-logo svg path.canopy-logo-overlay {
256
+ fill: var(--color-brand-default);
257
+ color: var(--color-brand-default);
258
+ }
259
+
260
+ html.dark a.canopy-logo svg circle.canopy-logo-backlight {
261
+ fill: var(--color-brand-200) !important;
262
+ color: var(--color-brand-200) !important;
263
+ }
264
+ html.dark a.canopy-logo svg path.canopy-logo-overlay {
265
+ fill: var(--color-brand-500) !important;
266
+ color: var(--color-brand-500) !important;
116
267
  }
117
268
 
118
269
  .canopy-navbar {
@@ -155,7 +306,7 @@ h2 {
155
306
  --search-form-label-padding-y: 0.625rem;
156
307
  position: relative;
157
308
  backdrop-filter: blur(12px);
158
- background-color: color-mix(in srgb, #fff 95%, transparent);
309
+ background-color: color-mix(in srgb, var(--color-gray-100, #f0f0f3) 95%, transparent);
159
310
  transition: box-shadow var(--duration-fast, 150ms) ease, background-color var(--duration-fast, 150ms) ease;
160
311
  cursor: text;
161
312
  padding-right: 0.4rem;
@@ -178,8 +329,13 @@ h2 {
178
329
  .canopy-search-form-shell:hover {
179
330
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06));
180
331
  }
181
- .canopy-search-form-shell:focus-within::after, .canopy-search-form-shell[data-has-value="1"]::after {
182
- opacity: 0;
332
+ .canopy-search-form-shell svg {
333
+ width: 1.25rem;
334
+ height: 1.25rem;
335
+ flex-shrink: 0;
336
+ fill: var(--color-gray-400, #b9bbc6);
337
+ pointer-events: none;
338
+ transition: fill var(--duration-fast, 150ms) var(--easing-standard, ease);
183
339
  }
184
340
  .canopy-search-form-shell input[data-canopy-search-form-input] {
185
341
  width: 100%;
@@ -187,11 +343,20 @@ h2 {
187
343
  outline: none;
188
344
  background: transparent;
189
345
  box-shadow: none;
190
- opacity: 0;
191
346
  caret-color: transparent;
192
347
  transition: opacity var(--duration-fast, 150ms) ease;
193
348
  }
194
- .canopy-search-form-shell:focus-within input[data-canopy-search-form-input], .canopy-search-form-shell[data-has-value="1"] input[data-canopy-search-form-input] {
349
+ .canopy-search-form-shell:focus-within {
350
+ background-color: var(--color-brand-100);
351
+ }
352
+ .canopy-search-form-shell:focus-within input[data-canopy-search-form-input] {
353
+ opacity: 1;
354
+ caret-color: var(--color-gray-900, #121418);
355
+ }
356
+ .canopy-search-form-shell:focus-within svg {
357
+ fill: var(--color-brand-default, #3e63dd);
358
+ }
359
+ .canopy-search-form-shell[data-has-value="1"] input[data-canopy-search-form-input] {
195
360
  opacity: 1;
196
361
  caret-color: var(--color-gray-900, #121418);
197
362
  }
@@ -227,14 +392,28 @@ h2 {
227
392
  padding: var(--search-form-label-padding-y) var(--search-form-label-padding-x);
228
393
  }
229
394
 
230
- .canopy-search-form__icon {
231
- width: 1.25rem;
232
- height: 1.25rem;
233
- flex-shrink: 0;
234
- color: var(--color-gray-400, #b9bbc6);
235
- pointer-events: none;
395
+ .canopy-search-form__clear {
396
+ border: 0;
397
+ background: transparent;
398
+ color: rgba(100, 116, 139, 0.9);
399
+ font-size: 1.25rem;
400
+ line-height: 1;
401
+ padding: 0 0.25rem;
402
+ margin-right: 0.25rem;
403
+ display: inline-flex;
404
+ align-items: center;
405
+ justify-content: center;
406
+ cursor: pointer;
236
407
  transition: color var(--duration-fast, 150ms) var(--easing-standard, ease);
237
408
  }
409
+ .canopy-search-form__clear:hover, .canopy-search-form__clear:focus-visible {
410
+ color: var(--color-brand-600, #3e63dd);
411
+ }
412
+ .canopy-search-form__clear:focus-visible {
413
+ outline: none;
414
+ box-shadow: 0 0 0 2px var(--color-gray-100, #ffffff), 0 0 0 4px color-mix(in srgb, var(--color-brand-500, #3e63dd) 65%, transparent);
415
+ border-radius: 999px;
416
+ }
238
417
 
239
418
  .canopy-search-form__input {
240
419
  flex: 1;
@@ -257,8 +436,9 @@ h2 {
257
436
  align-items: center;
258
437
  gap: 0.382rem;
259
438
  border-radius: 0.382rem;
439
+ margin-right: 1px;
260
440
  border: 0;
261
- background: #3358d4;
441
+ background: var(--color-brand-default);
262
442
  color: #fff;
263
443
  font-weight: 400;
264
444
  font-size: 1rem;
@@ -267,12 +447,12 @@ h2 {
267
447
  cursor: pointer;
268
448
  }
269
449
  .canopy-search-form__submit:hover, .canopy-search-form__submit:focus-visible {
270
- background: #243c94;
450
+ background: var(--color-brand-800);
271
451
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
272
452
  }
273
453
  .canopy-search-form__submit:focus-visible {
274
454
  outline: none;
275
- box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--color-brand-500, #3e63dd) 65%, transparent);
455
+ box-shadow: 0 0 0 2px var(--color-gray-100, #ffffff), 0 0 0 4px color-mix(in srgb, var(--color-brand-500, #3e63dd) 65%, transparent);
276
456
  }
277
457
  .canopy-search-form__submit:active {
278
458
  transform: translateY(1px);
@@ -284,14 +464,47 @@ h2 {
284
464
  opacity: 0.7;
285
465
  }
286
466
 
467
+ .canopy-search-tabs-wrapper {
468
+ display: flex;
469
+ flex-wrap: wrap;
470
+ align-items: center;
471
+ justify-content: space-between;
472
+ }
473
+
474
+ .canopy-search-results {
475
+ padding: 1.618rem;
476
+ }
477
+
478
+ .canopy-search-tabs {
479
+ display: flex;
480
+ align-items: center;
481
+ gap: 0.5rem;
482
+ margin-bottom: 1rem;
483
+ }
484
+ .canopy-search-tabs button {
485
+ background: none;
486
+ border: none;
487
+ padding: 0.382rem 0.618rem;
488
+ font-size: 1rem;
489
+ cursor: pointer;
490
+ color: var(--color-gray-600);
491
+ transition: all 0.2s ease-in-out;
492
+ }
493
+ .canopy-search-tabs button.active, .canopy-search-tabs button:hover {
494
+ color: var(--color-brand-default);
495
+ background-color: var(--color-brand-100);
496
+ border-radius: 0.382rem;
497
+ font-weight: 400;
498
+ }
499
+
287
500
  .canopy-search-form-modal .canopy-search-form-modal__trigger {
288
501
  display: inline-flex;
289
502
  align-items: center;
290
503
  gap: 0.25rem;
291
504
  padding: 0.25rem 0.5rem;
292
- border: 1px solid #e5e7eb;
293
- color: #374151;
294
- background: #fff;
505
+ border: 1px solid var(--color-gray-200, #e5e7eb);
506
+ color: var(--color-gray-700, #374151);
507
+ background: var(--color-gray-100, #ffffff);
295
508
  border-radius: 6px;
296
509
  cursor: pointer;
297
510
  }
@@ -307,7 +520,7 @@ h2 {
307
520
  }
308
521
  .canopy-search-form-modal .canopy-search-form-modal__panel {
309
522
  position: relative;
310
- background: #fff;
523
+ background: var(--color-gray-100, #ffffff);
311
524
  min-width: 320px;
312
525
  max-width: 720px;
313
526
  width: 90%;
@@ -320,20 +533,20 @@ h2 {
320
533
  position: absolute;
321
534
  top: 8px;
322
535
  right: 8px;
323
- border: 1px solid #e5e7eb;
324
- background: #fff;
536
+ border: 1px solid var(--color-gray-200, #e5e7eb);
537
+ background: var(--color-gray-100, #ffffff);
325
538
  border-radius: 6px;
326
539
  padding: 2px 6px;
327
540
  cursor: pointer;
328
541
  }
329
542
  .canopy-search-form-modal .canopy-search-form-modal__inputWrap {
330
543
  padding: 10px 12px;
331
- border-bottom: 1px solid #e5e7eb;
544
+ border-bottom: 1px solid var(--color-gray-200, #e5e7eb);
332
545
  }
333
546
  .canopy-search-form-modal .canopy-search-form-modal__input {
334
547
  width: 100%;
335
548
  padding: 8px 10px;
336
- border: 1px solid #e5e7eb;
549
+ border: 1px solid var(--color-gray-200, #e5e7eb);
337
550
  border-radius: 6px;
338
551
  outline: none;
339
552
  }
@@ -369,8 +582,8 @@ h2 {
369
582
  left: 0;
370
583
  right: 0;
371
584
  top: calc(100% + 4px);
372
- background: #fff;
373
- border: 1px solid #e5e7eb;
585
+ background: var(--color-gray-100, #ffffff);
586
+ border: 1px solid var(--color-gray-200, #e5e7eb);
374
587
  border-radius: 8px;
375
588
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
376
589
  z-index: 1000;
@@ -401,7 +614,7 @@ h2 {
401
614
  max-width: 48rem;
402
615
  overflow: hidden;
403
616
  border-radius: 0.75rem;
404
- background: #fff;
617
+ background: var(--color-gray-100, #ffffff);
405
618
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.4), 0 10px 20px rgba(15, 23, 42, 0.12);
406
619
  display: flex;
407
620
  flex-direction: column;
@@ -471,7 +684,7 @@ h2 {
471
684
  overflow: hidden;
472
685
  }
473
686
  .canopy-search-filters__facet[open] {
474
- background: #fff;
687
+ background: var(--color-gray-100, #ffffff);
475
688
  }
476
689
 
477
690
  .canopy-search-filters__facet-summary {
@@ -499,7 +712,7 @@ h2 {
499
712
 
500
713
  .canopy-search-filters__facet-content {
501
714
  border-top: 1px solid var(--color-gray-200, #e0e1e6);
502
- background: #fff;
715
+ background: var(--color-gray-100, #ffffff);
503
716
  padding: 1rem;
504
717
  max-height: 15rem;
505
718
  overflow-y: auto;
@@ -534,7 +747,7 @@ h2 {
534
747
  padding: 0.25rem 0.5rem;
535
748
  font-size: var(--font-size-xs, 0.75rem);
536
749
  color: var(--color-gray-600, #80838d);
537
- background: #fff;
750
+ background: var(--color-gray-100, #ffffff);
538
751
  transition: background-color var(--duration-fast, 150ms) var(--easing-standard, ease), color var(--duration-fast, 150ms) var(--easing-standard, ease);
539
752
  }
540
753
  .canopy-search-filters__quick-clear:hover {
@@ -610,7 +823,7 @@ h2 {
610
823
 
611
824
  .canopy-search-filters__button--secondary {
612
825
  border: 1px solid var(--color-gray-200, #e0e1e6);
613
- background: #fff;
826
+ background: var(--color-gray-100, #ffffff);
614
827
  color: var(--color-gray-600, #80838d);
615
828
  }
616
829
  .canopy-search-filters__button--secondary:hover:not([disabled]) {
@@ -631,4 +844,79 @@ h2 {
631
844
  .canopy-search-filters__button--primary:hover {
632
845
  background: var(--color-brand-700, #2c4bbd);
633
846
  box-shadow: var(--shadow-md, 0 4px 6px rgba(0, 0, 0, 0.1));
847
+ }
848
+
849
+ .canopy-sub-navigation {
850
+ font-size: 0.95rem;
851
+ color: inherit;
852
+ }
853
+
854
+ .canopy-sub-navigation__heading {
855
+ font-weight: 600;
856
+ margin-bottom: 0.5rem;
857
+ }
858
+
859
+ .canopy-sub-navigation__list {
860
+ list-style: none;
861
+ margin: 0;
862
+ padding: 0;
863
+ }
864
+
865
+ .canopy-sub-navigation__item {
866
+ margin: 0;
867
+ padding: 0;
868
+ }
869
+
870
+ .canopy-sub-navigation__link {
871
+ display: block;
872
+ padding: 0.35rem 0.5rem;
873
+ border-radius: 0.375rem;
874
+ color: inherit;
875
+ text-decoration: none;
876
+ cursor: pointer;
877
+ transition: background-color 120ms ease, color 120ms ease;
878
+ }
879
+
880
+ .canopy-sub-navigation__link:hover {
881
+ color: var(--color-brand-default);
882
+ }
883
+
884
+ .canopy-sub-navigation__link.is-label {
885
+ cursor: default;
886
+ color: var(--color-gray-600, #52525b);
887
+ }
888
+
889
+ .canopy-sub-navigation__link.is-active {
890
+ color: var(--color-gray-900, #1d4ed8);
891
+ font-weight: 600;
892
+ }
893
+
894
+ .canopy-sub-navigation__list--nested {
895
+ margin: 0.35rem 0 0.35rem 0.5rem;
896
+ padding-left: 0.5rem;
897
+ border-left: 1px solid var(--color-gray-100, #e4e4e7);
898
+ }
899
+
900
+ .canopy-sub-navigation__link.depth-0 {
901
+ padding-left: 0.25rem;
902
+ }
903
+
904
+ .canopy-sub-navigation__link.depth-1 {
905
+ padding-left: 0.25rem;
906
+ }
907
+
908
+ .canopy-sub-navigation__link.depth-2 {
909
+ padding-left: 0.5rem;
910
+ }
911
+
912
+ .canopy-sub-navigation__link.depth-3 {
913
+ padding-left: 0.75rem;
914
+ }
915
+
916
+ .canopy-sub-navigation__link.depth-4 {
917
+ padding-left: 1rem;
918
+ }
919
+
920
+ .canopy-sub-navigation__link.depth-5 {
921
+ padding-left: 1.25rem;
634
922
  }
@@ -1,4 +1,2 @@
1
- @use './variables' as *;
2
- @use './base';
3
- @use './components';
4
-
1
+ @use "./base";
2
+ @use "./components";
@@ -6,13 +6,21 @@
6
6
  * their Tailwind config.
7
7
  */
8
8
  const plugin = require("tailwindcss/plugin");
9
- const fs = require("fs");
10
9
  const path = require("path");
10
+ const { loadCanopyTheme } = require("./theme");
11
11
 
12
12
  function compileScss(filePath) {
13
13
  try {
14
14
  const sass = require("sass");
15
- const out = sass.compile(filePath, { style: "expanded" });
15
+ const theme = loadCanopyTheme();
16
+ const stylesRoot = path.join(__dirname, "styles");
17
+ const loadPaths = [stylesRoot];
18
+ const relModule = path
19
+ .relative(stylesRoot, filePath)
20
+ .replace(/\\/g, "/")
21
+ .replace(/\.scss$/i, "");
22
+ const source = `${theme && theme.sassConfig ? theme.sassConfig : ""}@use '${relModule}';`;
23
+ const out = sass.compileString(source, { style: "expanded", loadPaths });
16
24
  return out && out.css ? out.css : "";
17
25
  } catch (e) {
18
26
  const message = e && e.message ? e.message : e;