Skip to content

fix(docs): pin banner close button to top-right corner on mobile#867

Merged
jdx merged 1 commit intomainfrom
fix/banner-button-corner-mobile
Apr 24, 2026
Merged

fix(docs): pin banner close button to top-right corner on mobile#867
jdx merged 1 commit intomainfrom
fix/banner-button-corner-mobile

Conversation

@jdx
Copy link
Copy Markdown
Owner

@jdx jdx commented Apr 24, 2026

Summary

Follow-up to #865. With flex-direction: column the mobile banner is now taller, and the base rule's top: 50%; transform: translateY(-50%) centering floats the × button in the vertical middle of the stacked content instead of in the top-right corner.

Override top and transform inside the <=640px media query so the button pins flush to the corner.

Test plan

  • Open hk.jdx.dev at a <=640px viewport, clear localStorage['jdx-banner-dismissed'], confirm the × button sits in the top-right corner rather than floating in the middle.

Note

Low Risk
Low risk CSS-only change scoped to the mobile banner close button positioning with no functional or data-impacting logic changes.

Overview
Adjusts docs/.vitepress/theme/banner.css so that on <=640px viewports the banner close button no longer uses top: 50% + translateY(-50%) centering.

Within the mobile media query, it explicitly sets top: 0.25rem and removes the transform to keep the × button pinned to the top-right corner when the banner stacks vertically.

Reviewed by Cursor Bugbot for commit fbf8067. Bugbot is set up for automated code reviews on this repo. Configure here.

With flex-direction: column the banner is now taller on mobile, so the base rule's top: 50% / translateY(-50%) centering floats the × button in the middle of the stacked content instead of sitting flush in the corner.

Override with top: 0.25rem and transform: none inside the <=640px media query so the button pins to the top-right corner as intended.
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 24, 2026

Greptile Summary

This follow-up PR correctly overrides top and transform inside the <=640px media query so the banner's close button stays pinned to the top-right corner when flex-direction: column makes the banner taller on mobile. The fix is minimal, targeted, and correctly neutralises both the top: 50% offset and the translateY(-50%) centring transform.

Confidence Score: 5/5

Safe to merge — two-line CSS-only fix with no functional risk.

Change is a straightforward CSS override (two properties) with no logic, no dependencies, and a clear correctness rationale. No P0/P1 findings.

No files require special attention.

Important Files Changed

Filename Overview
docs/.vitepress/theme/banner.css Adds top: 0.25rem and transform: none overrides inside the <=640px media query to pin the close button to the top-right corner when the banner stacks vertically.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Browser viewport] --> B{width <= 640px?}
    B -- No --> C[Base rule: top 50pct + translateY-50pct, button vertically centred]
    B -- Yes --> D[Mobile override: flex-direction column, top 0.25rem + transform none, button pinned top-right]
Loading

Reviews (1): Last reviewed commit: "fix(docs): pin banner close button to to..." | Re-trigger Greptile

@jdx jdx enabled auto-merge (squash) April 24, 2026 14:26
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the CSS for the banner button in docs/.vitepress/theme/banner.css, adding a top position of 0.25rem and setting the transform property to none. I have no feedback to provide.

@jdx jdx disabled auto-merge April 24, 2026 14:27
@jdx jdx enabled auto-merge (squash) April 24, 2026 14:27
@jdx jdx disabled auto-merge April 24, 2026 14:34
@jdx jdx enabled auto-merge (squash) April 24, 2026 14:34
@jdx jdx merged commit c744fe1 into main Apr 24, 2026
23 checks passed
@jdx jdx deleted the fix/banner-button-corner-mobile branch April 24, 2026 14:44
@jdx jdx mentioned this pull request Apr 24, 2026
jdx added a commit that referenced this pull request Apr 26, 2026
### 🐛 Bug Fixes

- **(builtins)** silence pklr deprecation warnings on Builtins.pkl load
by [@jdx](https://github.com/jdx) in
[#880](#880)
- **(ci)** serialize docs lint step by [@jdx](https://github.com/jdx) in
[#874](#874)
- **(config)** include main pkl path in cache fresh files by
[@jdx](https://github.com/jdx) in
[#879](#879)
- **(docs)** stack banner message and link on mobile by
[@jdx](https://github.com/jdx) in
[#865](#865)
- **(docs)** pin banner close button to top-right corner on mobile by
[@jdx](https://github.com/jdx) in
[#867](#867)

### 📚 Documentation

- **(site)** show release version and github stars by
[@jdx](https://github.com/jdx) in
[#872](#872)

### 🔍 Other Changes

- add pr-closer workflow by [@jdx](https://github.com/jdx) in
[#876](#876)

### 📦️ Dependency Updates

- bump communique 1.0.3 → 1.0.4 by [@jdx](https://github.com/jdx) in
[#868](#868)
- update anthropics/claude-code-action digest to 2da6cfa by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#869](#869)
- update anthropics/claude-code-action digest to 567fe95 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#870](#870)
- bump communique to 1.1.2 by [@jdx](https://github.com/jdx) in
[#875](#875)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> <sup>[Cursor Bugbot](https://cursor.com/bugbot) is generating a
summary for commit 62ff432. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: mise-en-dev <[email protected]>
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.

1 participant