Files
school_compare/nextjs-app/components/ComparisonView.module.css
T
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

263 lines
5.0 KiB
CSS

.container {
width: 100%;
}
/* Header */
.header {
margin-bottom: 2rem;
}
.headerContent {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 2rem;
flex-wrap: wrap;
}
.header h1 {
font-size: 2.25rem;
font-weight: 700;
color: var(--text-primary);
margin-bottom: 0.5rem;
font-family: var(--font-display);
}
.subtitle {
font-size: 1rem;
color: var(--text-secondary);
margin: 0;
line-height: 1.6;
max-width: 60ch;
}
.headerActions {
display: flex;
gap: 0.75rem;
align-items: center;
flex-wrap: wrap;
}
/* Phase Tabs */
.phaseTabs {
display: flex;
gap: 0;
margin-bottom: 1.5rem;
border: 1px solid var(--border);
border-radius: 8px;
overflow: hidden;
width: fit-content;
}
.phaseTab {
padding: 0.625rem 1.5rem;
font-size: 0.9375rem;
font-weight: 500;
background: var(--bg-card);
color: var(--text-secondary);
border: none;
cursor: pointer;
transition: all 0.15s ease;
font-family: inherit;
}
.phaseTab:not(:last-child) {
border-right: 1px solid var(--border);
}
.phaseTab:hover {
background: var(--bg-secondary);
}
.phaseTabActive {
background: var(--brand-strong);
color: var(--brand-on);
font-weight: 600;
}
.phaseTabActive:hover {
background: var(--brand-stronger);
}
/* Sticky school bar — column identity while scrolling; horizontal scroll on
narrow screens. Offset by the sticky site header's height (Navigation is
position: sticky, top: 0) so this bar pins just below it instead of
sliding underneath and being hidden. Header ≈ 65px desktop / 57px mobile. */
.schoolBar {
position: sticky;
top: 65px;
z-index: 10;
background: var(--bg-primary);
display: flex;
gap: 0.75rem;
overflow-x: auto;
padding: 0.75rem 0;
border-bottom: 1px solid var(--border);
-webkit-overflow-scrolling: touch;
}
.schoolChip {
flex: 1 1 0;
min-width: 180px;
background: var(--bg-card);
border: 1px solid var(--border);
border-top: 3px solid var(--brand);
border-radius: 8px;
box-shadow: var(--shadow-soft, 0 2px 8px rgba(var(--shadow-rgb), 0.06));
padding: 0.55rem 0.75rem;
display: flex;
gap: 0.55rem;
align-items: center;
}
.chipDot {
width: 11px;
height: 11px;
border-radius: 50%;
flex: none;
}
.chipText {
min-width: 0;
}
.chipName {
display: block;
font-weight: 600;
font-size: 0.92rem;
line-height: 1.25;
color: var(--text-primary);
text-decoration: none;
}
.chipName:hover {
color: var(--brand-strong);
}
/* Full name on desktop, short name on the compact mobile pills. */
.chipNameShort {
display: none;
}
.chipMeta {
display: block;
font-size: 0.78rem;
color: var(--text-muted);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* Caption filling the label rail on desktop ("Comparing / 3 primary
schools"). Hidden on mobile, where the bar is a row of compact pills. */
.barCaption {
display: none;
}
/* Desktop (matches the sections' 761px breakpoint): the bar adopts the same
grid template as compareSections' .grid — a 200px row-label rail plus one
column per school — so each chip sits exactly over the column it labels.
The caption occupies the rail; chips flow into the school columns. */
@media (min-width: 761px) {
.schoolBar {
display: grid;
grid-template-columns: 200px repeat(var(--school-count, 3), 1fr);
gap: 0 0.75rem;
overflow-x: visible;
}
.schoolChip {
min-width: 0;
}
.barCaption {
grid-column: 1;
display: flex;
flex-direction: column;
justify-content: center;
gap: 0.1rem;
padding-right: 0.5rem;
min-width: 0;
}
.barCaptionEyebrow {
font-size: 0.72rem;
font-weight: 600;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--text-muted);
}
.barCaptionCount {
font-size: 0.95rem;
font-weight: 600;
line-height: 1.3;
color: var(--text-primary);
}
}
.chipRemove {
margin-left: auto;
border: none;
background: var(--bg-secondary);
color: var(--text-muted);
border-radius: 50%;
width: 22px;
height: 22px;
cursor: pointer;
flex: none;
font-size: 0.9rem;
line-height: 1;
}
.footnote {
font-size: 0.78rem;
color: var(--text-muted);
margin-top: 2.5rem;
border-top: 1px solid var(--border);
padding-top: 1rem;
max-width: 75ch;
}
/* Mobile: the sticky school bar becomes compact, horizontally-scrollable
pills with short names (matching the mobile mockup) instead of full-width
cards whose names wrap to several lines. */
@media (max-width: 640px) {
/* The mobile Navigation header is shorter (≈57px). */
.schoolBar {
top: 57px;
}
.schoolChip {
flex: 0 0 auto;
min-width: 0;
border-top-width: 2px;
border-radius: 999px;
padding: 0.35rem 0.7rem;
box-shadow: none;
}
.chipName {
font-size: 0.85rem;
white-space: nowrap;
}
.chipNameFull {
display: none;
}
.chipNameShort {
display: inline;
}
.chipMeta {
display: none;
}
.chipRemove {
width: 18px;
height: 18px;
font-size: 0.75rem;
}
}