@allons-y/course-kit 0.0.0-stage → 0.1.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 +17 -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 +2090 -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 +269 -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 +217 -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 +653 -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 +46 -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 +228 -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 +118 -4
  128. package/schemas/course.schema.json +156 -0
  129. package/schemas/dates.schema.json +165 -0
  130. package/schemas/grading.schema.json +59 -0
  131. package/schemas/instructor.schema.json +68 -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,119 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The page footer: course, institution, term, copyright and the links. Reads `course`, `site` and `term`.
4
+ */
5
+ </script>
6
+ <div webc:root="override">
7
+ <div class="brand">
8
+ <p class="course"><a href="/"><span @text="$data.course.code"></span>: <span @text="$data.course.name"></span></a></p>
9
+ <p class="meta separators">
10
+ <span @text="$data.site.institution"></span>
11
+ <span @text="$data.term.label"></span>
12
+ </p>
13
+ <copyright></copyright>
14
+ </div>
15
+ <div class="group">
16
+ <p class="label" id="footer-pages" @text="$data.copy.siteFooter.pages"></p>
17
+ <nav-links column aria-labelledby="footer-pages" @context="footer" :@navigation="eleventyNavigation($data.collections.all)"></nav-links>
18
+ </div>
19
+ <nav class="group" aria-labelledby="footer-policies" webc:if="$data.policies">
20
+ <p class="label" id="footer-policies" @text="$data.copy.siteFooter.policies"></p>
21
+ <ul role="list">
22
+ <li webc:for="(key, policy) in Object.fromEntries(Object.entries($data.policies).filter(([name]) => name !== '$schema'))">
23
+ <a :href="policy.href?.startsWith('/') ? policy.href : `/#policy-${key}`" @text="policy.title"></a>
24
+ </li>
25
+ </ul>
26
+ </nav>
27
+ </div>
28
+
29
+ <style webc:scoped>
30
+ /* Three groups: who and when, where to go, what the rules are. The policy
31
+ links point at the landing page's policy disclosures (each carries a
32
+ `policy-<key>` id) except where a policy has its own page on this site. */
33
+ :host {
34
+ --context: footer;
35
+
36
+ text-align: start;
37
+ display: grid;
38
+ grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
39
+ gap: var(--section-space) calc(var(--section-space) * 1.5);
40
+ align-items: start;
41
+
42
+ @media screen and (width <= 768px) {
43
+ grid-template-columns: minmax(0, 1fr);
44
+ gap: var(--section-space);
45
+ }
46
+
47
+ .brand {
48
+ display: grid;
49
+ gap: calc(var(--content-space) * 0.4);
50
+ }
51
+
52
+ .course {
53
+ margin: 0;
54
+ max-inline-size: none;
55
+ font-weight: var(--font-weight--semi-bold);
56
+
57
+ a {
58
+ color: var(--color-text);
59
+ text-decoration: none;
60
+
61
+ &:is(:hover, :focus-visible) {
62
+ color: var(--color-link-hover);
63
+ }
64
+ }
65
+ }
66
+
67
+ .meta {
68
+ margin: 0;
69
+ color: var(--color-text-muted);
70
+ font-size: max(var(--base-font-size), 0.85em);
71
+ }
72
+
73
+ .label {
74
+ margin: 0 0 calc(var(--content-space) * 0.5);
75
+ font-size: var(--font-size-6);
76
+ font-weight: var(--font-weight--semi-bold);
77
+ letter-spacing: 0.08em;
78
+ text-transform: uppercase;
79
+ color: var(--color-text-muted);
80
+ }
81
+
82
+ ul {
83
+ list-style: none;
84
+ margin: 0;
85
+ padding: 0;
86
+
87
+ display: flex;
88
+ flex-direction: column;
89
+ align-items: start;
90
+ gap: 0;
91
+
92
+ @media screen and (width <= 768px) {
93
+ flex-direction: row;
94
+ flex-wrap: wrap;
95
+ align-items: center;
96
+ column-gap: calc(var(--content-space) * 1.25);
97
+ row-gap: 0;
98
+ }
99
+ }
100
+
101
+ li {
102
+ font-size: 1em;
103
+ }
104
+
105
+ nav.group a,
106
+ .course a {
107
+ display: inline-flex;
108
+ align-items: center;
109
+ min-block-size: var(--target-min);
110
+ font-size: max(var(--base-font-size), 1em);
111
+ color: inherit;
112
+ text-decoration: none;
113
+
114
+ &:is(:hover, :focus-visible) {
115
+ color: var(--color-link-hover);
116
+ }
117
+ }
118
+ }
119
+ </style>
@@ -0,0 +1,152 @@
1
+ <script webc:setup>
2
+ /**
3
+ * Every slide deck as a timetable: one row per week, one column per meeting
4
+ * day.
5
+ * @prop {{ days: string[], weeks: object[] }} [timetable] `slideTimetable`
6
+ * output; built from the page's decks, lessons and meeting days when left out
7
+ */
8
+ const defaultTimetable = slideTimetable($data.collections?.deck, $data.lessons, $data.schedule?.meetings?.days);
9
+ </script>
10
+ <table webc:root="override" class="slide-timetable" data-today-host="timetable" webc:if="(timetable ?? defaultTimetable)?.weeks?.length">
11
+ <today-marker></today-marker>
12
+ <caption class="sr-only" @text="$data.copy.slideTimetable.everySlideDeckFor"></caption>
13
+ <thead>
14
+ <tr>
15
+ <th scope="col" @text="$data.copy.slideTimetable.week"></th>
16
+ <th scope="col" webc:for="day of (timetable ?? defaultTimetable).days" @text="day"></th>
17
+ </tr>
18
+ </thead>
19
+ <tbody>
20
+ <tr webc:for="week of (timetable ?? defaultTimetable).weeks">
21
+ <th scope="row">
22
+ <span class="week-title" @text="fill($data.copy.schedule.weekHeading, { week: week.week })"></span>
23
+ <span class="week-of" @text="week.dates"></span>
24
+ </th>
25
+ <td webc:for="cell of week.cells" :data-day="cell.weekday" :data-date="cell.iso">
26
+ <p class="empty" webc:if="cell.missing" @text="$data.copy.slideTimetable.noMeeting"></p>
27
+ <p class="empty no-class" webc:if="cell.noClass" @text="fill($data.copy.slideTimetable.noClass, { reason: cell.noClass })"></p>
28
+ <template webc:nokeep webc:if="!cell.missing && !cell.noClass">
29
+ <p class="date" @text="cell.date"></p>
30
+ <p class="deck-title" webc:if="cell.deck"><arrow-link :href="cell.deck.url"><span @text="cell.deck.title"></span></arrow-link></p>
31
+ <p class="empty" webc:if="!cell.deck" @text="$data.copy.slideTimetable.noDeck"></p>
32
+ <p class="draft" webc:if="cell.deck?.draft" @text="$data.copy.slideTimetable.draftNotInThe"></p>
33
+ <p class="notes" webc:if="cell.deck && $data.audience.instructor"><a :href="cell.deck.notesUrl" @text="$data.copy.slideTimetable.speakerNotes"></a></p>
34
+ <p class="deck-title" webc:if="cell.addendum"><arrow-link :href="cell.addendum.url"><span @text="cell.addendum.title"></span></arrow-link></p>
35
+ <p class="draft" webc:if="cell.addendum?.draft" @text="$data.copy.slideTimetable.addendumDraftNotIn"></p>
36
+ <p class="notes" webc:if="cell.addendum && $data.audience.instructor"><a :href="cell.addendum.notesUrl" @text="$data.copy.slideTimetable.addendumSpeakerNotes"></a></p>
37
+ </template>
38
+ </td>
39
+ </tr>
40
+ </tbody>
41
+ </table>
42
+
43
+ <style webc:scoped>
44
+ /* A timetable: every week is one row of identical shape, one cell per
45
+ meeting weekday, so the eye can read down a column or across a row
46
+ and nothing leaves a hole. On narrow screens each row becomes a week
47
+ band with its cells stacked beneath, the weekday restored as a label. */
48
+ :host {
49
+ inline-size: 100%;
50
+ border-collapse: separate;
51
+ border-spacing: 0;
52
+ border: var(--thin-border-width) solid var(--color-border);
53
+ border-radius: var(--standard-border-radius);
54
+ overflow: hidden;
55
+ margin-block: 0;
56
+ }
57
+
58
+ :host :is(th, td) {
59
+ border: 0;
60
+ border-block-start: var(--thin-border-width) solid var(--color-border);
61
+ padding: 0.7em 1em;
62
+ text-align: start;
63
+ vertical-align: top;
64
+ }
65
+
66
+ :host thead th {
67
+ border-block-start: 0;
68
+ border-block-end: var(--border-width) solid var(--color-accent);
69
+ background-color: var(--color-surface);
70
+ font-weight: var(--font-weight--semi-bold);
71
+ }
72
+
73
+ :host tbody th {
74
+ inline-size: 11em;
75
+ background-color: var(--color-surface);
76
+ font-weight: var(--font-weight);
77
+ }
78
+
79
+ :host tbody td + td {
80
+ border-inline-start: var(--thin-border-width) solid var(--color-border);
81
+ }
82
+
83
+ :host .week-title {
84
+ display: block;
85
+ font-weight: var(--font-weight--semi-bold);
86
+ }
87
+
88
+ :host .week-of,
89
+ :host .date,
90
+ :host .empty,
91
+ :host .draft,
92
+ :host .notes {
93
+ color: var(--color-text-muted);
94
+ font-size: max(var(--base-font-size), 0.9em);
95
+ }
96
+
97
+ :host .week-of {
98
+ display: block;
99
+ }
100
+
101
+ :host td p {
102
+ margin: 0;
103
+ }
104
+
105
+ :host .deck-title {
106
+ margin-block-start: 0.15em;
107
+ font-size: max(var(--base-font-size), 1.05em);
108
+ }
109
+
110
+ :host .draft,
111
+ :host .notes {
112
+ margin-block-start: 0.25em;
113
+ }
114
+
115
+ @media screen and (width <= 640px) {
116
+ :host,
117
+ :host tbody,
118
+ :host tr,
119
+ :host th,
120
+ :host td {
121
+ display: block;
122
+ }
123
+
124
+ :host thead {
125
+ position: absolute;
126
+ inline-size: 1px;
127
+ block-size: 1px;
128
+ overflow: hidden;
129
+ clip-path: inset(50%);
130
+ white-space: nowrap;
131
+ }
132
+
133
+ :host tbody th {
134
+ inline-size: auto;
135
+ border-block-end: var(--border-width) solid var(--color-accent);
136
+ }
137
+
138
+ :host tbody tr + tr th {
139
+ border-block-start: var(--thin-border-width) solid var(--color-border);
140
+ }
141
+
142
+ :host tbody td + td {
143
+ border-inline-start: 0;
144
+ }
145
+
146
+ :host td::before {
147
+ content: attr(data-day);
148
+ display: block;
149
+ font-weight: var(--font-weight--semi-bold);
150
+ }
151
+ }
152
+ </style>
@@ -0,0 +1,217 @@
1
+ <script webc:setup>
2
+ /**
3
+ * The syllabus: outcomes, text, technology, coursework and grading. Reads
4
+ * the `course`, `grading`, `scale`, `schedule` and `project` data; it takes
5
+ * no props.
6
+ */
7
+ const course = $data.course ?? {};
8
+ const copy = $data.copy.syllabus;
9
+ /** The project's due date and time: "Thursday, December 3, 2026, 11:59PM". */
10
+ const projectWhen = (project) => (project.dueTime ? fill(copy.projectDue, { date: fullDate(project.due), time: timeOfDay(project.dueTime) }) : fullDate(project.due));
11
+ const escape = (text) => String(text).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
12
+ /** "Full requirements, milestone dates, and the grading rubric are on the project page." with the link in place. */
13
+ const projectPage = (project) => fill(copy.projectPage, { link: `<a href="${escape(project?.url ?? "/projects/final/")}">${escape(copy.projectPageLink)}</a>` });
14
+ </script>
15
+ <section id="syllabus" aria-labelledby="syllabus-heading" webc:root="override">
16
+ <h2 id="syllabus-heading" @text="copy.syllabus"></h2>
17
+
18
+ <article>
19
+ <h3 @text="copy.learningOutcomes"></h3>
20
+ <p @text="copy.uponCompletingThisCourse"></p>
21
+ <ul>
22
+ <li webc:for="outcome of course.outcomes" @text="outcome"></li>
23
+ </ul>
24
+ </article>
25
+
26
+ <article webc:if="course.additionalOutcomes?.length">
27
+ <h3 id="additional-outcomes" @text="copy.additionalOutcomesInThis"></h3>
28
+ <ul>
29
+ <li webc:for="outcome of course.additionalOutcomes" @text="outcome"></li>
30
+ </ul>
31
+ </article>
32
+
33
+ <article>
34
+ <h3 @text="copy.text"></h3>
35
+ <p webc:if="!course.textbook?.required" @text="copy.noTextIsRequired"></p>
36
+ <p webc:if="course.textbook?.required"><strong @text="copy.required"></strong> <span @text="course.textbook.required"></span></p>
37
+ <ol webc:if="course.textbook?.access?.length">
38
+ <li webc:for="step of course.textbook.access" @raw="step"></li>
39
+ </ol>
40
+ </article>
41
+
42
+ <article>
43
+ <h3 @text="copy.technology"></h3>
44
+ <p><span @text="fill(copy.bringALaptopMeeting, { institution: $data.site.institution || copy.theCollege })"></span> <span webc:for="req of course.requirements ?? []" @text="req"></span> <span webc:if="$data.grading?.homework" @text="fill(copy.accessIsRequired, { lms: $data.site.lms })"></span></p>
45
+ </article>
46
+
47
+ <article webc:if="$data.grading">
48
+ <h3 id="coursework" @text="copy.coursework"></h3>
49
+ <div class="course-item" webc:for="entry of Object.entries($data.grading).filter(([key]) => key !== '$schema')">
50
+ <h4><span @text="entry[1].title"></span> <span class="weight screen-only" webc:if="entry[1].weight" @text="entry[1].weight"></span></h4>
51
+ <p @text="expandTokens(entry[1].body, $data)"></p>
52
+ <template webc:nokeep webc:if="entry[0] === 'final' && $data.schedule?.finalExam">
53
+ <p><strong @text="copy.exam"></strong> <span @text="examSlot($data.schedule.finalExam)"></span></p>
54
+ <callout :type="'warn'" webc:if="$data.schedule.finalExam?.note">
55
+ <p @text="$data.schedule.finalExam.note"></p>
56
+ </callout>
57
+ </template>
58
+ <template webc:nokeep webc:if="entry[0] === 'project'">
59
+ <p>
60
+ <strong @text="copy.due"></strong>
61
+ <span webc:if="$data.project?.due" @text="`${projectWhen($data.project)}.`"></span><span webc:if="!$data.project?.due" @text="`${fill(copy.atTheLastClassMeeting, { lastMeeting: lastMeeting($data.lessons) })}.`"></span>
62
+ </p>
63
+ <p @raw="projectPage($data.project)"></p>
64
+ <ul class="print-only" webc:if="$data.projectStages">
65
+ <li webc:for="stage of $data.projectStages.components">
66
+ <strong @text="stage.name"></strong> — <span @text="fill(copy.points, { display: stage.display, points: stage.points })"></span>
67
+ </li>
68
+ </ul>
69
+ </template>
70
+ </div>
71
+ </article>
72
+
73
+ <article webc:if="$data.grading">
74
+ <h3 id="grading" @text="copy.grading"></h3>
75
+ <grading></grading>
76
+ </article>
77
+
78
+ <article webc:if="$data.term.keyDates?.length">
79
+ <h3 id="key-dates" @text="copy.keyDates"></h3>
80
+ <ul>
81
+ <li webc:for="item of $data.term.keyDates"><strong @text="item.label"></strong><span class="print-only"> — </span><span @text="item.display"></span></li>
82
+ <li webc:if="$data.schedule?.finalExam"><strong @text="copy.thisSectionsFinalExam"></strong><span class="print-only"> — </span><span @text="examSlot($data.schedule.finalExam)"></span></li>
83
+ </ul>
84
+ </article>
85
+ </section>
86
+
87
+ <style>
88
+ #syllabus article {
89
+ border: none;
90
+ border-radius: 0;
91
+ padding: 0;
92
+ margin-block-end: 0;
93
+ }
94
+
95
+ /* Screen layout only: a single stacked column with a reading measure,
96
+ coursework as a card grid with the weight on each card, and key dates
97
+ as a stacked list. print.css keeps its own hooks (`#syllabus > article`,
98
+ `#coursework ~ div`, `#grading`, `#key-dates`), none of which this
99
+ markup changes. */
100
+ @media screen {
101
+ /* The section's row-gap is the only vertical rhythm between
102
+ articles: each article's first heading and last block drop their
103
+ own outer margins so nothing stacks on top of the gap. */
104
+ #syllabus {
105
+ display: grid;
106
+ row-gap: var(--section-space);
107
+ }
108
+
109
+ #syllabus > h2 {
110
+ margin-block-end: 0;
111
+ }
112
+
113
+ #syllabus > article > :first-child {
114
+ margin-block-start: 0;
115
+ }
116
+
117
+ #syllabus > article > :last-child {
118
+ margin-block-end: 0;
119
+ }
120
+
121
+ #syllabus > article > :where(p, ul, ol) {
122
+ max-inline-size: 70ch;
123
+ }
124
+
125
+ /* Cards wrap as a centered flex row rather than a grid, so a short
126
+ last row (two cards under three) is centered instead of hugging
127
+ the left; each card is capped at a third of the row so the
128
+ widths still match across rows. */
129
+ #syllabus article:has(> #coursework) {
130
+ display: flex;
131
+ flex-wrap: wrap;
132
+ justify-content: center;
133
+ gap: var(--content-space);
134
+ }
135
+
136
+ #coursework {
137
+ flex: 1 0 100%;
138
+ margin-block-end: 0;
139
+ }
140
+
141
+ #coursework ~ .course-item {
142
+ flex: 1 1 20em;
143
+ max-inline-size: calc((100% - 2 * var(--content-space)) / 3);
144
+
145
+ @media (width <= 60em) {
146
+ max-inline-size: none;
147
+ }
148
+ }
149
+
150
+ #coursework ~ .course-item {
151
+ box-sizing: border-box;
152
+ display: flex;
153
+ flex-direction: column;
154
+ padding: calc(var(--content-space) * 1.1);
155
+ border: var(--thin-border-width) solid var(--color-border);
156
+ border-radius: var(--standard-border-radius);
157
+
158
+ h4 {
159
+ display: flex;
160
+ flex-wrap: wrap;
161
+ align-items: baseline;
162
+ justify-content: space-between;
163
+ gap: 0.25em 0.75em;
164
+ margin-block: 0 0.5em;
165
+ }
166
+
167
+ /* Flex items do not collapse margins, so paragraphs keep only
168
+ their bottom margin. */
169
+ > p {
170
+ margin-block-start: 0;
171
+ }
172
+
173
+ p:last-child {
174
+ margin-block-end: 0;
175
+ }
176
+
177
+ /* A callout sits at the foot of its card, so the cards in a
178
+ row line up. */
179
+ .callout {
180
+ margin-block: auto 0;
181
+ }
182
+ }
183
+
184
+ #coursework ~ .course-item .weight {
185
+ flex: none;
186
+ padding: 0.1em 0.6em;
187
+ border-radius: var(--pill-border-radius);
188
+ background-color: var(--color-surface-accent);
189
+ color: var(--color-accent-text);
190
+ font-size: var(--font-size-6);
191
+ font-weight: var(--font-weight--semi-bold);
192
+ letter-spacing: 0.03em;
193
+ }
194
+
195
+ #key-dates + ul {
196
+ list-style: none;
197
+ margin: 0;
198
+ padding: 0;
199
+
200
+ li {
201
+ display: flex;
202
+ flex-wrap: wrap;
203
+ gap: 0 0.75em;
204
+ padding-block: 0.4em;
205
+ border-block-start: var(--thin-border-width) solid var(--color-border);
206
+ }
207
+
208
+ li > strong {
209
+ flex: 0 1 22em;
210
+ }
211
+
212
+ li > span:last-child {
213
+ color: var(--color-text-muted);
214
+ }
215
+ }
216
+ }
217
+ </style>
@@ -0,0 +1,19 @@
1
+ <script webc:setup>
2
+ /**
3
+ * A link with a trailing arrow. The label is the slot; `href` and any
4
+ * other attribute pass through to the `<a>`.
5
+ */
6
+ </script>
7
+ <a webc:root="override" class="arrow"><slot></slot> <span aria-hidden="true">→</span></a>
8
+
9
+ <style webc:scoped>
10
+ :host {
11
+ color: var(--color-accent-text);
12
+ text-decoration: none;
13
+ font-weight: var(--font-weight--medium);
14
+
15
+ &:is(:hover, :focus-visible) {
16
+ text-decoration: underline;
17
+ }
18
+ }
19
+ </style>
@@ -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>