@nulib/canopy 0.0.0 → 2.0.1
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/bin/canopy.js +16 -0
- package/lib/AGENTS.md +107 -0
- package/lib/base-path.js +67 -0
- package/lib/build/appearance.js +76 -0
- package/lib/build/assets.js +30 -0
- package/lib/build/build.js +350 -0
- package/lib/build/dev.js +1355 -0
- package/lib/build/devtoast.config.json +6 -0
- package/lib/build/devtoast.css +14 -0
- package/lib/build/facets.js +19 -0
- package/lib/build/fonts.js +105 -0
- package/lib/build/iiif.js +2990 -0
- package/lib/build/log.js +31 -0
- package/lib/build/mdx.js +1967 -0
- package/lib/build/package-names.js +111 -0
- package/lib/build/pages.js +420 -0
- package/lib/build/rehype-task-list-labels.js +54 -0
- package/lib/build/runtimes.js +141 -0
- package/lib/build/search-index.js +55 -0
- package/lib/build/search-text.js +160 -0
- package/lib/build/search-workflow.js +72 -0
- package/lib/build/search.js +302 -0
- package/lib/build/sitemap.js +197 -0
- package/lib/build/styles.js +140 -0
- package/lib/build/theme-tokens.js +78 -0
- package/lib/build/ui-styles.js +25 -0
- package/lib/build/upgrade-notices.js +121 -0
- package/lib/cli.js +64 -0
- package/lib/common.js +580 -0
- package/lib/components/bibliography.js +197 -0
- package/lib/components/featured.js +237 -0
- package/lib/components/hero-slider-runtime.js +215 -0
- package/lib/components/image-story-runtime-entry.js +249 -0
- package/lib/components/map-runtime.js +114 -0
- package/lib/components/metadata-index.js +32 -0
- package/lib/components/nav-place.js +227 -0
- package/lib/components/navigation.js +381 -0
- package/lib/components/referenced.js +217 -0
- package/lib/components/slider-runtime-entry.js +106 -0
- package/lib/components/timeline-runtime.js +80 -0
- package/lib/components/viewer-runtime-entry.js +88 -0
- package/lib/config-path.js +78 -0
- package/lib/default-locale.js +113 -0
- package/lib/discovery/browser-loader.js +107 -0
- package/lib/discovery/browser.js +115 -0
- package/lib/discovery/config.js +25 -0
- package/lib/discovery/envelope.js +124 -0
- package/lib/discovery/export.js +226 -0
- package/lib/discovery/ingestion.js +62 -0
- package/lib/discovery/pagination.js +66 -0
- package/lib/discovery/provenance.js +79 -0
- package/lib/discovery/search.js +81 -0
- package/lib/discovery/tools.js +155 -0
- package/lib/discovery/validation.js +121 -0
- package/lib/head.js +154 -0
- package/lib/iiif/thumbnail.js +402 -0
- package/lib/index.js +9 -0
- package/lib/locale-runtime.js +69 -0
- package/lib/locales.js +203 -0
- package/lib/orchestrator.js +231 -0
- package/lib/page-context.js +24 -0
- package/lib/search/bundle.js +25 -0
- package/lib/search/data.js +202 -0
- package/lib/search/engine.js +86 -0
- package/lib/search/index-cache.js +95 -0
- package/lib/search/search-app.jsx +835 -0
- package/lib/search/search-engine-runtime.js +44 -0
- package/lib/search/search-form-runtime.js +462 -0
- package/lib/search/search.js +676 -0
- package/package.json +109 -3
- package/types/base-path.d.ts +4 -0
- package/types/orchestrator.d.ts +17 -0
- package/ui/dist/index.mjs +7358 -0
- package/ui/dist/index.mjs.map +7 -0
- package/ui/dist/server.mjs +12731 -0
- package/ui/dist/server.mjs.map +7 -0
- package/ui/fonts/OFL.txt +98 -0
- package/ui/fonts/google-sans-flex-latin-ext.woff2 +0 -0
- package/ui/fonts/google-sans-flex-latin.woff2 +0 -0
- package/ui/fonts/source-serif-4-italic-latin-ext.woff2 +0 -0
- package/ui/fonts/source-serif-4-italic-latin.woff2 +0 -0
- package/ui/fonts/source-serif-4-latin-ext.woff2 +0 -0
- package/ui/fonts/source-serif-4-latin.woff2 +0 -0
- package/ui/styles/base/_common.scss +97 -0
- package/ui/styles/base/_heading.scss +61 -0
- package/ui/styles/base/_markdown.scss +188 -0
- package/ui/styles/base/_type.scss +51 -0
- package/ui/styles/base/_utilities.scss +7 -0
- package/ui/styles/base/index.scss +5 -0
- package/ui/styles/components/_article-card.scss +108 -0
- package/ui/styles/components/_band.scss +104 -0
- package/ui/styles/components/_bibliography.scss +88 -0
- package/ui/styles/components/_buttons.scss +143 -0
- package/ui/styles/components/_card.scss +109 -0
- package/ui/styles/components/_diagram.scss +76 -0
- package/ui/styles/components/_feature.scss +66 -0
- package/ui/styles/components/_footer.scss +136 -0
- package/ui/styles/components/_gallery.scss +476 -0
- package/ui/styles/components/_image-story.scss +56 -0
- package/ui/styles/components/_interstitial-hero.scss +625 -0
- package/ui/styles/components/_layout.scss +83 -0
- package/ui/styles/components/_map.scss +296 -0
- package/ui/styles/components/_metadata-index.scss +68 -0
- package/ui/styles/components/_nav-tree.scss +80 -0
- package/ui/styles/components/_referenced-items.scss +69 -0
- package/ui/styles/components/_sub-navigation.scss +208 -0
- package/ui/styles/components/_swoosh.scss +50 -0
- package/ui/styles/components/_timeline.scss +350 -0
- package/ui/styles/components/_work.scss +71 -0
- package/ui/styles/components/header/_header.scss +294 -0
- package/ui/styles/components/header/_logo.scss +99 -0
- package/ui/styles/components/header/_navbar.scss +143 -0
- package/ui/styles/components/header/index.scss +3 -0
- package/ui/styles/components/iiif/_image.scss +32 -0
- package/ui/styles/components/iiif/_slider.scss +5 -0
- package/ui/styles/components/iiif/index.scss +2 -0
- package/ui/styles/components/index.scss +25 -0
- package/ui/styles/components/modal/_modal.scss +130 -0
- package/ui/styles/components/modal/index.scss +1 -0
- package/ui/styles/components/search/_filters.scss +259 -0
- package/ui/styles/components/search/_form.scss +187 -0
- package/ui/styles/components/search/_panel.scss +7 -0
- package/ui/styles/components/search/_results.scss +241 -0
- package/ui/styles/components/search/_tabs.scss +60 -0
- package/ui/styles/components/search/index.scss +4 -0
- package/ui/styles/index.css +5007 -0
- package/ui/styles/index.scss +11 -0
- package/ui/styles/settings/_breakpoints.scss +7 -0
- package/ui/styles/settings/_focus.scss +15 -0
- package/ui/styles/settings/_tokens.scss +170 -0
- package/ui/styles/settings/_type.scss +126 -0
- package/ui/styles/version-parity.css +116 -0
- package/ui/tailwind-canopy-iiif-plugin.js +39 -0
- package/ui/tailwind-canopy-iiif-preset.js +32 -0
- package/ui/tailwind-config.d.ts +29 -0
- package/ui/tailwind-config.js +159 -0
- package/ui/tailwind-default.config.mjs +4 -0
- package/ui/theme-color.js +130 -0
- package/ui/theme-palette.js +337 -0
- package/ui/theme.js +153 -0
- package/README.md +0 -3
package/ui/fonts/OFL.txt
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
Google Sans Flex (google-sans-flex-latin.woff2, google-sans-flex-latin-ext.woff2):
|
|
2
|
+
Copyright 2015 Google LLC. All Rights Reserved.
|
|
3
|
+
|
|
4
|
+
Source Serif 4 (source-serif-4-latin.woff2, source-serif-4-latin-ext.woff2,
|
|
5
|
+
source-serif-4-italic-latin.woff2, source-serif-4-italic-latin-ext.woff2):
|
|
6
|
+
© 2014 - 2021 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name
|
|
7
|
+
'Source'. Shipped as Google Fonts serves it, unmodified.
|
|
8
|
+
|
|
9
|
+
Both are licensed under the SIL Open Font License, Version 1.1. This license is copied
|
|
10
|
+
below, and is also available with a FAQ at: https://openfontlicense.org
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
-----------------------------------------------------------
|
|
14
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
15
|
+
-----------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
PREAMBLE
|
|
18
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
19
|
+
development of collaborative font projects, to support the font creation
|
|
20
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
21
|
+
open framework in which fonts may be shared and improved in partnership
|
|
22
|
+
with others.
|
|
23
|
+
|
|
24
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
25
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
26
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
27
|
+
redistributed and/or sold with any software provided that any reserved
|
|
28
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
29
|
+
however, cannot be released under any other type of license. The
|
|
30
|
+
requirement for fonts to remain under this license does not apply
|
|
31
|
+
to any document created using the fonts or their derivatives.
|
|
32
|
+
|
|
33
|
+
DEFINITIONS
|
|
34
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
35
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
36
|
+
include source files, build scripts and documentation.
|
|
37
|
+
|
|
38
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
39
|
+
copyright statement(s).
|
|
40
|
+
|
|
41
|
+
"Original Version" refers to the collection of Font Software components as
|
|
42
|
+
distributed by the Copyright Holder(s).
|
|
43
|
+
|
|
44
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
45
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
46
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
47
|
+
new environment.
|
|
48
|
+
|
|
49
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
50
|
+
writer or other person who contributed to the Font Software.
|
|
51
|
+
|
|
52
|
+
PERMISSION & CONDITIONS
|
|
53
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
54
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
55
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
56
|
+
Software, subject to the following conditions:
|
|
57
|
+
|
|
58
|
+
1) Neither the Font Software nor any of its individual components,
|
|
59
|
+
in Original or Modified Versions, may be sold by itself.
|
|
60
|
+
|
|
61
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
62
|
+
redistributed and/or sold with any software, provided that each copy
|
|
63
|
+
contains the above copyright notice and this license. These can be
|
|
64
|
+
included either as stand-alone text files, human-readable headers or
|
|
65
|
+
in the appropriate machine-readable metadata fields within text or
|
|
66
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
67
|
+
|
|
68
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
69
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
70
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
71
|
+
presented to the users.
|
|
72
|
+
|
|
73
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
74
|
+
Software shall not be used to promote, endorse or advertise any
|
|
75
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
76
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
77
|
+
permission.
|
|
78
|
+
|
|
79
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
80
|
+
must be distributed entirely under this license, and must not be
|
|
81
|
+
distributed under any other license. The requirement for fonts to
|
|
82
|
+
remain under this license does not apply to any document created
|
|
83
|
+
using the Font Software.
|
|
84
|
+
|
|
85
|
+
TERMINATION
|
|
86
|
+
This license becomes null and void if any of the above conditions are
|
|
87
|
+
not met.
|
|
88
|
+
|
|
89
|
+
DISCLAIMER
|
|
90
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
91
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
92
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
93
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
94
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
95
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
96
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
97
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
98
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
@use "../settings/type";
|
|
2
|
+
|
|
3
|
+
@layer base {
|
|
4
|
+
body {
|
|
5
|
+
margin: 0;
|
|
6
|
+
padding: 0;
|
|
7
|
+
background: var(--color-gray-50);
|
|
8
|
+
color: var(--color-gray-900);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
p {
|
|
12
|
+
line-height: 1.618;
|
|
13
|
+
padding: 0.5rem 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
ol,
|
|
17
|
+
ul {
|
|
18
|
+
padding: 0.5rem 0;
|
|
19
|
+
padding-left: 1.618rem;
|
|
20
|
+
|
|
21
|
+
li {
|
|
22
|
+
margin-bottom: 0.382rem;
|
|
23
|
+
list-style: disc;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
a {
|
|
28
|
+
text-decoration: none;
|
|
29
|
+
color: var(--color-accent-default);
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
text-decoration: underline;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Links in running text are underlined as well as colored, so color never carries
|
|
37
|
+
// their meaning alone (WCAG 1.4.1; ACCESSIBILITY.md C11). Navigation, and links with
|
|
38
|
+
// a class of their own (cards, buttons, menus), keep their own treatment; the links
|
|
39
|
+
// Markdown writes carry no class, but for a footnote's way back to its reference (C43).
|
|
40
|
+
:where(p, li, td, th, blockquote, figcaption)
|
|
41
|
+
a:where(:not([class]):not(nav a), [data-footnote-backref]) {
|
|
42
|
+
text-decoration-line: underline;
|
|
43
|
+
text-underline-offset: 0.15em;
|
|
44
|
+
|
|
45
|
+
&:hover {
|
|
46
|
+
text-decoration-thickness: max(2px, 0.1em);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Text with nowhere to break, such as an identifier or a path in inline code, wraps
|
|
51
|
+
// rather than push the page sideways at 320px (WCAG 1.4.10; ACCESSIBILITY.md C13).
|
|
52
|
+
:where(p, li, dd, blockquote, figcaption),
|
|
53
|
+
:where(:not(pre)) > code {
|
|
54
|
+
overflow-wrap: anywhere;
|
|
55
|
+
}
|
|
56
|
+
|
|
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.
|
|
62
|
+
main
|
|
63
|
+
:where(p, ul, ol, blockquote):not([class]:not(.contains-task-list)):not(
|
|
64
|
+
:where(
|
|
65
|
+
[data-canopy-viewer],
|
|
66
|
+
[data-canopy-slider],
|
|
67
|
+
[data-canopy-image],
|
|
68
|
+
[data-canopy-scroll],
|
|
69
|
+
[data-canopy-related-items],
|
|
70
|
+
[class*="clover-"]
|
|
71
|
+
)
|
|
72
|
+
*
|
|
73
|
+
) {
|
|
74
|
+
@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
|
+
}
|
|
86
|
+
|
|
87
|
+
input,
|
|
88
|
+
textarea,
|
|
89
|
+
select,
|
|
90
|
+
button {
|
|
91
|
+
font-family: inherit;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
::selection {
|
|
95
|
+
background-color: hsl(from var(--color-accent-default) h s l / 0.2);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@use "../settings/type";
|
|
2
|
+
|
|
3
|
+
// Headings take the text styles by level (settings/_type.scss): a page's `h1` is its
|
|
4
|
+
// title, `h2` and `h3` step down, `h4` to `h6` share a size and are told apart by their
|
|
5
|
+
// place. Element selectors, after Tailwind's preflight in the layer (it sets headings'
|
|
6
|
+
// weight to `inherit`); a site's own `app/styles` base rules come later still and win:
|
|
7
|
+
// a 1.x site keeps its headings' face and weight.
|
|
8
|
+
@layer base {
|
|
9
|
+
h1,
|
|
10
|
+
h2,
|
|
11
|
+
h3,
|
|
12
|
+
h4,
|
|
13
|
+
h5,
|
|
14
|
+
h6 {
|
|
15
|
+
text-wrap: balance;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
h1 {
|
|
19
|
+
@include type.title;
|
|
20
|
+
margin: 0 0 1rem 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
h2 {
|
|
24
|
+
@include type.h2;
|
|
25
|
+
margin: 2.618rem 0 1rem;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
h3 {
|
|
29
|
+
@include type.h3;
|
|
30
|
+
margin: 1.618rem 0 1rem;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
h4,
|
|
34
|
+
h5,
|
|
35
|
+
h6 {
|
|
36
|
+
@include type.h4;
|
|
37
|
+
margin: 1.382rem 0 0.618rem 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// The brand's name, set as an `h4` is; its size is the header's and footer's.
|
|
41
|
+
:where(.canopy-logo) {
|
|
42
|
+
@include type.h4;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:where(strong, b) {
|
|
46
|
+
font-weight: var(--canopy-weight-bold);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Words under a title.
|
|
50
|
+
.canopy-lead {
|
|
51
|
+
@include type.lede;
|
|
52
|
+
margin: 0.5rem 0 2rem 0;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 1.x's utility, now the headings' family as the text styles set it.
|
|
57
|
+
@utility font-display {
|
|
58
|
+
font-family: var(--canopy-font-display);
|
|
59
|
+
font-weight: var(--canopy-weight-bold);
|
|
60
|
+
letter-spacing: var(--canopy-tracking-tight);
|
|
61
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
@use "../settings/type";
|
|
2
|
+
|
|
3
|
+
// Code in running text: a chip on the surface, in the page's text.
|
|
4
|
+
code {
|
|
5
|
+
@include type.code;
|
|
6
|
+
padding: 0.1em 0.35em;
|
|
7
|
+
border-radius: var(--canopy-radius-sm);
|
|
8
|
+
background-color: var(--canopy-surface);
|
|
9
|
+
color: var(--color-gray-900);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
pre code {
|
|
13
|
+
padding: 0;
|
|
14
|
+
border-radius: 0;
|
|
15
|
+
background: none;
|
|
16
|
+
color: inherit;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
hr {
|
|
20
|
+
display: block;
|
|
21
|
+
border-top: 1px solid var(--canopy-edge);
|
|
22
|
+
margin: 2.618rem 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// A quotation, as a magazine pulls one out: the reading serif at a lede's size, in the
|
|
26
|
+
// page's text, a rule in the accent's solid step beside it.
|
|
27
|
+
blockquote {
|
|
28
|
+
@include type.lede;
|
|
29
|
+
margin: 1.618rem 0;
|
|
30
|
+
padding: 0.382rem 0 0.382rem 1.618rem;
|
|
31
|
+
border-left: 3px solid var(--color-accent-600);
|
|
32
|
+
color: var(--color-gray-default);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
blockquote > p {
|
|
36
|
+
font-size: inherit;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.markdown-table__frame {
|
|
40
|
+
width: 100%;
|
|
41
|
+
margin: 1.618rem 0 2.618rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.markdown-table {
|
|
45
|
+
width: 100%;
|
|
46
|
+
border-collapse: collapse;
|
|
47
|
+
margin: 0;
|
|
48
|
+
|
|
49
|
+
th,
|
|
50
|
+
td {
|
|
51
|
+
border: 1px solid var(--color-gray-400);
|
|
52
|
+
padding: 0.5rem 0.75rem;
|
|
53
|
+
text-align: left;
|
|
54
|
+
vertical-align: top;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
th,
|
|
58
|
+
td {
|
|
59
|
+
@include type.ui;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
th {
|
|
63
|
+
@include type.label;
|
|
64
|
+
border-top: none;
|
|
65
|
+
border-left: none;
|
|
66
|
+
border-right: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
tbody {
|
|
70
|
+
tr {
|
|
71
|
+
&:nth-child(even) {
|
|
72
|
+
background-color: var(--color-gray-200);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
section[data-footnotes],
|
|
79
|
+
.footnotes {
|
|
80
|
+
margin-top: 2.618rem;
|
|
81
|
+
padding-top: 2.168rem;
|
|
82
|
+
border-top: 1px solid var(--canopy-edge);
|
|
83
|
+
|
|
84
|
+
ol,
|
|
85
|
+
ul {
|
|
86
|
+
list-style: decimal;
|
|
87
|
+
padding-left: 1.618rem;
|
|
88
|
+
|
|
89
|
+
li {
|
|
90
|
+
list-style: decimal;
|
|
91
|
+
margin-bottom: 0.618rem;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// A code block (`DocsCodeBlock`, every fenced block in MDX), as Clover's editor shows
|
|
97
|
+
// code: on black in both appearances, its text near-white (19:1), its file name and copy
|
|
98
|
+
// button faint yet 4.5:1, a marked line tinted with the accent. On a dark page, black on
|
|
99
|
+
// near-black, a hairline sets it off.
|
|
100
|
+
.canopy-code-block {
|
|
101
|
+
@include type.code(true);
|
|
102
|
+
--canopy-code-background: #000;
|
|
103
|
+
--canopy-code-text: #eeffff;
|
|
104
|
+
--canopy-code-faint: color-mix(in srgb, var(--canopy-code-text) 62%, var(--canopy-code-background));
|
|
105
|
+
--canopy-code-rule: color-mix(in srgb, var(--canopy-code-text) 14%, transparent);
|
|
106
|
+
position: relative;
|
|
107
|
+
margin: 1.5rem 0;
|
|
108
|
+
overflow: hidden;
|
|
109
|
+
border-radius: var(--canopy-radius-lg);
|
|
110
|
+
background-color: var(--canopy-code-background);
|
|
111
|
+
box-shadow: inset 0 0 0 1px var(--canopy-band-edge);
|
|
112
|
+
color: var(--canopy-code-text);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.canopy-code-block__header {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: space-between;
|
|
119
|
+
gap: 1rem;
|
|
120
|
+
padding: 0.618rem 0.75rem 0.618rem 1.25rem;
|
|
121
|
+
border-bottom: 1px solid var(--canopy-code-rule);
|
|
122
|
+
color: var(--canopy-code-faint);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.canopy-code-block__filename {
|
|
126
|
+
min-width: 0;
|
|
127
|
+
overflow-wrap: anywhere;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.canopy-code-block__copy {
|
|
131
|
+
display: inline-flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
gap: 0.3rem;
|
|
134
|
+
min-height: 24px;
|
|
135
|
+
padding: 0.25rem 0.618rem;
|
|
136
|
+
border: 1px solid var(--canopy-code-rule);
|
|
137
|
+
border-radius: var(--canopy-radius-sm);
|
|
138
|
+
background: transparent;
|
|
139
|
+
color: var(--canopy-code-faint);
|
|
140
|
+
@include type.ui-sm;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
transition: color 120ms ease;
|
|
143
|
+
|
|
144
|
+
&:hover {
|
|
145
|
+
color: var(--canopy-code-text);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&:focus-visible {
|
|
149
|
+
outline: 2px solid var(--canopy-code-text);
|
|
150
|
+
outline-offset: 2px;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.canopy-code-block__pre {
|
|
155
|
+
margin: 0;
|
|
156
|
+
padding: 1rem 0;
|
|
157
|
+
overflow-x: auto;
|
|
158
|
+
background: none;
|
|
159
|
+
color: inherit;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.canopy-code-block__code {
|
|
163
|
+
display: block;
|
|
164
|
+
padding: 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.canopy-code-block__line {
|
|
168
|
+
display: block;
|
|
169
|
+
box-sizing: border-box;
|
|
170
|
+
padding: 0.125rem 1.25rem;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.canopy-code-block__line[data-highlighted] {
|
|
174
|
+
background-color: color-mix(in srgb, var(--color-accent-600) 24%, transparent);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.canopy-code-block__text {
|
|
178
|
+
display: inline;
|
|
179
|
+
white-space: pre;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Code blocks scroll sideways, so they take focus to be scrolled by keyboard. Their
|
|
183
|
+
// frame clips anything drawn outside them, so the focus ring is drawn inside, in the
|
|
184
|
+
// code's own text on black (WCAG 2.1.1, 2.4.7; ACCESSIBILITY.md C12).
|
|
185
|
+
[data-docs-code-block] pre:focus-visible {
|
|
186
|
+
outline: 2px solid var(--canopy-code-text, var(--color-accent-default));
|
|
187
|
+
outline-offset: -2px;
|
|
188
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@use "../settings/type";
|
|
2
|
+
|
|
3
|
+
// Each text style as a class (`.canopy-type-<style>`), for an author's own markup in MDX:
|
|
4
|
+
// `<p className="canopy-type-label">`. The docs' Style guide page shows them all. In
|
|
5
|
+
// `@layer components`, so a class wins over an element's own style, and a site's
|
|
6
|
+
// utilities over the class.
|
|
7
|
+
@layer components {
|
|
8
|
+
.canopy-type-display {
|
|
9
|
+
@include type.display;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.canopy-type-title {
|
|
13
|
+
@include type.title;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.canopy-type-h2 {
|
|
17
|
+
@include type.h2;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.canopy-type-h3 {
|
|
21
|
+
@include type.h3;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.canopy-type-h4 {
|
|
25
|
+
@include type.h4;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.canopy-type-lede {
|
|
29
|
+
@include type.lede;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.canopy-type-body {
|
|
33
|
+
@include type.body;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.canopy-type-ui {
|
|
37
|
+
@include type.ui;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.canopy-type-ui-sm {
|
|
41
|
+
@include type.ui-sm;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.canopy-type-label {
|
|
45
|
+
@include type.label;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.canopy-type-code {
|
|
49
|
+
@include type.code;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
@use "../settings/focus" as focus;
|
|
2
|
+
@use "../settings/type";
|
|
3
|
+
|
|
4
|
+
// `ArticleCard`, a page among search results: a raised card, as `<Card>` is, with the
|
|
5
|
+
// page's title, its address in the accent's text step, the words that matched and their
|
|
6
|
+
// headings, and its image where it has one. Under the pointer the title takes the accent,
|
|
7
|
+
// underlined; focused, the card takes the focus ring.
|
|
8
|
+
.canopy-article-card {
|
|
9
|
+
display: block;
|
|
10
|
+
text-decoration: none;
|
|
11
|
+
color: inherit;
|
|
12
|
+
padding: 1rem 1.25rem;
|
|
13
|
+
border-radius: var(--canopy-radius-lg);
|
|
14
|
+
background-color: var(--canopy-surface-raised);
|
|
15
|
+
box-shadow: var(--canopy-card-shadow);
|
|
16
|
+
transition: box-shadow 150ms ease;
|
|
17
|
+
|
|
18
|
+
article {
|
|
19
|
+
max-width: 65ch;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&:hover {
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
box-shadow:
|
|
25
|
+
0 0 0 1px var(--canopy-edge),
|
|
26
|
+
var(--canopy-shadow-lg);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&:hover .canopy-article-card__title {
|
|
30
|
+
color: var(--color-accent-default);
|
|
31
|
+
text-decoration: underline;
|
|
32
|
+
text-underline-offset: 0.2em;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:focus-visible {
|
|
36
|
+
@include focus.focus-ring;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.canopy-article-card__title {
|
|
40
|
+
@include type.h4;
|
|
41
|
+
margin: 0;
|
|
42
|
+
color: var(--color-gray-900);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.canopy-article-card__url {
|
|
46
|
+
@include type.ui-sm;
|
|
47
|
+
color: var(--color-accent-default);
|
|
48
|
+
margin: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.canopy-article-card__snippet {
|
|
52
|
+
@include type.ui-sm;
|
|
53
|
+
margin: 0.382rem 0 0;
|
|
54
|
+
color: var(--color-gray-default);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.canopy-article-card__meta {
|
|
58
|
+
margin: 0.618rem 0 0;
|
|
59
|
+
padding: 0;
|
|
60
|
+
list-style: none;
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-wrap: wrap;
|
|
63
|
+
gap: 0.382rem 1.618rem;
|
|
64
|
+
@include type.ui-sm;
|
|
65
|
+
color: var(--color-gray-muted);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// With an image (a page's front matter `image`, a work's thumbnail): the picture beside
|
|
69
|
+
// the words, a decoration, as the title names the result.
|
|
70
|
+
&.canopy-article-card--media article {
|
|
71
|
+
display: grid;
|
|
72
|
+
grid-template-columns: 4.236rem minmax(0, 1fr);
|
|
73
|
+
column-gap: 1rem;
|
|
74
|
+
align-items: start;
|
|
75
|
+
max-width: calc(65ch + 5.236rem);
|
|
76
|
+
|
|
77
|
+
> :not(.canopy-article-card__thumb) {
|
|
78
|
+
grid-column: 2;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.canopy-article-card__thumb {
|
|
83
|
+
grid-column: 1;
|
|
84
|
+
grid-row: 1 / span 4;
|
|
85
|
+
display: block;
|
|
86
|
+
width: 4.236rem;
|
|
87
|
+
aspect-ratio: 1;
|
|
88
|
+
object-fit: cover;
|
|
89
|
+
border-radius: var(--canopy-radius-sm);
|
|
90
|
+
background: var(--canopy-surface);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// A match, often the start of a word ("map" in "MapPoint"): no padding to the side, so
|
|
94
|
+
// the word does not read as two.
|
|
95
|
+
mark {
|
|
96
|
+
// use a srgb color to avoid issues with dark mode and allow for alpha blending
|
|
97
|
+
background: color-mix(in srgb, var(--color-accent-500) 38.2%, transparent);
|
|
98
|
+
color: inherit;
|
|
99
|
+
padding: 0.05rem 0;
|
|
100
|
+
border-radius: var(--canopy-radius-sm);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media (prefers-reduced-motion: reduce) {
|
|
105
|
+
.canopy-article-card {
|
|
106
|
+
transition: none;
|
|
107
|
+
}
|
|
108
|
+
}
|