@allons-y/course-kit 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/README.md +90 -2
- package/assets/fonts/instrument-sans-italic-var.woff2 +0 -0
- package/assets/fonts/instrument-sans-var.woff2 +0 -0
- package/assets/fonts/pt-mono.woff2 +0 -0
- package/assets/scripts/copy.js +99 -0
- package/assets/scripts/deck.js +161 -0
- package/assets/scripts/email.js +19 -0
- package/assets/scripts/practice.js +545 -0
- package/assets/scripts/theme-panel.js +647 -0
- package/assets/scripts/theme-restore.js +17 -0
- package/assets/styles/base.css +2091 -0
- package/assets/styles/deck.css +968 -0
- package/assets/styles/font.css +36 -0
- package/assets/styles/notes.css +137 -0
- package/assets/styles/print.css +428 -0
- package/assets/styles/semantics.css +101 -0
- package/components/practice/check-controls.webc +50 -0
- package/components/practice/choice-list.webc +86 -0
- package/components/practice/cite-panel.webc +108 -0
- package/components/practice/practice-figure.webc +47 -0
- package/components/practice/practice-fill.webc +154 -0
- package/components/practice/practice-grid.webc +82 -0
- package/components/practice/practice-judge.webc +165 -0
- package/components/practice/practice-match.webc +178 -0
- package/components/practice/practice-question.webc +141 -0
- package/components/practice/practice-selfcheck.webc +40 -0
- package/components/practice/practice-terms.webc +95 -0
- package/components/practice/practice-tree.webc +91 -0
- package/components/practice/practice-worksheet.webc +369 -0
- package/components/site/copyright.webc +13 -0
- package/components/site/course-documents.webc +27 -0
- package/components/site/course-now.webc +393 -0
- package/components/site/course-summary.webc +136 -0
- package/components/site/demo-weeks.webc +91 -0
- package/components/site/glossary-entry.webc +31 -0
- package/components/site/glossary-panel.webc +1482 -0
- package/components/site/glossary.webc +45 -0
- package/components/site/grading.webc +50 -0
- package/components/site/instructor.webc +432 -0
- package/components/site/masthead.webc +147 -0
- package/components/site/nav-links.webc +174 -0
- package/components/site/policies.webc +17 -0
- package/components/site/practice-index.webc +31 -0
- package/components/site/schedule-overview.webc +145 -0
- package/components/site/schedule-weeks.webc +589 -0
- package/components/site/site-footer.webc +119 -0
- package/components/site/slide-timetable.webc +152 -0
- package/components/site/syllabus.webc +370 -0
- package/components/ui/arrow-link.webc +19 -0
- package/components/ui/assigned-list.webc +101 -0
- package/components/ui/callout.webc +11 -0
- package/components/ui/card-list.webc +124 -0
- package/components/ui/codepen-embed.webc +123 -0
- package/components/ui/download-button.webc +49 -0
- package/components/ui/eyebrow.webc +18 -0
- package/components/ui/icons/github.webc +6 -0
- package/components/ui/icons/google.webc +9 -0
- package/components/ui/link-list.webc +130 -0
- package/components/ui/link-section.webc +40 -0
- package/components/ui/meeting-card.webc +73 -0
- package/components/ui/meeting-decks.webc +38 -0
- package/components/ui/table-rubric.webc +251 -0
- package/components/ui/today-link.webc +43 -0
- package/components/ui/today-marker.webc +149 -0
- package/components/ui/week-block.webc +53 -0
- package/examples/starter/_data/course.json +20 -0
- package/examples/starter/_data/dates.json +16 -0
- package/examples/starter/_data/grading.json +6 -0
- package/examples/starter/_data/instructor.json +7 -0
- package/examples/starter/_data/policies.json +9 -0
- package/examples/starter/_data/scale.json +8 -0
- package/examples/starter/_data/schedule.json +22 -0
- package/examples/starter/_data/theme.json +17 -0
- package/examples/starter/content/index.webc +12 -0
- package/examples/starter/content/schedule.webc +12 -0
- package/examples/starter/content/slides/index.11tydata.js +5 -0
- package/examples/starter/content/slides/index.webc +12 -0
- package/examples/starter/content/slides/week-1-day-1.md +40 -0
- package/examples/starter/eleventy.config.js +8 -0
- package/glue/deck-notes.data.js +41 -0
- package/glue/deck-notes.webc +32 -0
- package/glue/lesson-day.data.js +17 -0
- package/glue/lesson-day.webc +0 -0
- package/glue/lesson-plans.data.js +13 -0
- package/glue/lesson-plans.webc +2 -0
- package/index.js +6 -0
- package/layouts/base.webc +79 -0
- package/layouts/deck.webc +46 -0
- package/layouts/demo.webc +16 -0
- package/layouts/document.webc +10 -0
- package/layouts/lesson-detail.webc +109 -0
- package/layouts/lesson.webc +71 -0
- package/layouts/notes.webc +23 -0
- package/layouts/worksheet.webc +52 -0
- package/lib/assets.js +42 -0
- package/lib/bundles.js +79 -0
- package/lib/check.js +110 -0
- package/lib/components.js +19 -0
- package/lib/copy.js +656 -0
- package/lib/data/build.js +22 -0
- package/lib/data/fonts.js +16 -0
- package/lib/data/glossary.js +304 -0
- package/lib/data/index.js +8 -0
- package/lib/data/lessons.js +173 -0
- package/lib/data/project.js +22 -0
- package/lib/data/read.js +61 -0
- package/lib/data/site.js +70 -0
- package/lib/data/term.js +80 -0
- package/lib/extensions.js +70 -0
- package/lib/files.js +14 -0
- package/lib/filters.js +584 -0
- package/lib/fit.js +106 -0
- package/lib/glue.js +26 -0
- package/lib/lesson-materials.js +66 -0
- package/lib/markdown.js +568 -0
- package/lib/minify.js +53 -0
- package/lib/paths.js +5 -0
- package/lib/pdf.js +134 -0
- package/lib/plugin.js +231 -0
- package/lib/plugins.js +34 -0
- package/lib/postcss.js +93 -0
- package/lib/theme-server.js +88 -0
- package/lib/theme.js +185 -0
- package/lib/worksheet-dialect.js +415 -0
- package/lib/worksheets.js +276 -0
- package/package.json +119 -4
- package/schemas/course.schema.json +161 -0
- package/schemas/dates.schema.json +165 -0
- package/schemas/grading.schema.json +59 -0
- package/schemas/instructor.schema.json +76 -0
- package/schemas/policies.schema.json +90 -0
- package/schemas/project.schema.json +209 -0
- package/schemas/scale.schema.json +68 -0
- package/schemas/schedule.schema.json +260 -0
- package/schemas/theme.schema.json +704 -0
- package/schemas/worksheet.schema.json +449 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* A labelled list of readings or deadlines. Renders nothing when empty.
|
|
4
|
+
* Give it the `items` array, or write the list as a `<dl>` in the default slot: each `<dt>` holds the title or its link (give it `data-kind` and,
|
|
5
|
+
* before the title, `<span class="due-chip" data-kind="test">Test</span>` for a chip), each `<dd>` only the check or due detail. The array wins when
|
|
6
|
+
* it has items; when it is missing or empty the slot is rendered instead, so the list still shows if the data does not load.
|
|
7
|
+
* @prop {string} label the heading above the list
|
|
8
|
+
* @prop {{ title: string, href?: string, check?: string, dueLabel?: string, kind?: string }[]} items the readings or deadlines to list
|
|
9
|
+
* @prop {string} [dueOn] how a due date reads after the check, with `{when}`: `copy.schedule.dueOn` ("due {when}"); without it the date stands alone
|
|
10
|
+
* @prop {boolean} [chips] put a `.due-chip` for the item's `kind` before its title; a bare `@chips` turns them on
|
|
11
|
+
* @prop {Record<string, string>} [kinds] the chip words by kind, from `copy.schedule.dueKind*`; needed with `chips`
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** The muted line under an item: its check, then when it is due. Props are not in scope here, so the template passes `dueOn`. */
|
|
15
|
+
/** A bare `@chips` reaches the template as "", so only an absent, null, `false` or "false" value turns chips off. */
|
|
16
|
+
const on = (value) => value !== undefined && value !== null && value !== false && value !== "false";
|
|
17
|
+
|
|
18
|
+
const detail = (item, dueOn) => [item.check, item.dueLabel && (dueOn ? dueOn.replace("{when}", item.dueLabel) : item.dueLabel)].filter(Boolean).join(", ");
|
|
19
|
+
</script>
|
|
20
|
+
<div webc:root="override" class="assigned">
|
|
21
|
+
<p class="label" @text="label"></p>
|
|
22
|
+
<slot webc:if="!items?.length"></slot>
|
|
23
|
+
<ul role="list" webc:if="items?.length">
|
|
24
|
+
<li webc:for="item of items" @attributes="on(chips) && item.kind ? { class: 'due-item', 'data-kind': item.kind } : {}">
|
|
25
|
+
<span class="due-chip" webc:if="on(chips) && item.kind" :data-kind="item.kind" @text="kinds?.[item.kind]"></span>
|
|
26
|
+
<a webc:if="item.href" :href="item.href" @text="item.title"></a>
|
|
27
|
+
<span webc:if="!item.href" @text="item.title"></span>
|
|
28
|
+
<span class="check" webc:if="detail(item, dueOn)" @text="detail(item, dueOn)"></span>
|
|
29
|
+
</li>
|
|
30
|
+
</ul>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<style webc:scoped>
|
|
34
|
+
:host {
|
|
35
|
+
/* Items sit clearly further apart than the lines inside one (WCAG 1.4.8). */
|
|
36
|
+
/* Nothing to list, in either form: nothing to show. */
|
|
37
|
+
&:not(:has(li, dt)) {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
ul,
|
|
42
|
+
dl {
|
|
43
|
+
display: grid;
|
|
44
|
+
/* The links are 44px tall, so the rows already carry most of the space between items. */
|
|
45
|
+
gap: calc(var(--content-space) * 0.25);
|
|
46
|
+
list-style: none;
|
|
47
|
+
margin: 0;
|
|
48
|
+
padding: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* A chip and its title share a row that wraps, so a long title never runs under the chip. */
|
|
52
|
+
li,
|
|
53
|
+
dt {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-wrap: wrap;
|
|
56
|
+
align-items: center;
|
|
57
|
+
gap: 0 0.5em;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* A link is an operable target: 44px tall (WCAG 2.5.5). */
|
|
61
|
+
li a,
|
|
62
|
+
dt a {
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
min-block-size: var(--target-min);
|
|
66
|
+
min-inline-size: var(--target-min);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* The slot form: a title and its detail stay a pair, and the pairs are spaced like the list's items. */
|
|
70
|
+
dl {
|
|
71
|
+
gap: 0;
|
|
72
|
+
margin: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
dt:not(:first-child) {
|
|
76
|
+
margin-block-start: calc(var(--content-space) * 0.25);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
dd {
|
|
80
|
+
margin: 0;
|
|
81
|
+
color: var(--color-text-muted);
|
|
82
|
+
font-size: max(var(--base-font-size), 0.9em);
|
|
83
|
+
line-height: var(--font-height);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.label {
|
|
88
|
+
margin: 0 0 calc(var(--content-space) * 0.5);
|
|
89
|
+
color: var(--color-text-muted);
|
|
90
|
+
text-transform: uppercase;
|
|
91
|
+
letter-spacing: 0.05em;
|
|
92
|
+
font-size: var(--font-size-6);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.check {
|
|
96
|
+
flex-basis: 100%;
|
|
97
|
+
line-height: var(--font-height);
|
|
98
|
+
color: var(--color-text-muted);
|
|
99
|
+
font-size: max(var(--base-font-size), 0.9em);
|
|
100
|
+
}
|
|
101
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* A highlighted aside. The content is the slot. A typed callout opens with its type in words, so the type is never told by color alone.
|
|
4
|
+
* @prop {'success' | 'warn' | 'error'} [type] the color of the edge and wash, and the opening word (`copy.callout`: Success, Warning, Error); none, or any other value, is the brand color with no word. Write it `@type="warn"` or as the attribute `:type="'warn'"`: both color it.
|
|
5
|
+
* @prop {string} [label] the opening word in place of the default for the type; `label=""` (or a bare `@label`) shows none; a callout with no type shows none either way
|
|
6
|
+
*/
|
|
7
|
+
</script>
|
|
8
|
+
<div webc:root="override" :class="`callout${['success', 'warn', 'error'].includes(type) ? ` ${type}` : ''}`">
|
|
9
|
+
<p class="callout-label" webc:if="label ?? calloutLabel(type)" @text="label ?? calloutLabel(type)"></p>
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* A list of cards, each linking to a page. A card shows the page's code, name and description unless the slot supplies its own content.
|
|
4
|
+
* Instead of `items` you can write the cards yourself as a `<ul>` of `<li>` cards in the `cards` slot (the default slot is taken: it is each card's
|
|
5
|
+
* own content); the array wins when it has items, and when it is missing or empty the `cards` slot is rendered instead. A card written in the slot
|
|
6
|
+
* must name its overlay link, as the items form does: `<li><a href="/x/" aria-labelledby="x-name"></a><h3 id="x-name">Name</h3></li>`.
|
|
7
|
+
* @prop {object[]} items pages, each with `data` and `page.url`
|
|
8
|
+
* @slot cards the cards as a `<ul>`, used when `items` is missing or empty
|
|
9
|
+
* @slot default each card's own content, in place of its code, name and description
|
|
10
|
+
*/
|
|
11
|
+
</script>
|
|
12
|
+
<ul role="list" webc:root="override" webc:if="items?.length">
|
|
13
|
+
<li webc:for="item of items">
|
|
14
|
+
<a :href="item.page.url" webc:if="item.page.url" :aria-labelledby="slugify(item.data.name)"></a>
|
|
15
|
+
<slot :@item="item">
|
|
16
|
+
<eyebrow @text="item.data.code"></eyebrow>
|
|
17
|
+
<h3 @text="item.data.name" :id="slugify(item.data.name)"></h3>
|
|
18
|
+
<p @text="item.data.description" webc:if="item.data.description"></p>
|
|
19
|
+
</slot>
|
|
20
|
+
</li>
|
|
21
|
+
</ul>
|
|
22
|
+
<div webc:root="override" webc:else><slot name="cards"></slot></div>
|
|
23
|
+
|
|
24
|
+
<style webc:scoped>
|
|
25
|
+
:host:not(:has(li)) {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host,
|
|
30
|
+
:host > ul {
|
|
31
|
+
list-style: none;
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
display: grid;
|
|
35
|
+
gap: calc(var(--content-space) * 1.5);
|
|
36
|
+
|
|
37
|
+
> li {
|
|
38
|
+
font-size: 1em;
|
|
39
|
+
position: relative;
|
|
40
|
+
background-color: var(--color-surface);
|
|
41
|
+
border: var(--thick-border-width) solid transparent;
|
|
42
|
+
border-radius: var(--standard-border-radius);
|
|
43
|
+
padding-block: calc(var(--content-space) * 1.5);
|
|
44
|
+
padding-inline: calc(var(--content-space) * 1);
|
|
45
|
+
|
|
46
|
+
a {
|
|
47
|
+
display: block;
|
|
48
|
+
position: absolute;
|
|
49
|
+
pointer-events: all;
|
|
50
|
+
inset: calc(-1 * var(--thick-border-width));
|
|
51
|
+
z-index: 1;
|
|
52
|
+
text-decoration: none;
|
|
53
|
+
color: inherit;
|
|
54
|
+
background-color: transparent;
|
|
55
|
+
border: none;
|
|
56
|
+
padding: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&::before {
|
|
60
|
+
content: "";
|
|
61
|
+
position: absolute;
|
|
62
|
+
inset: calc(-1 * var(--thick-border-width));
|
|
63
|
+
border-radius: inherit;
|
|
64
|
+
padding: var(--thick-border-width);
|
|
65
|
+
background: linear-gradient(to bottom right, var(--gradient-stops));
|
|
66
|
+
background-size: 200% 200%;
|
|
67
|
+
-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
|
|
68
|
+
-webkit-mask-composite: xor;
|
|
69
|
+
mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&:has(a) {
|
|
74
|
+
@media (prefers-reduced-motion: reduce) {
|
|
75
|
+
&:is(:hover, :focus, :focus-within) {
|
|
76
|
+
background-color: color-mix(in sRGB, var(--color-surface-overlay) 90%, transparent);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:is(:hover,:focus,:focus-within)::before {
|
|
80
|
+
background-position: 0% 0%;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@media not (prefers-reduced-motion: reduce) {
|
|
86
|
+
&:is(:hover,:focus,:focus-within)::before {
|
|
87
|
+
animation: gradient-drift 2s ease-in-out infinite alternate;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@media print {
|
|
93
|
+
background-color: transparent;
|
|
94
|
+
border-color: var(--color-border);
|
|
95
|
+
|
|
96
|
+
&::before {
|
|
97
|
+
display: none;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
h3 {
|
|
103
|
+
margin-block: 1rem;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
p {
|
|
107
|
+
text-decoration: none;
|
|
108
|
+
|
|
109
|
+
&:last-child {
|
|
110
|
+
margin-block-end: 0;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@keyframes gradient-drift {
|
|
116
|
+
from {
|
|
117
|
+
background-position: 0% 0%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
to {
|
|
121
|
+
background-position: 100% 100%;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
</style>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* A live code sample: a header with actions, then the CodePen embed prefilled with the code.
|
|
4
|
+
* @prop {string} [heading] the header, default `copy.theCode`
|
|
5
|
+
* @prop {string} label the pen's title
|
|
6
|
+
* @prop {string} summary the pen's description
|
|
7
|
+
* @prop {number} [height] embed height in pixels, default 800
|
|
8
|
+
* @prop {string[]} [tags] tags added to the pen
|
|
9
|
+
* @prop {Record<string, string>} copy the pane labels: `copy.codepenEmbed` (`theCode`, `html`, `css`, `javascript`, `htmlSource`, `cssSource`, `javascriptSource`)
|
|
10
|
+
* @slot actions buttons beside the header
|
|
11
|
+
* @slot default extra content under the code
|
|
12
|
+
*/
|
|
13
|
+
</script>
|
|
14
|
+
<figure webc:root="override" class="codepen-embed">
|
|
15
|
+
<div class="embed-header">
|
|
16
|
+
<h2 @text="heading ?? copy.theCode"></h2>
|
|
17
|
+
<slot name="actions"></slot>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="codepen"
|
|
21
|
+
:data-prefill="codepenPrefill({ title: label, description: summary, tags: tags ?? [] })"
|
|
22
|
+
:data-height="height ?? 800"
|
|
23
|
+
data-default-tab="html,result"
|
|
24
|
+
data-editable="true"
|
|
25
|
+
data-preview="true">
|
|
26
|
+
<p class="pane-label" webc:if="markup" @text="copy.html"></p>
|
|
27
|
+
<pre data-lang="html" webc:if="markup" tabindex="0" :aria-label="copy.htmlSource" @text="markup"></pre>
|
|
28
|
+
<p class="pane-label" webc:if="styles" @text="copy.css"></p>
|
|
29
|
+
<pre data-lang="css" webc:if="styles" tabindex="0" :aria-label="copy.cssSource" @text="styles"></pre>
|
|
30
|
+
<p class="pane-label" webc:if="script" @text="copy.javascript"></p>
|
|
31
|
+
<pre data-lang="js" webc:if="script" tabindex="0" :aria-label="copy.javascriptSource" @text="script"></pre>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<script webc:keep>
|
|
35
|
+
/* Set the editor theme before ei.js builds the iframe. */
|
|
36
|
+
(function () {
|
|
37
|
+
try {
|
|
38
|
+
var forced = document.documentElement.dataset.theme;
|
|
39
|
+
var dark =
|
|
40
|
+
forced === "dark" ||
|
|
41
|
+
(forced !== "light" && matchMedia("(prefers-color-scheme: dark)").matches);
|
|
42
|
+
document.querySelectorAll(".codepen[data-prefill]").forEach(function (embed) {
|
|
43
|
+
embed.dataset.themeId = dark ? "dark" : "light";
|
|
44
|
+
});
|
|
45
|
+
} catch (e) {}
|
|
46
|
+
})();
|
|
47
|
+
</script>
|
|
48
|
+
<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js" webc:keep></script>
|
|
49
|
+
|
|
50
|
+
<figcaption>
|
|
51
|
+
<slot></slot>
|
|
52
|
+
</figcaption>
|
|
53
|
+
</figure>
|
|
54
|
+
|
|
55
|
+
<style webc:scoped>
|
|
56
|
+
:host {
|
|
57
|
+
margin: var(--content-space) 0;
|
|
58
|
+
|
|
59
|
+
iframe {
|
|
60
|
+
block-size: max(600px, 50dvh);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.embed-header {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-wrap: wrap;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: space-between;
|
|
69
|
+
gap: 0.5em var(--content-space);
|
|
70
|
+
margin-block-end: calc(var(--content-space) * 0.4);
|
|
71
|
+
|
|
72
|
+
> h2 {
|
|
73
|
+
margin: 0;
|
|
74
|
+
font-size: 1.05em;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Until ei.js swaps it for an iframe this element is the source itself,
|
|
79
|
+
so it has to read as a code listing rather than broken layout. */
|
|
80
|
+
.codepen {
|
|
81
|
+
display: grid;
|
|
82
|
+
gap: var(--thin-border-width);
|
|
83
|
+
border: var(--thin-border-width) solid var(--color-border);
|
|
84
|
+
border-radius: var(--standard-border-radius);
|
|
85
|
+
background-color: var(--color-border);
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* A real element, not a ::before: the labels have to survive the site's
|
|
90
|
+
no-CSS teaching mode. */
|
|
91
|
+
.codepen .pane-label {
|
|
92
|
+
margin: 0;
|
|
93
|
+
padding: calc(var(--content-space) * .4) calc(var(--content-space) * .6);
|
|
94
|
+
background-color: var(--color-page);
|
|
95
|
+
color: var(--color-text-muted);
|
|
96
|
+
font-family: var(--dense-font);
|
|
97
|
+
font-size: var(--font-size-7);
|
|
98
|
+
letter-spacing: .06em;
|
|
99
|
+
text-transform: uppercase;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.codepen pre {
|
|
103
|
+
margin: 0;
|
|
104
|
+
max-block-size: 22em;
|
|
105
|
+
overflow: auto;
|
|
106
|
+
padding: calc(var(--content-space) * .6);
|
|
107
|
+
background-color: var(--color-page);
|
|
108
|
+
font-size: 0.85em;
|
|
109
|
+
tab-size: 2;
|
|
110
|
+
|
|
111
|
+
&:focus-visible {
|
|
112
|
+
outline: var(--focus-ring-width) solid var(--color-focus-ring);
|
|
113
|
+
outline-offset: calc(var(--focus-ring-width) * -1);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
figcaption {
|
|
118
|
+
margin-block-start: calc(var(--content-space) * .5);
|
|
119
|
+
color: var(--color-text-muted);
|
|
120
|
+
font-size: 0.9em;
|
|
121
|
+
text-wrap: pretty;
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* A download link with an icon. The label is the slot.
|
|
4
|
+
* @prop {string} url the file to download
|
|
5
|
+
*/
|
|
6
|
+
</script>
|
|
7
|
+
<a webc:root="override" :href="url" download>
|
|
8
|
+
<svg aria-hidden="true" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" class="download-icon">
|
|
9
|
+
<path d="M8 2v8" />
|
|
10
|
+
<path d="M4.5 7 8 10.5 11.5 7" />
|
|
11
|
+
<path d="M2.5 12.5h11" />
|
|
12
|
+
</svg>
|
|
13
|
+
<slot></slot>
|
|
14
|
+
</a>
|
|
15
|
+
|
|
16
|
+
<style webc:scoped>
|
|
17
|
+
:host {
|
|
18
|
+
--aspect-ratio: auto;
|
|
19
|
+
--image-size: fit-content;
|
|
20
|
+
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
gap: 0.4em;
|
|
25
|
+
min-block-size: var(--target-min);
|
|
26
|
+
padding: 0.6em 1.4em;
|
|
27
|
+
border: var(--thin-border-width) solid var(--color-border);
|
|
28
|
+
border-radius: var(--pill-border-radius);
|
|
29
|
+
color: var(--color-text);
|
|
30
|
+
font-size: 0.8em;
|
|
31
|
+
font-weight: var(--font-weight--semi-bold);
|
|
32
|
+
text-decoration: none;
|
|
33
|
+
|
|
34
|
+
&:hover,
|
|
35
|
+
&:focus-visible {
|
|
36
|
+
border-color: var(--color-accent);
|
|
37
|
+
background-color: var(--accent-bg);
|
|
38
|
+
color: var(--color-accent-text);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.download-icon {
|
|
42
|
+
flex: none;
|
|
43
|
+
inline-size: 1em;
|
|
44
|
+
block-size: 1em;
|
|
45
|
+
min-block-size: 0;
|
|
46
|
+
fill: none;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* A small line above a heading. The content is the slot.
|
|
4
|
+
*/
|
|
5
|
+
</script>
|
|
6
|
+
<p webc:root="override"><slot></slot></p>
|
|
7
|
+
|
|
8
|
+
<style webc:scoped="eyebrow">
|
|
9
|
+
:host {
|
|
10
|
+
font-size: var(--font-size-6);
|
|
11
|
+
text-transform: uppercase;
|
|
12
|
+
text-decoration: none;
|
|
13
|
+
letter-spacing: 0.08em;
|
|
14
|
+
font-weight: var(--font-weight--semi-bold);
|
|
15
|
+
color: var(--color-text-muted);
|
|
16
|
+
margin-block: 0;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/** An inline SVG icon; it takes its color from the text. */
|
|
3
|
+
</script>
|
|
4
|
+
<svg width="20" height="20" viewBox="0 0 16 16" aria-hidden="true" focusable="false" webc:root="override">
|
|
5
|
+
<path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.4 7.4 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z" />
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/** An inline SVG icon; it takes its color from the text. */
|
|
3
|
+
</script>
|
|
4
|
+
<svg width="20" height="20" viewBox="0 0 18 18" aria-hidden="true" focusable="false" webc:root="override">
|
|
5
|
+
<path fill="#4285F4" d="M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.48h4.84a4.14 4.14 0 0 1-1.8 2.72v2.26h2.92c1.7-1.57 2.68-3.88 2.68-6.62Z" />
|
|
6
|
+
<path fill="#34A853" d="M9 18c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.84.86-3.04.86-2.34 0-4.32-1.58-5.03-3.7H.96v2.33A9 9 0 0 0 9 18Z" />
|
|
7
|
+
<path fill="#FBBC05" d="M3.97 10.72a5.4 5.4 0 0 1 0-3.44V4.95H.96a9 9 0 0 0 0 8.1l3.01-2.33Z" />
|
|
8
|
+
<path fill="#EA4335" d="M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.58C13.46.9 11.43 0 9 0A9 9 0 0 0 .96 4.95l3.01 2.33C4.68 5.16 6.66 3.58 9 3.58Z" />
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* A list of links, each with a name and an optional description. Give it the `items` array, or write the list in the default slot as a
|
|
4
|
+
* `<ul>` of links, or as a `<dl>` (`<dt>` the link, `<dd>` the description). The array wins when it has items; when it is missing or empty
|
|
5
|
+
* the slot is rendered instead.
|
|
6
|
+
* @prop {{ url: string, name: string, description?: string }[]} items the links to list
|
|
7
|
+
*/
|
|
8
|
+
</script>
|
|
9
|
+
<ul role="list" webc:root="override" webc:if="items?.length">
|
|
10
|
+
<li webc:for="item of items">
|
|
11
|
+
<h4><a :href="item.url" @text="item.name"></a></h4>
|
|
12
|
+
<p @text="item.description" webc:if="item.description"></p>
|
|
13
|
+
</li>
|
|
14
|
+
</ul>
|
|
15
|
+
<div webc:root="override" webc:else><slot></slot></div>
|
|
16
|
+
|
|
17
|
+
<style webc:scoped>
|
|
18
|
+
:host:not(:has(li, dt)) {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host,
|
|
23
|
+
:host > ul,
|
|
24
|
+
:host > dl {
|
|
25
|
+
list-style: none;
|
|
26
|
+
margin: 0;
|
|
27
|
+
padding: 0;
|
|
28
|
+
display: grid;
|
|
29
|
+
gap: calc(var(--content-space) * .5);
|
|
30
|
+
|
|
31
|
+
> dt {
|
|
32
|
+
font-weight: normal;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
> dd {
|
|
36
|
+
margin: 0;
|
|
37
|
+
color: var(--color-text-muted);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
> li {
|
|
41
|
+
font-size: 1em;
|
|
42
|
+
|
|
43
|
+
h4 {
|
|
44
|
+
font-weight: normal;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
p {
|
|
48
|
+
margin-block-start: 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* A link is an operable target: 44px tall (WCAG 2.5.5), and the rows carry the spacing. The cards variant stretches its own link. */
|
|
54
|
+
:host:not([cards]) a {
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
min-block-size: var(--target-min);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host:not([cards]),
|
|
61
|
+
:host:not([cards]) > ul,
|
|
62
|
+
:host:not([cards]) > dl {
|
|
63
|
+
gap: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([cards]),
|
|
67
|
+
:host([cards]) > ul {
|
|
68
|
+
grid-template-columns: repeat(auto-fill, minmax(min(100%, 15em), 1fr));
|
|
69
|
+
gap: var(--content-space);
|
|
70
|
+
|
|
71
|
+
@supports (grid-template-rows: subgrid) {
|
|
72
|
+
> li {
|
|
73
|
+
display: grid;
|
|
74
|
+
grid-row: span 2;
|
|
75
|
+
grid-template-rows: subgrid;
|
|
76
|
+
row-gap: 0.3em;
|
|
77
|
+
align-content: start;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
> li {
|
|
82
|
+
position: relative;
|
|
83
|
+
padding: calc(var(--content-space) * .9) var(--content-space);
|
|
84
|
+
|
|
85
|
+
background-color: var(--color-surface);
|
|
86
|
+
border: var(--thin-border-width) solid var(--color-border);
|
|
87
|
+
border-radius: var(--standard-border-radius);
|
|
88
|
+
|
|
89
|
+
color: var(--color-text-muted);
|
|
90
|
+
font-size: max(var(--base-font-size), 0.92em);
|
|
91
|
+
text-wrap: pretty;
|
|
92
|
+
|
|
93
|
+
&:has(a:hover) {
|
|
94
|
+
border-color: var(--color-accent);
|
|
95
|
+
background-color: color-mix(in sRGB, var(--color-surface-overlay) 92%, transparent);
|
|
96
|
+
|
|
97
|
+
a {
|
|
98
|
+
color: var(--color-link-hover);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:has(a:focus-visible) {
|
|
103
|
+
border-color: var(--color-accent);
|
|
104
|
+
outline: var(--focus-ring-width) solid var(--color-focus-ring);
|
|
105
|
+
outline-offset: var(--focus-ring-offset);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
a {
|
|
109
|
+
display: block;
|
|
110
|
+
margin-block-end: 0.25em;
|
|
111
|
+
|
|
112
|
+
color: var(--color-text);
|
|
113
|
+
font-size: max(var(--base-font-size), 1.2em);
|
|
114
|
+
font-weight: var(--font-weight--semi-bold);
|
|
115
|
+
text-decoration: none;
|
|
116
|
+
|
|
117
|
+
&::after {
|
|
118
|
+
content: "";
|
|
119
|
+
position: absolute;
|
|
120
|
+
inset: 0;
|
|
121
|
+
border-radius: inherit;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:focus-visible {
|
|
125
|
+
outline: none;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script webc:setup>
|
|
2
|
+
/**
|
|
3
|
+
* A titled list of links. Renders nothing when there are no items and no
|
|
4
|
+
* `empty` text.
|
|
5
|
+
* @prop {string} [title] the heading; left out when there are no items
|
|
6
|
+
* @prop {{ title: string, href?: string, note?: string, extra?: { text: string, href: string, after?: string } }[]} items the links to list; an item with no `href` is plain text
|
|
7
|
+
* @prop {string} [empty] shown, muted, when there are no items
|
|
8
|
+
*/
|
|
9
|
+
</script>
|
|
10
|
+
<div webc:root="override" class="link-section" webc:if="items?.length || empty">
|
|
11
|
+
<h3 webc:if="title && items?.length" @text="title"></h3>
|
|
12
|
+
<ul webc:if="items?.length">
|
|
13
|
+
<li webc:for="item of items">
|
|
14
|
+
<a webc:if="item.href" :href="item.href" @text="item.title"></a>
|
|
15
|
+
<span webc:if="!item.href" @text="item.title"></span>
|
|
16
|
+
<span class="muted" webc:if="item.note"> — <span @text="item.note"></span></span>
|
|
17
|
+
<template webc:nokeep webc:if="item.extra"> — <a :href="item.extra.href" @text="item.extra.text"></a><template webc:nokeep webc:if="item.extra.after"> <span @text="item.extra.after"></span></template></template>
|
|
18
|
+
</li>
|
|
19
|
+
</ul>
|
|
20
|
+
<p class="muted" webc:if="!items?.length" @text="empty"></p>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<style webc:scoped>
|
|
24
|
+
/* The page's spacing around a list and its heading, which a wrapper would otherwise reset:
|
|
25
|
+
a heading loses its top margin as the first child, and a list its bottom margin as the last. */
|
|
26
|
+
:host:not(:last-child) {
|
|
27
|
+
margin-block-end: calc(var(--content-space) * 1.5);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
h3 {
|
|
31
|
+
margin-block-start: calc(var(--content-space) * 1.75);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* A link that is the whole item is an operable target: 44px tall (WCAG 2.5.5). A link inside a sentence keeps the line. */
|
|
35
|
+
li > a:only-child {
|
|
36
|
+
display: inline-flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
min-block-size: var(--target-min);
|
|
39
|
+
}
|
|
40
|
+
</style>
|