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

Use consistent font sizes in the Utility Bar #2828

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

kjellr
Copy link
Contributor

@kjellr kjellr commented Jul 12, 2023

PR Summary:

Change the font size of the the language and currency picker to be 13px instead of 14px to match the rest of the text in the announcement bar.

Why are these changes introduced?

For consistency. Currently, the font size for the language and currency picker is 1px larger than the font size for the announcement bar messages.

I'd meant to take care of this in #2807 (it's even mentioned in the description!), but it slipped out at some point.

Screenshots

Before:
Screenshot 2023-07-12 at 7 50 43 AM

After:
Screenshot 2023-07-12 at 7 44 10 AM

Demo links

Checklist

@kjellr kjellr self-assigned this Jul 12, 2023
.utility-bar .localization-wrapper .disclosure__link {
font-size: calc(var(--font-heading-scale) * 1.3rem);
}

@media screen and (min-width: 990px) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The changes look good! Just out of curiosity and so that I can grow better as a developer, what is the purpose of add var(--font-heading-scale)*1.3rem as opposed to just using 1.3rem? Is this a consistent pattern I should be using for font sizes as I noticed that other sections use this calculation for sizing as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! I wanted to match the .h5 font size we use for the announcement bar text, so that they won't go out of sync. I didn't need to wrap it in the media query because the localization pickers in the header only show up above the 750px breakpoint anyway.

We use this calc function to generate the font size so that when merchants adjust the font size scale in Theme Settings > Typography, that var(--font-heading-scale) variable will update and scale up all the text that uses these rules proportionally.

(Ideally we should just be using a variable here, e.g. var(--heading-font-size-h5) rather than repeating that calc function over and over, but we haven't implemented something like that in Dawn.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we should just be using a variable here, e.g. var(--heading-font-size-h5)

This was going to be my probably-don't-need-to-do-this-now feedback 🙂

@kjellr kjellr merged commit 1e642a1 into main Jul 12, 2023
@kjellr kjellr deleted the fix/font-size-for-localization-form-utility-bar branch July 12, 2023 17:44
phapsidesGT pushed a commit to Gravytrain-UK/gt-shopify-dawn-theme that referenced this pull request Sep 3, 2024
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.

3 participants