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

Slim down the height of the announcement bar on desktop #2807

Merged
merged 4 commits into from
Jul 10, 2023

Conversation

kjellr
Copy link
Contributor

@kjellr kjellr commented Jul 10, 2023

PR Summary:

Slims down the height of the announcement bar on desktop.

Why are these changes introduced?

Addresses some feedback we've received about the general size of the announcements bar. This PR:

  • Changes the height of the announcements bar from 48px to 38px on desktop. This is roughly the same size it was before.
  • Updates the hit area for all buttons on the announcement bar to be the entire height of the announcement bar. The hit area for all announcement bar buttons on desktop is at least 38px by 38px here.
  • Sets a min-height for the announcement bar message so that the height of the utility bar doesn't fluctuate as you turn on/off settings.

It also fixes the following small bug:

  • It sets the language and currency picker font sizes to be 13px instead of 14px, to match the rest of the text in the announcement bar + header.
  • It adjusts the width of the announcement bar so that it matches the width of the rest of the header. Currently it was matching the width of the page below, which felt odd.

The PR does NOT make any adjustments to the mobile state of the announcement bar.

Visual impact on existing themes

Screenshots:

New height:

Before After
Screenshot 2023-07-10 at 12 43 06 PM after-b

Note the left/right arrows alignment:

Before After
Screenshot 2023-07-10 at 12 43 20 PM after-a

Testing steps/scenarios

Checklist

@kjellr kjellr self-assigned this Jul 10, 2023
@lougoncharenko
Copy link
Contributor

Looks great so far! I am testing out certain scenarios and I noticed that the slider doesnt align with the drawer menu and shop cart icon in mobile. I know your PR mentions that "The PR does NOT make any adjustments to the mobile state of the announcement bar", but I wanted to bring up a point that the alignment does look off on mobile
Screenshot 2023-07-10 at 1 07 12 PM

@kjellr
Copy link
Contributor Author

kjellr commented Jul 10, 2023

Thanks, @lougoncharenko! That should be fixed in 310b916.

@@ -2266,6 +2276,7 @@ product-info .loading-overlay:not(.hidden) ~ *,
padding: 1rem 0;
margin: 0;
letter-spacing: 0.1rem;
min-height: 3.8rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

If you're ok with this, I probably am, but historically we do make a best effort to keep things 44px. Just want to double check we don't want to add in the additional 6px. In theory a tablet touch device could display at the desktop breakpoint and still benefit from the 44px min.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'm ok with 38px for desktop. 👍

}

.js .header-localization:not(.menu-drawer__localization) .localization-form__select {
padding: 0 2.7rem 0 1.2rem;
padding: 0.85rem 2.7rem 0.85rem 1.2rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a big fan of the kinda magic numbers. I'd rather set the desired height of 38px more transparently and align things with flex box, but if that would require additional refactoring to accommodate than this works for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deeeeefinitely. I don't know why I bothered trying to figure out these weird rem values. 😂 Fixed in dff48f2.

@lougoncharenko
Copy link
Contributor

Full screen mode is adding extra margins to both the announcement bar and header
Current in Dawn:
Screenshot 2023-07-10 at 1 39 37 PM

This PR:
Screenshot 2023-07-10 at 1 43 24 PM

@kjellr
Copy link
Contributor Author

kjellr commented Jul 10, 2023

@lougoncharenko I think that's expected! I'm not seeing your screenshotted "Current in Dawn" behavior in my testing, but if you check the Dawn Demo here, you'll see that the header is meant to max out at the page width.

@kmeleta
Copy link
Contributor

kmeleta commented Jul 10, 2023

@lougoncharenko I think you're probably seeing the difference when the desktop drawer menu is used, where we allow everything to go more full width. If using the dropdown or megamenu types everything should be restricted to page width.

@kjellr
Copy link
Contributor Author

kjellr commented Jul 10, 2023

Ah yes, that's got to be it. I just checked, and the announcement bar respects that setting too — when the menu is set to Drawer, the announcement bar goes full width alongside the rest of the header. And when it's set to Dropdown or Mega Menu, it continues mirroring the header by maxing out at the page width. 👍

I think we're good in that case. Thanks everyone for the quick testing of this today!

@kjellr kjellr merged commit 1d70bdc into main Jul 10, 2023
@kjellr kjellr deleted the update-announcement-bar-spacing branch July 10, 2023 19:40
lougoncharenko pushed a commit that referenced this pull request Jul 12, 2023
* Adjust height of announcement bar and sub-items.

* Adjust announcement bar button height on desktop only.

* Fix width of the utility bar on mobile.

* Remove bizarre rem-based values.
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
* Adjust height of announcement bar and sub-items.

* Adjust announcement bar button height on desktop only.

* Fix width of the utility bar on mobile.

* Remove bizarre rem-based values.
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.

4 participants