Skip to content

fix(components): drop stale backdrop offset in bookshop examples#1999

Merged
markdumay merged 2 commits into
mainfrom
fix/example-backdrop-margins
Jul 11, 2026
Merged

fix(components): drop stale backdrop offset in bookshop examples#1999
markdumay merged 2 commits into
mainfrom
fix/example-backdrop-margins

Conversation

@markdumay

@markdumay markdumay commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Fixes the hero-with-backdrop preview on the Hero docs page, and pulls in the companion mod-blocks release.

Problem

The backdrop image in the preview rendered 24px up and to the left of its section, leaving a matching gap on the bottom and right edges.

The example-bookshop shortcode pads the preview section (p-1 px-md-4 py-md-4) and passed the exact negative counterpart to the backdrop image via bg_class (m-n1 mx-md-n4 my-md-n4). That compensation was only correct while the image was laid out from its static position, at the section's content-box origin.

mod-blocks v1.23.5 (gethinode/mod-blocks#142) pins the backdrop with inset: 0, so the image now covers the section's padding box by construction. The negative margins became stale and displaced it.

Changes

  1. Remove the bg_class negative margins from example-bookshop.html. The section padding stays; the backdrop covers the section without compensation, and an author-specified bg-class in an example's YAML is now honoured instead of being overwritten.
  2. Bump mod-blocks to v1.23.6 (fix: anchor section backdrops independent of the overlay mod-blocks#143), which anchors a backdrop to its own section whenever a backdrop is defined, rather than only when an overlay mode is set. Without it, a section combining backdrop with overlay-mode: none had no positioned ancestor and its image escaped to <body>.

Verification

Backdrop geometry in the preview, measured in the browser before and after:

image rect section rect
before (213, 3464) 726×376 (237, 3488) 726×376
after (237, 3488) 726×376 (237, 3488) 726×376

A production build of the exampleSite on v1.23.6 confirms the backdrop section renders as hero … backdrop-container background-container, no m-n1 margins remain on the page, and the .backdrop-container / .background-container / .background-img-fluid rules all survive PurgeCSS.

hero.md is the only docs page using backdrop, so this is the only preview affected.

🤖 Generated with Claude Code

The example-bookshop shortcode padded the preview section and passed a matching set of
negative margins to the backdrop image via bg_class. That compensation was only correct
while the image was laid out from its static position, inside the section content box.

mod-blocks now pins the backdrop with inset: 0, so the image already covers the padding
box. The negative margins shifted it out of the section, leaving a gap on the opposite
edge. Remove them and let the section argument pass through untouched.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@markdumay markdumay changed the base branch from develop to main July 11, 2026 08:07
@markdumay markdumay marked this pull request as draft July 11, 2026 08:32
@markdumay markdumay marked this pull request as ready for review July 11, 2026 08:32
@markdumay markdumay closed this Jul 11, 2026
@markdumay markdumay reopened this Jul 11, 2026
Bump mod-blocks to v1.23.6, which anchors a section backdrop to its own section whenever a
backdrop is defined, instead of only when an overlay mode is set (gethinode/mod-blocks#143).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@markdumay markdumay force-pushed the fix/example-backdrop-margins branch from 0e958d7 to 37ab7a7 Compare July 11, 2026 09:18
@netlify

netlify Bot commented Jul 11, 2026

Copy link
Copy Markdown

Deploy Preview for gethinode-demo ready!

Name Link
🔨 Latest commit 37ab7a7
🔍 Latest deploy log https://app.netlify.com/projects/gethinode-demo/deploys/6a520a6be913c40008bfdccd
😎 Deploy Preview https://deploy-preview-1999--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 markdumay merged commit 5d1d404 into main Jul 11, 2026
16 checks passed
@markdumay markdumay deleted the fix/example-backdrop-margins branch July 11, 2026 09:24
@markdumay

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 2.19.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

1 participant