@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.
Files changed (137) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +90 -2
  3. package/assets/fonts/instrument-sans-italic-var.woff2 +0 -0
  4. package/assets/fonts/instrument-sans-var.woff2 +0 -0
  5. package/assets/fonts/pt-mono.woff2 +0 -0
  6. package/assets/scripts/copy.js +99 -0
  7. package/assets/scripts/deck.js +161 -0
  8. package/assets/scripts/email.js +19 -0
  9. package/assets/scripts/practice.js +545 -0
  10. package/assets/scripts/theme-panel.js +647 -0
  11. package/assets/scripts/theme-restore.js +17 -0
  12. package/assets/styles/base.css +2091 -0
  13. package/assets/styles/deck.css +968 -0
  14. package/assets/styles/font.css +36 -0
  15. package/assets/styles/notes.css +137 -0
  16. package/assets/styles/print.css +428 -0
  17. package/assets/styles/semantics.css +101 -0
  18. package/components/practice/check-controls.webc +50 -0
  19. package/components/practice/choice-list.webc +86 -0
  20. package/components/practice/cite-panel.webc +108 -0
  21. package/components/practice/practice-figure.webc +47 -0
  22. package/components/practice/practice-fill.webc +154 -0
  23. package/components/practice/practice-grid.webc +82 -0
  24. package/components/practice/practice-judge.webc +165 -0
  25. package/components/practice/practice-match.webc +178 -0
  26. package/components/practice/practice-question.webc +141 -0
  27. package/components/practice/practice-selfcheck.webc +40 -0
  28. package/components/practice/practice-terms.webc +95 -0
  29. package/components/practice/practice-tree.webc +91 -0
  30. package/components/practice/practice-worksheet.webc +369 -0
  31. package/components/site/copyright.webc +13 -0
  32. package/components/site/course-documents.webc +27 -0
  33. package/components/site/course-now.webc +393 -0
  34. package/components/site/course-summary.webc +136 -0
  35. package/components/site/demo-weeks.webc +91 -0
  36. package/components/site/glossary-entry.webc +31 -0
  37. package/components/site/glossary-panel.webc +1482 -0
  38. package/components/site/glossary.webc +45 -0
  39. package/components/site/grading.webc +50 -0
  40. package/components/site/instructor.webc +432 -0
  41. package/components/site/masthead.webc +147 -0
  42. package/components/site/nav-links.webc +174 -0
  43. package/components/site/policies.webc +17 -0
  44. package/components/site/practice-index.webc +31 -0
  45. package/components/site/schedule-overview.webc +145 -0
  46. package/components/site/schedule-weeks.webc +589 -0
  47. package/components/site/site-footer.webc +119 -0
  48. package/components/site/slide-timetable.webc +152 -0
  49. package/components/site/syllabus.webc +370 -0
  50. package/components/ui/arrow-link.webc +19 -0
  51. package/components/ui/assigned-list.webc +101 -0
  52. package/components/ui/callout.webc +11 -0
  53. package/components/ui/card-list.webc +124 -0
  54. package/components/ui/codepen-embed.webc +123 -0
  55. package/components/ui/download-button.webc +49 -0
  56. package/components/ui/eyebrow.webc +18 -0
  57. package/components/ui/icons/github.webc +6 -0
  58. package/components/ui/icons/google.webc +9 -0
  59. package/components/ui/link-list.webc +130 -0
  60. package/components/ui/link-section.webc +40 -0
  61. package/components/ui/meeting-card.webc +73 -0
  62. package/components/ui/meeting-decks.webc +38 -0
  63. package/components/ui/table-rubric.webc +251 -0
  64. package/components/ui/today-link.webc +43 -0
  65. package/components/ui/today-marker.webc +149 -0
  66. package/components/ui/week-block.webc +53 -0
  67. package/examples/starter/_data/course.json +20 -0
  68. package/examples/starter/_data/dates.json +16 -0
  69. package/examples/starter/_data/grading.json +6 -0
  70. package/examples/starter/_data/instructor.json +7 -0
  71. package/examples/starter/_data/policies.json +9 -0
  72. package/examples/starter/_data/scale.json +8 -0
  73. package/examples/starter/_data/schedule.json +22 -0
  74. package/examples/starter/_data/theme.json +17 -0
  75. package/examples/starter/content/index.webc +12 -0
  76. package/examples/starter/content/schedule.webc +12 -0
  77. package/examples/starter/content/slides/index.11tydata.js +5 -0
  78. package/examples/starter/content/slides/index.webc +12 -0
  79. package/examples/starter/content/slides/week-1-day-1.md +40 -0
  80. package/examples/starter/eleventy.config.js +8 -0
  81. package/glue/deck-notes.data.js +41 -0
  82. package/glue/deck-notes.webc +32 -0
  83. package/glue/lesson-day.data.js +17 -0
  84. package/glue/lesson-day.webc +0 -0
  85. package/glue/lesson-plans.data.js +13 -0
  86. package/glue/lesson-plans.webc +2 -0
  87. package/index.js +6 -0
  88. package/layouts/base.webc +79 -0
  89. package/layouts/deck.webc +46 -0
  90. package/layouts/demo.webc +16 -0
  91. package/layouts/document.webc +10 -0
  92. package/layouts/lesson-detail.webc +109 -0
  93. package/layouts/lesson.webc +71 -0
  94. package/layouts/notes.webc +23 -0
  95. package/layouts/worksheet.webc +52 -0
  96. package/lib/assets.js +42 -0
  97. package/lib/bundles.js +79 -0
  98. package/lib/check.js +110 -0
  99. package/lib/components.js +19 -0
  100. package/lib/copy.js +656 -0
  101. package/lib/data/build.js +22 -0
  102. package/lib/data/fonts.js +16 -0
  103. package/lib/data/glossary.js +304 -0
  104. package/lib/data/index.js +8 -0
  105. package/lib/data/lessons.js +173 -0
  106. package/lib/data/project.js +22 -0
  107. package/lib/data/read.js +61 -0
  108. package/lib/data/site.js +70 -0
  109. package/lib/data/term.js +80 -0
  110. package/lib/extensions.js +70 -0
  111. package/lib/files.js +14 -0
  112. package/lib/filters.js +584 -0
  113. package/lib/fit.js +106 -0
  114. package/lib/glue.js +26 -0
  115. package/lib/lesson-materials.js +66 -0
  116. package/lib/markdown.js +568 -0
  117. package/lib/minify.js +53 -0
  118. package/lib/paths.js +5 -0
  119. package/lib/pdf.js +134 -0
  120. package/lib/plugin.js +231 -0
  121. package/lib/plugins.js +34 -0
  122. package/lib/postcss.js +93 -0
  123. package/lib/theme-server.js +88 -0
  124. package/lib/theme.js +185 -0
  125. package/lib/worksheet-dialect.js +415 -0
  126. package/lib/worksheets.js +276 -0
  127. package/package.json +119 -4
  128. package/schemas/course.schema.json +161 -0
  129. package/schemas/dates.schema.json +165 -0
  130. package/schemas/grading.schema.json +59 -0
  131. package/schemas/instructor.schema.json +76 -0
  132. package/schemas/policies.schema.json +90 -0
  133. package/schemas/project.schema.json +209 -0
  134. package/schemas/scale.schema.json +68 -0
  135. package/schemas/schedule.schema.json +260 -0
  136. package/schemas/theme.schema.json +704 -0
  137. package/schemas/worksheet.schema.json +449 -0
@@ -0,0 +1,45 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The course glossary page: every `vocab` and `api` slide as one tagged
4
+ * term, listed A to Z and enhanced into
5
+ * Review and Flashcards by `<glossary-panel>`.
6
+ * Reads the `glossary` global.
7
+ */
8
+ </script>
9
+ <article class="content-column glossary" id="glossary" webc:if="$data.glossary?.terms?.length">
10
+ <header>
11
+ <eyebrow class="separators">
12
+ <span @text="$data.term.label"></span>
13
+ <span @text="$data.course.code"></span>
14
+ <span @text="$data.copy.glossary.glossary"></span>
15
+ </eyebrow>
16
+ <h1 @text="$data.copy.glossary.courseGlossary"></h1>
17
+ <p class="intro">
18
+ <strong @text="$data.glossary.terms.length"></strong>
19
+ <span @text="fill($data.copy.glossary.termsFromClassEach, { reading: $data.glossary.readingLabel.toLowerCase() })"></span>
20
+ </p>
21
+ </header>
22
+
23
+ <glossary-panel :@json="$data.glossary.json">
24
+ <div data-static>
25
+ <section class="group" webc:for="group of $data.glossary.az" :id="`g-az-${group.key}`" :aria-labelledby="`g-az-${group.key}-h`">
26
+ <h2 class="heading" :id="`g-az-${group.key}-h`">
27
+ <span class="name" @text="group.label"></span>
28
+ <span class="aside">
29
+ <span class="count" @text="fill(plural($data.copy.glossary, 'terms', group.terms.length, $data.site.language), { count: group.terms.length })"></span>
30
+ </span>
31
+ </h2>
32
+ <dl>
33
+ <glossary-entry webc:for="item of group.terms" :@entry="item"></glossary-entry>
34
+ </dl>
35
+ </section>
36
+ </div>
37
+ </glossary-panel>
38
+ </article>
39
+
40
+ <style webc:scoped>
41
+ .intro {
42
+ color: var(--color-text-muted);
43
+ margin-block: 0;
44
+ }
45
+ </style>
@@ -0,0 +1,50 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The grade-weighting table and the grading scale. Reads the `grading` and
4
+ * `scale` data; it takes no props and renders nothing without `grading`.
5
+ */
6
+ </script>
7
+ <div webc:root="override" webc:if="$data.grading">
8
+ <table>
9
+ <caption @text="$data.copy.grading.gradeWeighting"></caption>
10
+ <thead>
11
+ <tr><th scope="col" @text="$data.copy.grading.category"></th><th scope="col" @text="$data.copy.grading.weight"></th></tr>
12
+ </thead>
13
+ <tbody>
14
+ <tr webc:for="entry of Object.entries($data.grading).filter(([key]) => key !== '$schema')">
15
+ <td @text="entry[1].title"></td>
16
+ <td @text="entry[1].weight"></td>
17
+ </tr>
18
+ </tbody>
19
+ </table>
20
+ <table>
21
+ <caption @text="$data.copy.grading.gradingScale"></caption>
22
+ <thead>
23
+ <tr><th scope="col" @text="$data.copy.grading.grade"></th><th scope="col" @text="$data.copy.grading.weightedAverage"></th></tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr webc:for="band of Object.entries($data.scale ?? {}).filter(([key]) => key !== '$schema')">
27
+ <td @text="band[0]"></td>
28
+ <td>
29
+ <span webc:if="band[1].min != null" @text="fill($data.copy.grading.andAbove, { min: band[1].min })"></span>
30
+ <span webc:else @text="fill($data.copy.grading.below, { max: band[1].max })"></span>
31
+ </td>
32
+ </tr>
33
+ </tbody>
34
+ </table>
35
+ </div>
36
+
37
+ <style webc:scoped>
38
+ :host {
39
+ display: grid;
40
+ grid-template-columns: repeat(auto-fit, minmax(min(100%, 18em), 1fr));
41
+ gap: calc(var(--content-space, 1rem) * 2);
42
+ align-items: start;
43
+
44
+ caption {
45
+ text-align: start;
46
+ font-weight: var(--font-weight--semi-bold);
47
+ padding-block-end: calc(var(--content-space, 1rem) / 2);
48
+ }
49
+ }
50
+ </style>
@@ -0,0 +1,432 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The instructor's details: photo, office, contact and hours. Reads `instructor`.
4
+ * @prop {'card'} [variant] a compact card instead of the full section
5
+ * @prop {'icons'} [contactLinks] show the email, the message link and the blog as icon links in the corner of the panel instead of rows in the fact list; the same as `contactLinks: "icons"` in `instructor.json`, and wins over it
6
+ */
7
+ /** The prop wins over the data; either one set to "icons" turns the icon links on. */
8
+ const iconsOn = (data, prop) => (prop ?? data.instructor?.contactLinks) === "icons";
9
+ const host = (url) => url.replace(/^https?:\/\//, "").replace(/\/$/, "");
10
+ </script>
11
+ <section id="instructor" aria-labelledby="instructor-heading" webc:root="override" webc:if="$data.instructor">
12
+ <template webc:nokeep webc:for="icons of [iconsOn($data, typeof contactLinks === 'undefined' ? undefined : contactLinks)]" webc:if="variant !== 'card'">
13
+ <div class="who">
14
+ <img class="photo screen-only" webc:if="$data.instructor.photo" :src="$data.instructor.photo" :alt="$data.instructor.name" width="160" height="160">
15
+ <div class="facts-column">
16
+ <h2 id="instructor-heading" @text="$data.copy.instructor.yourInstructor"></h2>
17
+ <dl class="facts">
18
+ <div class="name">
19
+ <dt class="sr-only" @text="$data.copy.instructor.name"></dt>
20
+ <dd><strong><span webc:if="!$data.instructor.profile" @text="$data.instructor.name"></span><a
21
+ webc:if="$data.instructor.profile" :href="$data.instructor.profile" @text="$data.instructor.name"></a></strong></dd>
22
+ </div>
23
+ <div webc:if="$data.instructor.office">
24
+ <dt @text="$data.copy.instructor.office"></dt>
25
+ <dd @text="$data.instructor.office"></dd>
26
+ </div>
27
+ <div webc:if="$data.instructor.hours?.length">
28
+ <dt @text="$data.copy.instructor.officeHours"></dt>
29
+ <dd>
30
+ <ul role="list">
31
+ <li webc:for="block of $data.instructor.hours" @text="block"></li>
32
+ </ul>
33
+ </dd>
34
+ </div>
35
+ <div webc:if="!icons && $data.instructor.email" :class="$data.instructor.contact ? 'print-only' : ''">
36
+ <dt @text="$data.copy.instructor.email"></dt>
37
+ <dd><a :data-email="encodeEmail($data.instructor.email)"></a></dd>
38
+ </div>
39
+ <div webc:if="!icons && $data.instructor.contact" :class="$data.instructor.email ? 'screen-only' : ''">
40
+ <dt @text="$data.copy.instructor.message"></dt>
41
+ <dd><a :href="$data.instructor.contact" @text="$data.copy.instructor.sendMeAMessage"></a></dd>
42
+ </div>
43
+ <div webc:if="!icons && $data.instructor.blog">
44
+ <dt @text="$data.copy.instructor.blog"></dt>
45
+ <dd><a :href="$data.instructor.blog" @text="$data.instructor.blog.replace(/^https?:\/\//, '').replace(/\/$/, '')"></a></dd>
46
+ </div>
47
+ </dl>
48
+ <p class="muted note" webc:if="$data.instructor.note" @text="$data.instructor.note"></p><ul class="links" role="list" :aria-label="$data.copy.instructor.contact" webc:if="icons && ($data.instructor.email || $data.instructor.contact || $data.instructor.blog)">
49
+ <li webc:if="$data.instructor.email">
50
+ <a class="icon-link" :data-email="encodeEmail($data.instructor.email)" :aria-label="$data.copy.instructor.email" :title="$data.copy.instructor.email"><svg
51
+ aria-hidden="true" focusable="false" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"></rect><path d="m3 7 9 6 9-6"></path></svg><span
52
+ class="link-text" data-email-text></span></a>
53
+ </li>
54
+ <li webc:if="$data.instructor.contact" :class="$data.instructor.email ? 'screen-only' : ''">
55
+ <a class="icon-link" :href="$data.instructor.contact" :aria-label="$data.copy.instructor.sendMeAMessage" :title="$data.copy.instructor.sendMeAMessage"><svg
56
+ aria-hidden="true" focusable="false" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z"></path></svg><span
57
+ class="link-text" @text="$data.copy.instructor.sendMeAMessage"></span></a>
58
+ </li>
59
+ <li webc:if="$data.instructor.blog">
60
+ <a class="icon-link" :href="$data.instructor.blog" :aria-label="$data.copy.instructor.blog" :title="fill($data.copy.instructor.blogUrl, { url: host($data.instructor.blog) })"><svg
61
+ aria-hidden="true" focusable="false" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"></circle><path d="M3 12h18"></path><path d="M12 3a14 14 0 0 1 0 18a14 14 0 0 1 0-18"></path></svg><span
62
+ class="link-text" @text="host($data.instructor.blog)"></span></a>
63
+ </li>
64
+ </ul>
65
+ </div>
66
+ </div>
67
+ </template>
68
+
69
+ <template webc:nokeep webc:if="variant === 'card'">
70
+ <div class="instructor-card">
71
+ <img class="photo" webc:if="$data.instructor.photo" :src="$data.instructor.photo" :alt="$data.instructor.name" width="160" height="160">
72
+ <p class="monogram" aria-hidden="true" webc:if="!$data.instructor.photo" @text="$data.instructor.name.split(' ').filter(Boolean).map((part) => part[0]).join('')"></p>
73
+ <div>
74
+ <h2 id="instructor-heading" class="instructor-name"><span
75
+ webc:if="!$data.instructor.profile" @text="$data.instructor.name"></span><a
76
+ webc:if="$data.instructor.profile" :href="$data.instructor.profile" @text="$data.instructor.name"></a></h2>
77
+ <p class="instructor-meta separators">
78
+ <span @text="$data.copy.instructor.instructor"></span>
79
+ <span webc:if="$data.instructor.office" @text="$data.instructor.office"></span>
80
+ <span webc:if="$data.instructor.hours?.length" @text="$data.instructor.hours.join('; ')"></span>
81
+ </p>
82
+ <p class="instructor-contact" webc:if="$data.instructor.contact || $data.instructor.email || $data.instructor.blog">
83
+ <a webc:if="$data.instructor.contact" :href="$data.instructor.contact" :class="$data.instructor.email ? 'cta screen-only' : 'cta'" @text="$data.copy.instructor.sendMeAMessage"></a>
84
+ <a webc:if="$data.instructor.email" :data-email="encodeEmail($data.instructor.email)" :class="$data.instructor.contact ? 'print-only' : ''"></a>
85
+ <a webc:if="$data.instructor.blog" class="cta" :href="$data.instructor.blog" @text="$data.instructor.blog.replace(/^https?:\/\//, '').replace(/\/$/, '')"></a>
86
+ </p>
87
+ <p class="muted note" @text="$data.instructor.note" webc:if="$data.instructor.note"></p>
88
+ </div>
89
+ </div>
90
+ </template>
91
+ </section>
92
+
93
+ <style webc:scoped>
94
+ /* Default variant: the headshot beside a small labelled fact list — name,
95
+ office, hours, email, blog, rather than a sentence, so each fact has a
96
+ place a student can scan to. print.css collapses the same dl to one
97
+ run-in line (its `#instructor dl` rules), so the markup serves both. */
98
+ :host .who {
99
+ display: flex;
100
+ align-items: flex-start;
101
+ gap: calc(var(--content-space) * 1.1);
102
+
103
+ @media print {
104
+ display: block;
105
+ }
106
+ }
107
+
108
+ :host .facts-column {
109
+ min-inline-size: 0;
110
+ flex: 1 1 auto;
111
+ }
112
+
113
+ :host .facts-column h2 {
114
+ margin-block: 0 0.35em;
115
+ font-size: var(--font-size-6);
116
+ font-weight: var(--font-weight--semi-bold);
117
+ letter-spacing: 0.08em;
118
+ text-transform: uppercase;
119
+ color: var(--color-text-muted);
120
+ }
121
+
122
+ :host .facts {
123
+ display: grid;
124
+ grid-template-columns: max-content minmax(0, 1fr);
125
+ column-gap: var(--content-space);
126
+ row-gap: 0.3em;
127
+ margin: 0;
128
+
129
+ > div {
130
+ display: contents;
131
+ }
132
+
133
+ /* `display: contents` outranks the utility classes, so restate them
134
+ for rows that appear on one medium only. */
135
+ > div.print-only {
136
+ display: none;
137
+ }
138
+
139
+ dt {
140
+ color: var(--color-text-muted);
141
+ font-size: var(--font-size-6);
142
+ letter-spacing: 0.05em;
143
+ text-transform: uppercase;
144
+ line-height: var(--font-height);
145
+ padding-block-start: 0.15em;
146
+ }
147
+
148
+ dd {
149
+ margin: 0;
150
+ }
151
+
152
+ ul {
153
+ list-style: none;
154
+ margin: 0;
155
+ padding: 0;
156
+ }
157
+
158
+ .name dd {
159
+ grid-column: 1 / -1;
160
+ font-size: var(--font-size-4);
161
+ line-height: var(--font-height--dense);
162
+ margin-block-end: 0.35em;
163
+ }
164
+
165
+ @media print {
166
+ display: inline;
167
+ }
168
+ }
169
+
170
+ :host .note {
171
+ margin-block: 0.75em 0;
172
+ font-size: max(var(--base-font-size), 0.9em);
173
+ }
174
+
175
+ :host .photo {
176
+ flex: none;
177
+ inline-size: 5.5em;
178
+ block-size: 5.5em;
179
+ border-radius: var(--circle-border-radius);
180
+ object-fit: cover;
181
+ border: var(--thin-border-width) solid var(--color-border);
182
+ }
183
+
184
+ :host .instructor-contact {
185
+ margin-block: 0;
186
+ }
187
+
188
+ :host .instructor-card {
189
+ display: flex;
190
+ align-items: flex-start;
191
+ gap: var(--content-space);
192
+ max-inline-size: min(60ch, 100%);
193
+ margin-inline: auto;
194
+ padding: calc(var(--content-space) * 1.2);
195
+
196
+ background-color: var(--color-surface);
197
+ border: var(--thin-border-width) solid var(--color-border);
198
+ border-radius: var(--standard-border-radius);
199
+ }
200
+
201
+ :host .instructor-card .photo {
202
+ inline-size: 4em;
203
+ block-size: 4em;
204
+ }
205
+
206
+ /* Initials rather than a photograph: it identifies the card at a glance
207
+ without another asset to keep current. Decorative — the name is right
208
+ beside it, so it stays out of the accessibility tree. */
209
+ :host .monogram {
210
+ flex: none;
211
+ display: grid;
212
+ place-items: center;
213
+ inline-size: 2.75em;
214
+ block-size: 2.75em;
215
+ margin: 0;
216
+
217
+ background-color: var(--color-surface-accent);
218
+ border-radius: 50%;
219
+ color: var(--color-accent-text);
220
+ font-weight: var(--font-weight--semi-bold);
221
+ }
222
+
223
+ :host .instructor-name {
224
+ margin-block: 0 0.15em;
225
+ font-size: max(var(--base-font-size), 1.15em);
226
+ }
227
+
228
+ :host .instructor-meta {
229
+ margin-block: 0 0.75em;
230
+ color: var(--color-text-muted);
231
+ font-size: max(var(--base-font-size), 0.92em);
232
+ }
233
+
234
+ :host .cta {
235
+ color: var(--color-link);
236
+ }
237
+
238
+ /* The address is an operable target: 44px tall (WCAG 2.5.5). */
239
+ :host a[data-email] {
240
+ display: inline-flex;
241
+ align-items: center;
242
+ min-block-size: var(--target-min);
243
+ /* The address breaks at its <wbr>s; this is the last resort for one unbreakable token. */
244
+ overflow-wrap: anywhere;
245
+ min-inline-size: 0;
246
+ }
247
+
248
+ /* On a phone the card and the fact list stack, and their children may shrink below their content. */
249
+ :host .instructor-card > *,
250
+ :host .who > * {
251
+ min-inline-size: 0;
252
+ }
253
+
254
+ @media screen and (width < 30em) {
255
+ :host .instructor-card,
256
+ :host .who {
257
+ flex-direction: column;
258
+ }
259
+
260
+ :host .facts {
261
+ grid-template-columns: minmax(0, 1fr);
262
+ }
263
+
264
+ :host .facts dt {
265
+ padding-block-start: 0.4em;
266
+ }
267
+ }
268
+
269
+ /* print.css collapses the facts to one inline run by id selector; match
270
+ its specificity to drop a screen-only row. */
271
+ @media print {
272
+ :host#instructor .facts > div.screen-only {
273
+ display: none;
274
+ }
275
+ }
276
+ </style>
277
+
278
+ <style>
279
+ /* Icon links (`contactLinks: "icons"`): the email, the message link and the
280
+ blog as 44px circles beside the "Your instructor" heading, at the top
281
+ right of the panel. They follow the facts in the source, so print, which
282
+ drops the photo and runs the facts into one line, reads facts first and
283
+ then the address and the host in place of the icons. Plain selectors,
284
+ not the scoped block above: that block is what every other site renders. */
285
+ /* The heading and the icons share the first line; when the column is too
286
+ narrow for both, the icons wrap onto a line of their own, still at the
287
+ right. The facts and the note take full lines. `order` puts the icons
288
+ after the heading on screen while they follow the facts in the source. */
289
+ #instructor .facts-column:has(> .links) {
290
+ display: flex;
291
+ flex-wrap: wrap;
292
+ align-items: center;
293
+ column-gap: var(--content-space);
294
+
295
+ @media print {
296
+ display: block;
297
+ }
298
+ }
299
+
300
+ #instructor .facts-column:has(> .links) > h2 {
301
+ flex: 1 1 auto;
302
+ margin-block: 0;
303
+ }
304
+
305
+ #instructor .facts-column:has(> .links) > .facts {
306
+ flex: 1 1 100%;
307
+ order: 2;
308
+ margin-block-start: 0.35em;
309
+ }
310
+
311
+ #instructor .facts-column:has(> .links) > .note {
312
+ flex: 1 1 100%;
313
+ order: 3;
314
+ }
315
+
316
+ #instructor .links {
317
+ flex: none;
318
+ order: 1;
319
+ margin: 0 0 0 auto;
320
+ padding: 0;
321
+ display: flex;
322
+ gap: 0.5em;
323
+ list-style: none;
324
+
325
+ @media print {
326
+ display: inline;
327
+ }
328
+ }
329
+
330
+ #instructor .links > li {
331
+ margin: 0;
332
+ padding: 0;
333
+
334
+ @media print {
335
+ display: inline;
336
+
337
+ &::before {
338
+ content: " · ";
339
+ }
340
+
341
+ /* The message link stands in for the address on screen only. */
342
+ &.screen-only {
343
+ display: none;
344
+ }
345
+ }
346
+ }
347
+
348
+ #instructor .icon-link {
349
+ position: relative;
350
+ display: inline-flex;
351
+ align-items: center;
352
+ justify-content: center;
353
+ box-sizing: border-box;
354
+ /* An operable target: 44px each way (WCAG 2.5.5), the icon 24px inside it. */
355
+ inline-size: var(--target-min);
356
+ block-size: var(--target-min);
357
+ aspect-ratio: auto;
358
+ border: var(--thin-border-width) solid var(--color-border-strong);
359
+ border-radius: var(--circle-border-radius);
360
+ color: var(--color-link);
361
+ text-decoration: none;
362
+
363
+ &:is(:hover, :focus-visible) {
364
+ border-color: var(--color-link);
365
+ background-color: var(--color-surface-accent);
366
+ text-decoration: none;
367
+ }
368
+
369
+ /* base.css gives an svg without a size a full-width, 2.5em-tall box and a currentColor fill. These carry a width, a height and fill="none"; say so
370
+ again for any rule that is looser. */
371
+ svg {
372
+ flex: none;
373
+ inline-size: 24px;
374
+ block-size: 24px;
375
+ min-block-size: 0;
376
+ fill: none;
377
+ }
378
+
379
+ @media print {
380
+ display: inline;
381
+ inline-size: auto;
382
+ block-size: auto;
383
+ border: none;
384
+ border-radius: 0;
385
+ color: inherit;
386
+ text-decoration: underline;
387
+
388
+ svg {
389
+ display: none;
390
+ }
391
+ }
392
+ }
393
+
394
+ /* The address, the message label or the host behind each icon: clipped on
395
+ screen, where the aria-label names the link, and printed in place of
396
+ the icon. It stays in the text, so find-in-page and copy reach it. */
397
+ @media screen {
398
+ #instructor .link-text {
399
+ position: absolute;
400
+ inline-size: 1px;
401
+ block-size: 1px;
402
+ overflow: hidden;
403
+ clip-path: inset(50%);
404
+ white-space: nowrap;
405
+ }
406
+ }
407
+
408
+ @media (forced-colors: active) {
409
+ #instructor .icon-link {
410
+ border-color: LinkText;
411
+ }
412
+
413
+ #instructor .icon-link:is(:hover, :focus-visible) {
414
+ border-color: Highlight;
415
+ }
416
+ }
417
+ </style>
418
+
419
+ <script>
420
+ for (const link of document.querySelectorAll("a[data-email]")) {
421
+ const email = atob(link.dataset.email);
422
+ link.href = `mailto:${email}`;
423
+ // An icon link keeps its svg and writes the address into its own text slot.
424
+ const target = link.querySelector("[data-email-text]") ?? link;
425
+ if (target.textContent.trim()) continue;
426
+ // Break opportunities before "@" and after each ".": a narrow screen wraps the address there, not mid-word.
427
+ email.split(/(?=@)|(?<=\.)/).forEach((part, index) => {
428
+ if (index) target.append(document.createElement("wbr"));
429
+ target.append(part);
430
+ });
431
+ }
432
+ </script>
@@ -0,0 +1,147 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The page header: institution, term, course title and the navigation. Reads `site`, `term` and `course`.
4
+ * The menu is Home, Syllabus, then every page of the site menu that has not set `menu: false`.
5
+ */
6
+ const navItems = (() => {
7
+ const items = eleventyNavigation($data.collections.all);
8
+ const home = items.find((item) => item.url === "/");
9
+ const rest = items.filter((item) => item.url !== "/");
10
+ return [...(home ? [home] : []), { url: "/#syllabus", title: $data.copy.nav.syllabus }, ...rest.filter((item) => item.menu !== false)];
11
+ })();
12
+ </script>
13
+ <header webc:root="override" id="header">
14
+ <div class="container">
15
+ <div class="identity">
16
+ <eyebrow class="separators">
17
+ <span @text="$data.site.institution"></span>
18
+ <span @text="$data.term.label"></span>
19
+ </eyebrow>
20
+ <h1 class="course-title" webc:if="$data.page.url === '/'">
21
+ <a href="/" aria-current="page"><span class="code" @text="$data.course.code"></span> <span class="name" @text="$data.course.name"></span></a>
22
+ </h1>
23
+ <p class="course-title" webc:else>
24
+ <a href="/"><span class="code" @text="$data.course.code"></span> <span class="name" @text="$data.course.name"></span></a>
25
+ </p>
26
+ <p class="meta separators" webc:if="$data.schedule?.meetings?.days?.length">
27
+ <span @text="$data.schedule.meetings.days.length > 1 ? `${$data.schedule.meetings.days.slice(0, -1).join(', ')} & ${$data.schedule.meetings.days.at(-1)}` : $data.schedule.meetings.days[0]"></span>
28
+ <span webc:if="$data.schedule.meetings.time" @text="$data.schedule.meetings.time"></span>
29
+ <span webc:if="$data.instructor?.office" @text="$data.instructor.office"></span>
30
+ </p>
31
+ </div>
32
+ <div class="links">
33
+ <nav-links column :aria-label="$data.copy.nav.site" @context="hero" :@navigation="navItems"></nav-links>
34
+ </div>
35
+ </div>
36
+ </header>
37
+
38
+ <style webc:scoped>
39
+ /* A hero, not a bar: the course identity at full size on the left, the
40
+ site's internal links stacked on the right. It scrolls away with the
41
+ page — nothing is sticky — so anchor targets need no offset. */
42
+ :host {
43
+ /* base.css's `body > header { grid-column: 1 / -1; }` is what keeps
44
+ this full-bleed; everything else about the plain banner treatment is
45
+ overridden here. */
46
+ text-align: start;
47
+ padding: 0;
48
+
49
+ /* A soft wash of the course accent that has faded fully into the page
50
+ surface by the bottom edge, so the band needs no closing rule. */
51
+ background: linear-gradient(
52
+ to bottom,
53
+ color-mix(in sRGB, var(--color-accent) 7%, var(--color-page)),
54
+ var(--color-page)
55
+ );
56
+
57
+ @media print {
58
+ display: none;
59
+ }
60
+
61
+ > .container {
62
+ box-sizing: border-box;
63
+ /* Match the content column (`--page-column`, set on body). */
64
+ inline-size: var(--page-column);
65
+ margin-inline: auto;
66
+ margin-block: 0;
67
+ padding-inline: 0;
68
+ padding-block: calc(var(--section-space) * 1.25) var(--section-space);
69
+
70
+ display: grid;
71
+ grid-template-columns: minmax(0, 1fr) auto;
72
+ column-gap: calc(var(--section-space) * 2);
73
+ row-gap: var(--content-space);
74
+ align-items: start;
75
+
76
+ @media screen and (width <= 768px) {
77
+ grid-template-columns: minmax(0, 1fr);
78
+ padding-block: var(--section-space) calc(var(--section-space) * 0.75);
79
+ }
80
+ }
81
+
82
+ .identity {
83
+ display: grid;
84
+ gap: calc(var(--content-space) * 0.6);
85
+
86
+ > * {
87
+ margin: 0;
88
+ max-inline-size: none;
89
+ }
90
+ }
91
+
92
+ .course-title {
93
+ margin: 0;
94
+ max-inline-size: none;
95
+ font-family: var(--display-font);
96
+ font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.75rem);
97
+ font-weight: var(--font-weight--semi-bold);
98
+ line-height: 1.1;
99
+ letter-spacing: -0.01em;
100
+ text-wrap: balance;
101
+
102
+ a {
103
+ color: var(--color-text);
104
+ text-decoration: none;
105
+
106
+ &:is(:hover, :focus-visible) .name {
107
+ text-decoration: underline;
108
+ text-decoration-thickness: 0.06em;
109
+ text-underline-offset: 0.12em;
110
+ text-decoration-color: var(--color-accent);
111
+ }
112
+ }
113
+
114
+ .code {
115
+ display: block;
116
+ font-size: 0.5em;
117
+ font-weight: var(--font-weight--semi-bold);
118
+ letter-spacing: 0.06em;
119
+ color: var(--color-accent-text);
120
+ margin-block-end: 0.2em;
121
+ }
122
+ }
123
+
124
+ .meta {
125
+ margin: 0;
126
+ color: var(--color-text-muted);
127
+ font-size: max(var(--base-font-size), 0.95em);
128
+ }
129
+
130
+ .links {
131
+ display: flex;
132
+ align-items: start;
133
+ gap: calc(var(--content-space) * 1.5);
134
+ padding-inline-start: calc(var(--section-space) * 1.25);
135
+ border-inline-start: var(--thin-border-width) solid var(--color-border);
136
+
137
+ @media screen and (width <= 768px) {
138
+ inline-size: 100%;
139
+ justify-content: space-between;
140
+ padding-inline-start: 0;
141
+ padding-block-start: var(--content-space);
142
+ border-inline-start: none;
143
+ border-block-start: var(--thin-border-width) solid var(--color-border);
144
+ }
145
+ }
146
+ }
147
+ </style>