Changing font for mobile in Dawn Theme?

notacoder
Tourist
5 0 1

I've changed the font for desktop by adding code in the base.css, how do I change the font for mobile? Thank you!

Replies 9 (9)

Zworthkey
Shopify Partner
5581 642 1567

@notacoder 
you waNT TO CHANGE font color or size.

Thank you

notacoder
Tourist
5 0 1

No, the font entirely.

Zworthkey
Shopify Partner
5581 642 1567

so font style. you want to change.

notacoder
Tourist
5 0 1

yes, I've successfully changed the font style for desktop but it won't carry over to mobile.

Zworthkey
Shopify Partner
5581 642 1567

@notacoder 
using media query you can change the font style.

notacoder
Tourist
5 0 1

I'm not familiar with that, can you please elaborate a little?

threed
Shopify Partner
129 17 47

More info on media query here: https://www.w3schools.com/cssref/css3_pr_mediaquery.asp

You can explore the CSS/HTML on the W3schools site to help you understand more.

 

Essentially with the media query, you are telling the CSS this:

  1. If the customer is viewing the page on a screen smaller than (mobile pixel dimensions, I use 767px), change the font to my custom font.
  2. Otherwise, show the font as normal.

I have a suggestion but I'm not 100% sure that this would work. This is based off of my previous work on the Supply theme.

 

First, load the font into your CSS. This is assuming you had uploaded a font file with the .woff format with the filename FontName.woff. You would then name the font FontName within your CSS.

 

/* Custom font */
@font-face {
	font-family: "FontName";
	src: url("FontName.woff") format("woff");
}

 

 

 

Next, tell the CSS to make the font change on mobile. I used a <p> tag as an example.

 

/* Specify text style for p tags on mobile screens only. */
p {	
	@media only screen and (max-width: 767px) {font-family: FontName;}
}

 

 

I'm curious if this would work.

If I helped you, please help me by marking my comment as an accepted solution.
I am open to work and have been working with the Shopify system for several years.

OUTSIDEGRID
Shopify Partner
13 3 8

 @notacoder, you can change the fonts in the theme settings:

"Customize your typography settings

 

1.From your Shopify admin, go to Online Store > Themes.

2.Next to Supply, click Customize.

3.Click Theme settings.

4.Click Typography.

5.For each type of text, click Change to use the font picker.

6.Explore fonts by using the search field, or by clicking Load more.

8.Click the name of the font that you want to use.

9.To change the font to a different style, click the name of the current font style, and then select a new font style from the drop-down menu.

10.Click Select.

11.Click Save."

As explained in the link: https://help.shopify.com/en/manual/online-store/themes/os/themes-by-shopify/supply/settings#typograp...

I hope this helps! 

notacoder
Tourist
5 0 1

This is for a custom font so that way won't work. It's a font I've uploaded as an asset.