Skip to content

Commit 5e18c9d

Browse files
committed
Refactor v3 hero into one tokenized component
Merges the home, community, and library/release heroes into a single .hero base with per-page modifiers and one heading style, splits the mascot foreground from the background so each scales independently across breakpoints, and drives all the responsive sizing through tokens set once per tier. Hero image URLs move out of the templates and into the page views, and the duplicated absolute-header rules collapse into one body.v3 .header rule. Also brings the hero link buttons' line-height and letter-spacing to the Figma spec, which closes the remaining open item on #2367.
1 parent c40f9d5 commit 5e18c9d

18 files changed

Lines changed: 742 additions & 607 deletions

ak/views.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,20 @@ def get_v3_context_data(self, **kwargs):
186186

187187
ctx["build_anything_with_boost"] = SharedResources.build_anything_with_boost
188188

189-
ctx["hero_legacy_image_url_light"] = SharedResources.hero_legacy_image_url_light
190-
ctx["hero_legacy_image_url_dark"] = SharedResources.hero_legacy_image_url_dark
191-
ctx["hero_image_url"] = SharedResources.hero_image_url
192-
ctx["hero_image_url_light"] = SharedResources.hero_image_url_light
193-
ctx["hero_image_url_dark"] = SharedResources.hero_image_url_dark
189+
# Hero foreground/background swapped with the community hero (see
190+
# CommunityView): home now shows the community scene and vice versa.
191+
home_foreground = large_static("img/v3/community-page/community-foreground.png")
192+
ctx["hero_image_url"] = home_foreground
193+
ctx["hero_image_url_light"] = home_foreground
194+
ctx["hero_image_url_dark"] = home_foreground
195+
# Mobile art-direction: a tightly-trimmed foreground so it isn't letterboxed
196+
# on narrow screens. Desktop/tablet keep the wide foreground above.
197+
ctx["hero_image_url_mobile"] = large_static(
198+
"img/v3/community-page/community-foreground-mobile.png"
199+
)
200+
ctx["hero_background_image_url"] = large_static(
201+
"img/v3/community-page/community-background.png"
202+
)
194203
return ctx
195204

196205

core/mock_data.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,10 @@ class SharedResources:
424424
hero_image_url_light = large_static("img/v3/home-page/home-page-foreground.png")
425425
hero_image_url_dark = large_static("img/v3/home-page/home-page-foreground.png")
426426

427+
hero_background_image_url = large_static(
428+
"img/v3/home-page/home-page-background.png"
429+
)
430+
427431
library_about_code = (
428432
"int main()\n"
429433
"{\n"

core/views.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,18 @@ def get_v3_context_data(self, **kwargs):
347347
ctx["archive_url"] = (
348348
"https://lists.boost.org/archives/list/boost@lists.boost.org/latest"
349349
)
350+
# Hero foreground/background swapped with the home hero (see HomeView):
351+
# community now shows the home scene and vice versa.
352+
ctx["hero_image_url"] = large_static(
353+
"img/v3/home-page/home-page-foreground.png"
354+
)
355+
# Mobile art-direction: a tighter crop swapped in via <picture> at <=767px.
356+
ctx["hero_image_url_mobile"] = large_static(
357+
"img/v3/home-page/home-page-foreground-mobile.png"
358+
)
359+
ctx["hero_background_image_url"] = large_static(
360+
"img/v3/home-page/home-page-background.png"
361+
)
350362
return ctx
351363

352364

static/css/v3/auth-page.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
Dependencies: foundations, forms, buttons.
66
*/
77

8-
/* ── Header overlay on auth pages ─────────── */
9-
body:has(.auth-page) .header {
10-
position: absolute;
11-
z-index: 10;
12-
left: 0;
13-
right: 0;
14-
}
15-
168
/* ── Page-level flex column ───────────────── */
179
.auth-page {
1810
display: flex;

static/css/v3/buttons.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@
231231
font-family: var(--font-sans);
232232
font-size: var(--font-size-small);
233233
font-weight: var(--font-weight-medium);
234+
/* Pin line-height + letter-spacing to the Figma button spec (17.36px / -0.14px
235+
at the 14px size) instead of inheriting the page defaults (16.8px / -0.16px). */
236+
line-height: var(--line-height-relaxed);
237+
letter-spacing: var(--letter-spacing-tight);
234238
color: var(--color-text-primary);
235239
background-color: var(--color-surface-weak);
236240
border: 1px solid var(--color-stroke-weak);

static/css/v3/community.css

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,8 @@
33
* BEM naming, semantic tokens with fallbacks.
44
*/
55

6-
/* ── Navbar overlays hero (matches homepage pattern) ──────────── */
7-
8-
body:has(.community-v3) .header {
9-
position: absolute;
10-
z-index: 10;
11-
left: 0;
12-
right: 0;
13-
}
6+
/* Hero styling (including the full-bleed .hero-fg foreground) lives in heros.css
7+
under `.hero--community`, set via the template's extra_classes. */
148

159
/* ── Page container (below full-bleed hero) ───────────────────── */
1610

static/css/v3/header.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,19 @@
2222
color: var(--color-text-primary);
2323
}
2424

25+
/* Consistent header positioning on all v3 pages.
26+
Header overlays the top of the page; non-hero pages reserve space below. */
27+
body.v3 .header {
28+
position: absolute;
29+
z-index: 10;
30+
left: 0;
31+
right: 0;
32+
}
33+
34+
body.v3 .v3-container > .w-full {
35+
padding-top: calc(var(--header-height, 48px) + 2 * var(--space-medium));
36+
}
37+
2538
/* ── Shared control surface ────────────────────── */
2639

2740
.header__nav--desktop,

0 commit comments

Comments
 (0)