Skip to content

feat(styles): make the cover section height configurable - #2108

Merged
markdumay merged 1 commit into
mainfrom
feat/section-height-params
Aug 2, 2026
Merged

feat(styles): make the cover section height configurable#2108
markdumay merged 1 commit into
mainfrom
feat/section-height-params

Conversation

@markdumay

Copy link
Copy Markdown
Collaborator

Fixes #2107.

Analysis

cover: true was working. A cover section is 88vh, not 100vh — the reporter's screenshot measures out to exactly that.

_styles.scss:62 --section-height: 88vh
_styles.scss:86 main:has(section:first-of-type.section-cover) { margin-top: var(--overlay-offset) }
_styles.scss:124 .section-cover { min-height: calc(var(--section-height) - var(--overlay-offset)) }

Total = overlay-offset + (88vh − overlay-offset) = 88vh, independent of navbar height. Measuring the reported screenshot: viewport 1900×1031, hero/next-section boundary at y=907 → 87.97%. --max-section-height: 1024px shrinks that share further from xxl upwards and above 1400px tall.

Not a regression — git diff v3.14.1 HEAD on that file shows only the unrelated .title-case addition, and 88vh has been there since 7f7c8d1 (2025-06-18).

The 12vh shortfall is clearly deliberate: it lets the next section peek above the fold. The problem is that it was hardcoded, undocumented, and had no supported override, while three separate places promised "fullscreen".

Change

Expose main.sectionHeight and main.maxSectionHeight, plumbed through head/stylesheet.html alongside the existing navbar offsets. Defaults are unchanged — no existing site shifts.

Verification

Built the exampleSite (Hugo 0.164.0, the reporter's version) with a cover: true hero, measured in a real browser at their exact 1900×1031 viewport:

Config Hero bottom edge % of viewport
defaults 907px 88.0% (reproduces the report)
sectionHeight/maxSectionHeight = "100vh" 1031px 100.0%

lint:styles and test:templates pass.

The libsass path shares the same $vars dict as the adjacent $overlay-offset, so nothing there is transpiler-specific beyond the h. bridge added to _variables-dart.scss. It could not be exercised end-to-end: libsass already fails in the exampleSite for unrelated pre-existing reasons (FontAwesome v7 requires DartSass; mod-blocks/preview.scss:58 uses a min() libsass rejects).

Related

  • gethinode/mod-blocks — forwards the cover flag into the hero body partial
  • gethinode/mod-docs — corrects the "full-page hero" wording
  • gethinode/mod-utils — corrects the shared cover argument description
  • gethinode/gethinode.com — documents the two new settings (held for this release)

🤖 Generated with Claude Code

The height of a cover section was hardcoded in `_styles.scss` as
`--section-height: 88vh` with `--max-section-height: 1024px`. Neither
value was documented or reachable from a site's configuration, so a site
wanting a genuinely full-screen hero had no supported way to get one --
`cover: true` always stopped at 88% of the viewport, and the 1024px cap
shrank that share further on xxl and tall viewports.

Expose both as `main.sectionHeight` and `main.maxSectionHeight`, plumbed
through `head/stylesheet.html` alongside the existing navbar offsets.
Defaults are unchanged, so no existing site shifts: the 88vh shortfall is
deliberate, letting the next section peek above the fold.

Verified in the exampleSite at 1900x1031 with a `cover: true` hero:
defaults still place the hero bottom edge at 907px (88.0% of the
viewport, reproducing the report); `sectionHeight = "100vh"` plus
`maxSectionHeight = "100vh"` places it at 1031px (100.0%).

Closes: #2107

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Aug 2, 2026

Copy link
Copy Markdown

Deploy Preview for gethinode-demo ready!

Name Link
🔨 Latest commit a63eb63
🔍 Latest deploy log https://app.netlify.com/projects/gethinode-demo/deploys/6a6ed75dd71ef4000874ecfe
😎 Deploy Preview https://deploy-preview-2108--gethinode-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@markdumay

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 3.16.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@markdumay
markdumay deleted the feat/section-height-params branch August 2, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Hero cover=true does not display in full screen

1 participant