Files
school_compare/nextjs-app/components/PerformanceChart.module.css
TudorandClaude Opus 5 8ab0ac0a04
PR Checks / Frontend Typecheck + Tests (pull_request) Successful in 1m6s
PR Checks / Backend Smoke (pull_request) Successful in 7s
PR Checks / Build Backend (no push) (pull_request) Successful in 12s
PR Checks / Build Frontend (no push) (pull_request) Successful in 49s
PR Checks / Build Pipeline (no push) (pull_request) Successful in 10s
PR Checks / AI Code Review (Claude) (pull_request) Failing after 3m13s
feat(design): adopt the Cohort identity — new palette, type, mark and dark theme
Implements the direction agreed from the identity board: Route C ("Cohort")
with the paper ground from C1, the Schibsted Grotesk / Literata pairing from
C2, and the iris accent from C3. Dark theme is in scope from the start rather
than retrofitted.

The audit found three things wrong beyond taste:

* No brand asset set. og:image was absent entirely, so every link shared into
  a class WhatsApp group rendered as a bare grey card. apple-touch-icon pointed
  at an SVG, which iOS ignores, and the manifest shipped no PNGs, so Android
  installs had no icon. The header mark and the favicon had also drifted into
  two different logos.
* No colour discipline. --primary and --trend-down were the same coral, so the
  main CTA and "below average" shared a hue. 58 distinct hex values were spread
  across component CSS, and the chart palette was still Chart.js's stock demo
  colours.
* A dark theme that was declared but never built — themeColor announced a dark
  variant with no dark styling behind it.

What changed:

Colour now has exactly three jobs that never borrow each other's hues: brand
(iris) for interactive and identity, status (teal/amber) for above/below a
comparison point, and phase for categories. Teal/amber rather than green/red
keeps the above/below signal readable for every form of colour blindness.
Every chromatic literal in component CSS is now a token, and the JS-painted
surfaces (Chart.js, Leaflet) read the tokens through lib/theme so they follow
the theme instead of ignoring it.

The mark is the five-bar cohort spread — the same object as the distribution
strip inside a school row, built from opacity steps so it inverts cleanly.
components/Logo.tsx is the single source; the favicon, apple-icon and share
card all derive from its geometry.

globals.css drops 123 dead global classes left over from the vanilla-JS app
(only the btn family, .skip-link and .main were still referenced), along with
the noise overlay. It also gains prefers-reduced-motion support, which was
missing entirely, and a type scale so the 54 ad-hoc font sizes have somewhere
to converge.

Verified: tsc clean, 159 unit tests pass, production build succeeds and
prerenders /icon.svg, /apple-icon and /opengraph-image. Three e2e journeys
added for the asset set, the themeColor/background match, and the dark theme
actually repainting — all silent failures that nothing on the page reveals.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-06 12:13:04 +01:00

143 lines
3.2 KiB
CSS

.chartOuter {
display: flex;
flex-direction: column;
gap: 0.75rem;
/* Fill the parent .chartContainer (which carries the height) so the
canvas wrapper below can take 100% of a real number. Without this,
.chartOuter auto-sizes to content and the canvas falls back to
Chart.js's tiny default — leaving empty space below the chart. */
height: 100%;
}
.trendSummary {
font-size: 0.875rem;
font-weight: 600;
color: var(--text-secondary);
padding: 0.5rem 0.875rem;
background: var(--bg-secondary);
border-left: 3px solid var(--brand);
border-radius: 0 4px 4px 0;
align-self: flex-start;
}
.chartWrapper {
width: 100%;
/* flex:1 instead of height:100% so the trend banner / chip strip
above can take their natural size and the canvas fills the rest of
the .chartOuter column. min-height:0 keeps flex from refusing to
shrink the canvas below its content size. */
flex: 1 1 auto;
min-height: 0;
position: relative;
}
.covidNote,
.chartHint {
font-size: 0.75rem;
color: var(--text-muted);
margin: 0;
font-style: italic;
}
/* ── Mobile chip selector ────────────────────────────────────────────
Hidden on desktop. Replaces the in-chart legend on phones — one
metric at a time so the line variation is actually readable. */
.mobileChips {
display: none;
}
.mobileSubtitle {
font-size: 0.7rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--text-muted);
margin-bottom: 0.4rem;
}
.chipRow {
display: flex;
flex-wrap: wrap;
gap: 0.375rem;
}
.chip {
border: 1px solid var(--border);
background: var(--bg-card);
color: var(--text-secondary);
padding: 0.4rem 0.75rem;
border-radius: 999px;
font-size: 0.8125rem;
font-weight: 500;
font-family: inherit;
cursor: pointer;
white-space: nowrap;
transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
-webkit-tap-highlight-color: transparent;
}
.chip:active {
background: var(--bg-secondary);
}
.chip:disabled {
opacity: 0.45;
cursor: not-allowed;
}
.chipActive {
background: var(--brand-strong);
color: var(--brand-on);
border-color: var(--brand);
font-weight: 600;
}
.chipActive:active {
background: var(--brand-strong);
}
.miniLegend {
display: flex;
gap: 0.875rem;
font-size: 0.75rem;
color: var(--text-secondary);
margin-top: -0.25rem;
}
.miniLegend span {
display: inline-flex;
align-items: center;
gap: 0.3rem;
}
.miniDot {
display: inline-block;
width: 8px;
height: 8px;
border-radius: 50%;
}
@media (max-width: 768px) {
.chartWrapper {
font-size: 0.875rem;
}
}
@media (max-width: 640px) {
.mobileChips {
display: block;
}
/* Canvas needs an explicit height now that the parent .chartContainer
flows naturally (its old fixed 220px was clipping the chip strip and
pushing the disclosure link onto the plot area). */
.chartWrapper {
height: 220px;
}
/* The desktop "click the legend to show progress" hint is irrelevant
once the chip row is the disclosure mechanism. */
.chartHint {
display: none;
}
}