Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(banner): derive placement from topbar height #1408

Merged
merged 7 commits into from
Jul 7, 2023

Conversation

connellsharp
Copy link
Collaborator

@connellsharp connellsharp commented Jul 6, 2023

Fixes a bug where the system-wide banners sit a few pixels higher than they should on Stack Overflow


@dancormier here 👋
This PR updates s-banner to base it's placement off of the --theme-topbar-height variable. Previously, it was set to a static value with no relation to the topbar height which could cause the banner to show in the incorrect spot.

The issue went unnoticed because the Stacks docs topbar height was set to a custom height using an atomic class (.h64) on the topbar itself and the demo banners were placed with custom CSS on the banners documentation page. This PR removes all that custom junk. Now, the docs to bases it's topbar height off of --theme-topbar-height and removes the page-specific styling.

Outside of placement, the only visual change is to the banner border. I've removed the top border on the banner since it was never seen… we have a positioning offset that moved the banner up 1px so the border would be overlapped by the topbar. That compensating 1px is now gone and the banner now only has a bottom border.

I've requested a review from @giamir mainly as a heads-up. An exhaustive review shouldn't be necessary.

@connellsharp connellsharp added the bug A reproducible problem with the Stacks code label Jul 6, 2023
@connellsharp connellsharp self-assigned this Jul 6, 2023
@netlify
Copy link

netlify bot commented Jul 6, 2023

Deploy Preview for stacks ready!

Name Link
🔨 Latest commit a37f015
🔍 Latest deploy log https://app.netlify.com/sites/stacks/deploys/64a87e1fe6ae2d00071d4a09
😎 Deploy Preview https://deploy-preview-1408--stacks.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 site configuration.

@dancormier dancormier changed the title Move banner to sit just under the top bar fix(banner): derive placement from topbar height Jul 6, 2023
Now, it's placed inside `&[aria-hidden="false"]` to prevent cascade conflicts
That border change shifted all banner test images 1px
@dancormier dancormier requested a review from giamir July 6, 2023 17:49
@dancormier dancormier marked this pull request as ready for review July 6, 2023 17:50
@dancormier dancormier merged commit 557ee76 into develop Jul 7, 2023
5 checks passed
@dancormier dancormier deleted the cwatkins/banner-x-offset branch July 7, 2023 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A reproducible problem with the Stacks code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants