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
This commit is contained in:
George Cushen committed 2026-04-08 18:19:15 +01:00
1 parent 117881f658
commit a955161dbb
14 files changed
+10 -41

No files matched your search

@@ -2,8 +2,8 @@
@layer components {
/* Section styles for Hugo Blox blocks */
.hbb-section {
padding-top: 6rem;
padding-bottom: 6rem;
padding-top: var(--hb-spacing-section, 6rem);
padding-bottom: var(--hb-spacing-section, 6rem);
}
.section-subheading {
@@ -148,7 +148,7 @@
{{ $hb_layout := $hb.layout | default dict }}
{{ $layout := dict
"radius" ($hb_layout.radius | default "md")
"spacing" ($hb_layout.spacing | default "comfortable")
"spacing" ($hb_layout.spacing | default "spacious")
}}
{{/* Return theme config dict */}}
@@ -28,9 +28,9 @@
{{ end }}
{{/* Map spacing tokens to CSS values */}}
{{ $spacing := .layout.spacing | default "comfortable" }}
{{ $spacing_base := "1rem" }}
{{ $spacing_section := "4rem" }}
{{ $spacing := .layout.spacing | default "spacious" }}
{{ $spacing_base := "1.25rem" }}
{{ $spacing_section := "6rem" }}
{{ if eq $spacing "compact" }}
{{ $spacing_base = "0.75rem" }}
{{ $spacing_section = "2.5rem" }}
@@ -41,7 +41,7 @@
{{ $spacing_base = "1.25rem" }}
{{ $spacing_section = "6rem" }}
{{ else }}
{{ warnf "LAYOUT TOKEN WARNING: Unknown spacing value '%s'. Expected: compact | comfortable | spacious. Falling back to 'comfortable'." $spacing }}
{{ warnf "LAYOUT TOKEN WARNING: Unknown spacing value '%s'. Expected: compact | comfortable | spacious. Falling back to 'spacious'." $spacing }}
{{ end }}
<style>
@@ -70,7 +70,7 @@ hugoblox:
# Border radius: 'none', 'sm', 'md', 'lg', or 'full'
radius: "md"
# Spacing density: 'compact', 'comfortable', or 'spacious'
spacing: "comfortable"
spacing: "spacious"
# Avatar shape in author profiles
avatar_shape: circle # circle | square | rounded
-4
View File
@@ -5,10 +5,6 @@ summary: ''
date: 2022-10-24
type: landing
design:
# Default section spacing
spacing: '6rem'
sections:
- block: resume-biography-3
content:
@@ -3,10 +3,6 @@ title: 'Projects'
date: 2024-05-19
type: landing
design:
# Section spacing
spacing: '5rem'
# Page sections
sections:
- block: collection
@@ -5,10 +5,6 @@ summary: ''
date: 2026-01-05
type: landing
design:
# Default section spacing
spacing: '0'
sections:
# Developer Hero - Gradient background with name, role, social, and CTAs
- block: dev-hero
@@ -3,10 +3,6 @@ title: 'Projects'
date: 2024-05-19
type: landing
design:
# Section spacing
spacing: '5rem'
# Page sections
sections:
- block: collection
@@ -70,7 +70,7 @@ hugoblox:
# Border radius: 'none', 'sm', 'md', 'lg', or 'full'
radius: "md"
# Spacing density: 'compact', 'comfortable', or 'spacious'
spacing: "comfortable"
spacing: "spacious"
# Avatar shape in author profiles
avatar_shape: circle # circle | square | rounded
@@ -3,10 +3,6 @@ title: 'Home'
date: 2023-10-24
type: landing
design:
# Default section spacing
spacing: "6rem"
sections:
- block: hero
content:
@@ -4,9 +4,6 @@ summary: ''
date: 2025-01-01
type: landing
design:
spacing: '4rem'
sections:
# Hero Section
- block: hero
-4
View File
@@ -3,10 +3,6 @@ title: 'Home'
date: 2023-10-24
type: landing
design:
# Default section spacing
spacing: '4rem'
# Note: `username` refers to the user's folder name in `content/authors/`
# Page sections
@@ -80,7 +80,7 @@ hugoblox:
# Border radius: 'none', 'sm', 'md', 'lg', or 'full'
radius: "md"
# Spacing density: 'compact', 'comfortable', or 'spacious'
spacing: "comfortable"
spacing: "spacious"
# Avatar shape in author profiles
avatar_shape: circle # circle | square | rounded
@@ -3,10 +3,6 @@ title: 'Home'
date: 2023-10-24
type: landing
design:
# Default section spacing
spacing: "6rem"
sections:
- block: hero
content: