From 20df47e1e97789ac392bf01ee026949fcbdbe2ea Mon Sep 17 00:00:00 2001 From: Vinta Chen Date: Sun, 3 May 2026 00:30:56 +0800 Subject: [PATCH] style(website): add CSS for category-breadcrumb and assert absence on parent Mirrors the .category-subtitle a underline style for visual cohesion in the hero, and locks in the gating behavior with a negative assertion so a regression that drops the page_kind guard would be caught. Co-Authored-By: Claude Opus 4.7 (1M context) --- website/static/style.css | 17 +++++++++++++++++ website/tests/test_build.py | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/website/static/style.css b/website/static/style.css index b4ceffa3..f0a1bc8f 100644 --- a/website/static/style.css +++ b/website/static/style.css @@ -462,6 +462,23 @@ kbd { text-wrap: balance; } +.category-breadcrumb { + margin: 0 0 1rem; + color: var(--hero-muted); + font-size: clamp(1rem, 1.5vw, 1.1rem); +} + +.category-breadcrumb a { + color: var(--hero-text); + text-decoration: underline; + text-decoration-color: oklch(100% 0 0 / 0.32); + text-underline-offset: 0.2em; +} + +.category-breadcrumb a:hover { + text-decoration-color: oklch(100% 0 0 / 0.7); +} + .category-subtitle { max-width: 68ch; margin-top: 1.1rem; diff --git a/website/tests/test_build.py b/website/tests/test_build.py index 7fb9c274..7122e255 100644 --- a/website/tests/test_build.py +++ b/website/tests/test_build.py @@ -604,6 +604,10 @@ class TestBuild: assert 'href="/categories/web-frameworks/"' in sync assert "Web Frameworks" in sync assert "

Synchronous

" in sync + assert "category-breadcrumb" in sync + + parent = (site / "categories" / "web-frameworks" / "index.html").read_text(encoding="utf-8") + assert "category-breadcrumb" not in parent def test_build_creates_group_pages(self, tmp_path): readme = textwrap.dedent("""\