Skip to content

Commit a955161

Browse files
committed
fix(spacing): connect section spacing to design token system
Wire .hbb-section to var(--hb-spacing-section) instead of hardcoded 6rem, enabling hugoblox.layout.spacing (compact/comfortable/spacious) to take effect. - Default to "spacious" (6rem) to preserve existing visual layouts - Per-section override via design.spacing.padding still works (inline > class) - Remove dead design.spacing frontmatter field from all templates - Set correct layout.spacing token in each template's params.yaml Closes #3314
1 parent 117881f commit a955161

14 files changed

Lines changed: 10 additions & 41 deletions

File tree

modules/blox/assets/css/framework/components.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
@layer components {
33
/* Section styles for Hugo Blox blocks */
44
.hbb-section {
5-
padding-top: 6rem;
6-
padding-bottom: 6rem;
5+
padding-top: var(--hb-spacing-section, 6rem);
6+
padding-bottom: var(--hb-spacing-section, 6rem);
77
}
88

99
.section-subheading {

modules/blox/layouts/_partials/functions/get_theme_config.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
{{ $hb_layout := $hb.layout | default dict }}
149149
{{ $layout := dict
150150
"radius" ($hb_layout.radius | default "md")
151-
"spacing" ($hb_layout.spacing | default "comfortable")
151+
"spacing" ($hb_layout.spacing | default "spacious")
152152
}}
153153

154154
{{/* Return theme config dict */}}

modules/blox/layouts/_partials/functions/layout_tokens.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828
{{ end }}
2929

3030
{{/* Map spacing tokens to CSS values */}}
31-
{{ $spacing := .layout.spacing | default "comfortable" }}
32-
{{ $spacing_base := "1rem" }}
33-
{{ $spacing_section := "4rem" }}
31+
{{ $spacing := .layout.spacing | default "spacious" }}
32+
{{ $spacing_base := "1.25rem" }}
33+
{{ $spacing_section := "6rem" }}
3434
{{ if eq $spacing "compact" }}
3535
{{ $spacing_base = "0.75rem" }}
3636
{{ $spacing_section = "2.5rem" }}
@@ -41,7 +41,7 @@
4141
{{ $spacing_base = "1.25rem" }}
4242
{{ $spacing_section = "6rem" }}
4343
{{ else }}
44-
{{ warnf "LAYOUT TOKEN WARNING: Unknown spacing value '%s'. Expected: compact | comfortable | spacious. Falling back to 'comfortable'." $spacing }}
44+
{{ warnf "LAYOUT TOKEN WARNING: Unknown spacing value '%s'. Expected: compact | comfortable | spacious. Falling back to 'spacious'." $spacing }}
4545
{{ end }}
4646

4747
<style>

templates/academic-cv/config/_default/params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ hugoblox:
7070
# Border radius: 'none', 'sm', 'md', 'lg', or 'full'
7171
radius: "md"
7272
# Spacing density: 'compact', 'comfortable', or 'spacious'
73-
spacing: "comfortable"
73+
spacing: "spacious"
7474
# Avatar shape in author profiles
7575
avatar_shape: circle # circle | square | rounded
7676

templates/academic-cv/content/_index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ summary: ''
55
date: 2022-10-24
66
type: landing
77

8-
design:
9-
# Default section spacing
10-
spacing: '6rem'
11-
128
sections:
139
- block: resume-biography-3
1410
content:

templates/academic-cv/content/projects/_index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ title: 'Projects'
33
date: 2024-05-19
44
type: landing
55

6-
design:
7-
# Section spacing
8-
spacing: '5rem'
9-
106
# Page sections
117
sections:
128
- block: collection

templates/dev-portfolio/content/_index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ summary: ''
55
date: 2026-01-05
66
type: landing
77

8-
design:
9-
# Default section spacing
10-
spacing: '0'
11-
128
sections:
139
# Developer Hero - Gradient background with name, role, social, and CTAs
1410
- block: dev-hero

templates/dev-portfolio/content/projects/_index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ title: 'Projects'
33
date: 2024-05-19
44
type: landing
55

6-
design:
7-
# Section spacing
8-
spacing: '5rem'
9-
106
# Page sections
117
sections:
128
- block: collection

templates/documentation/config/_default/params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ hugoblox:
7070
# Border radius: 'none', 'sm', 'md', 'lg', or 'full'
7171
radius: "md"
7272
# Spacing density: 'compact', 'comfortable', or 'spacious'
73-
spacing: "comfortable"
73+
spacing: "spacious"
7474
# Avatar shape in author profiles
7575
avatar_shape: circle # circle | square | rounded
7676

templates/documentation/content/_index.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ title: 'Home'
33
date: 2023-10-24
44
type: landing
55

6-
design:
7-
# Default section spacing
8-
spacing: "6rem"
9-
106
sections:
117
- block: hero
128
content:

0 commit comments

Comments
 (0)