Skip to content

fix(docs): anchor the hero glyph + glow to the content column#285

Merged
btravers merged 1 commit into
mainfrom
fix/hero-anchoring
Jul 3, 2026
Merged

fix(docs): anchor the hero glyph + glow to the content column#285
btravers merged 1 commit into
mainfrom
fix/hero-anchoring

Conversation

@btravers

@btravers btravers commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

On wide screens the hero glyph and the shared theme's hero glow were anchored to the viewport edge, so they drifted into the far-right corner — a small, detached glyph and a stray halo next to the header. This anchors both to the 1152px content column so they stay over the hero on any width. Verified at 1920px.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 3, 2026 12:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the VitePress docs home hero styling so the background glyph and the shared theme’s hero glow stay aligned with the centered 1152px content column on wide viewports, instead of drifting toward the viewport edge.

Changes:

  • Override .VPHome::before positioning to anchor the shared theme glow to the content column (with the existing ~120px bleed).
  • Update .VPHome::after positioning (and tweak its max-width) so the hero glyph remains aligned with the content column on wide screens.

Comment thread docs/.vitepress/theme/custom.css Outdated
Comment thread docs/.vitepress/theme/custom.css Outdated
On wide screens both the glyph and the shared theme's hero glow were
anchored to the viewport edge, so they drifted into the far-right corner
(a small, detached glyph and a stray halo by the header). Anchor both to
the 1152px content column instead.

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

btravers commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Refactored to address the review:

  • The content-column width and the computed gutter now live in CSS custom properties on .VPHome (--btv-col: 1152px and --btv-gutter), so the 1152px constant is defined once and both pseudo-elements reference var(--btv-gutter) — no duplication or drift.
  • The division is wrapped in calc() inside max() (max(0px, calc((100% - var(--btv-col)) / 2))) for robust parsing (incl. Safari).

Verified at 1920px: the computed right on the glyph resolves to the gutter (384px), and both glyph and glow stay anchored to the content column.

@btravers btravers force-pushed the fix/hero-anchoring branch from b752d2f to e39ae55 Compare July 3, 2026 13:11
@btravers btravers merged commit dedf6d6 into main Jul 3, 2026
9 checks passed
@btravers btravers deleted the fix/hero-anchoring branch July 3, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants