Shopify themes, liquid, logos, and UX
Hi, I would like to change the font in the announcement bar from the current bold one to the one used in the header and product description page (using "Sans-serif" system font), and to then separately adjust the font size for desktop view only. I appreciate any help.
website: https://leediastore.com/
Thanks!
Add this codes inside your base.css or theme.css.
Change the font family in the announcement bar:
p.announcement-bar__message.h5 {
font-family: sans-serif !important;
}
Adjust the font size for desktop view only:
@media only screen and (min-width: 768px) {
p.announcement-bar__message.h5 {
font-size: 25px;
}
}
I hope that helped!
The font size code worked but for some reason the font family didn't change.
Here's the issue (base.css - line 283):
font-family: 'outersans' !important;
If you remove the !important, my code will work!
Hello @LEEDIA 👋
Inside Shopify Admin, you can go to Edit theme code, open file base.css and add this code at the bottom
.announcement-bar__message {
font-family: var(--font-body-family) !important;
}
@media (min-width: 750px) {
font-size: 20px;
}
The result on desktop
Hope that helps!
I appreciate the help but it's still not changing the font itself, seems like it's being overridden by another line of code that sets the heading fonts to the bold one. Not sure how to fix this.
Hi @LEEDIA 👋
Try using this code instead
#shopify-section-sections--21211832713521__announcement-bar .announcement-bar__message {
font-family: var(--font-body-family) !important;
}
@media (min-width: 750px) {
#shopify-section-sections--21211832713521__announcement-bar .announcement-bar__message {
font-size: 20px !important;
}
}
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024