From bfff24fa5f7b23c6ac970ed4fd81d46974133a66 Mon Sep 17 00:00:00 2001 From: Tudor Sitaru Date: Tue, 14 Apr 2026 14:31:31 +0100 Subject: [PATCH] style(detail): apply hero card style to Pupils & Inclusion Renames the RWM-specific .rwmHero* classes to generic .heroStat* and reuses them on the three Pupils & Inclusion headline cards (disadvantaged, EAL, SEN support). Grid switches to auto-fit to accommodate both 2- and 3-card layouts. SEN primary-need breakdown stays on the dense .metricCard style. Co-Authored-By: Claude Opus 4.6 --- .../components/SchoolDetailView.module.css | 21 +++++---- nextjs-app/components/SchoolDetailView.tsx | 44 +++++++++---------- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/nextjs-app/components/SchoolDetailView.module.css b/nextjs-app/components/SchoolDetailView.module.css index a45a3cb..addf1d6 100644 --- a/nextjs-app/components/SchoolDetailView.module.css +++ b/nextjs-app/components/SchoolDetailView.module.css @@ -323,15 +323,18 @@ font-style: italic; } -/* ── RWM hero cards (combined + exceeding) ── */ -.rwmHeroGrid { +/* ── Hero stat cards (RWM combined, Pupils & Inclusion, etc.) ── */ +/* Larger teal-tinted cards with Playfair serif numbers — reserved for + the top-of-section headline metrics. Use .metricCard for denser + secondary metrics. */ +.heroStatGrid { display: grid; - grid-template-columns: 1fr 1fr; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.85rem; margin-bottom: 0.25rem; } -.rwmHeroCard { +.heroStatCard { background: var(--accent-teal-bg, rgba(45, 125, 125, 0.12)); border: 1px solid rgba(45, 125, 125, 0.2); border-radius: 12px; @@ -342,7 +345,7 @@ text-align: left; } -.rwmHeroLabel { +.heroStatLabel { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; @@ -354,7 +357,7 @@ line-height: 1.3; } -.rwmHeroValue { +.heroStatValue { font-family: var(--font-playfair), "Playfair Display", Georgia, serif; font-size: 2.1rem; font-weight: 700; @@ -367,7 +370,7 @@ justify-content: flex-start; } -.rwmHeroHint { +.heroStatHint { font-size: 0.7rem; color: var(--text-muted, #6d685f); font-style: normal; @@ -375,11 +378,11 @@ } @media (max-width: 480px) { - .rwmHeroGrid { + .heroStatGrid { grid-template-columns: 1fr; } - .rwmHeroValue { + .heroStatValue { font-size: 1.85rem; } } diff --git a/nextjs-app/components/SchoolDetailView.tsx b/nextjs-app/components/SchoolDetailView.tsx index f28d583..497fefa 100644 --- a/nextjs-app/components/SchoolDetailView.tsx +++ b/nextjs-app/components/SchoolDetailView.tsx @@ -515,14 +515,14 @@ export function SchoolDetailView({ {/* ── Primary / KS2 content ── */} {hasKS2Results && ( <> -
+
{latestResults.rwm_expected_pct !== null && ( -
-
+
+
Reading, Writing & Maths combined
-
+
{formatPercentage(latestResults.rwm_expected_pct)} {primaryAvg.rwm_expected_pct != null && ( {primaryAvg.rwm_expected_pct != null && ( -
National avg: {primaryAvg.rwm_expected_pct.toFixed(0)}%
+
National avg: {primaryAvg.rwm_expected_pct.toFixed(0)}%
)}
)} {latestResults.rwm_high_pct !== null && ( -
-
+
+
Exceeding expected level (Reading, Writing & Maths)
-
+
{formatPercentage(latestResults.rwm_high_pct)} {primaryAvg.rwm_high_pct != null && ( {primaryAvg.rwm_high_pct != null && ( -
National avg: {primaryAvg.rwm_high_pct.toFixed(0)}%
+
National avg: {primaryAvg.rwm_high_pct.toFixed(0)}%
)}
)} @@ -871,50 +871,50 @@ export function SchoolDetailView({ {hasInclusionData && (

Pupils & Inclusion

-
+
{latestResults?.disadvantaged_pct != null && ( -
-
Eligible for pupil premium
-
+
+
Eligible for pupil premium
+
{formatPercentage(latestResults.disadvantaged_pct)} {primaryAvg.disadvantaged_pct != null && ( )}
-
Pupils from disadvantaged backgrounds{primaryAvg.disadvantaged_pct != null ? ` · national avg: ${primaryAvg.disadvantaged_pct.toFixed(0)}%` : ''}
+
Pupils from disadvantaged backgrounds{primaryAvg.disadvantaged_pct != null ? ` · national avg: ${primaryAvg.disadvantaged_pct.toFixed(0)}%` : ''}
)} {latestResults?.eal_pct != null && ( -
-
+
+
English as an additional language
-
+
{formatPercentage(latestResults.eal_pct)} {primaryAvg.eal_pct != null && ( )}
{primaryAvg.eal_pct != null && ( -
National avg: {primaryAvg.eal_pct.toFixed(0)}%
+
National avg: {primaryAvg.eal_pct.toFixed(0)}%
)}
)} {latestResults?.sen_support_pct != null && ( -
-
+
+
Pupils receiving SEN support
-
+
{formatPercentage(latestResults.sen_support_pct)} {primaryAvg.sen_support_pct != null && ( )}
{primaryAvg.sen_support_pct != null && ( -
National avg: {primaryAvg.sen_support_pct.toFixed(0)}%
+
National avg: {primaryAvg.sen_support_pct.toFixed(0)}%
)}
)}