I’m new to wordpress, and not much css experience either.
Similar question, but I wanted to change the font size of the site-title only for mobile devices – make it smaller so it fits on one line.
I created the child theme and it is working.
But it’s that first occurrence of each element that controls iPhone, right? Then larger devices are covered inside the @media sections?
So to change iPhone only, and leave all other devices to the theme default, I have to have each of the @media sections in my child theme style sheet — just with the site-title class selector – and use the same values as in the base theme.
If I don’t copy those defaults into my child theme, then my smaller font override will be used on every device.
It seems wrong to have so much of the base theme copied into the child, but I couldn’t find a way to make it work.
Question: is there a better way?
/* ajs: so this is for mobile – the one I really want to override */
.site-title {
font-size: 16px;
font-size: 1.6rem;
line-height: 1.4;
}
.entry-title {
font-size: 18px;
font-size: 1.8rem;
line-height: 1.12;
margin-bottom: 0.8em;
}
/* ajs: all these others have to be set same as in the delivered theme. */
/**
* 15.1 Mobile Large 620px
*/
@media screen and (min-width: 38.75em) {
.site-title {
font-size: 22px;
font-size: 2.2rem;
line-height: 1.0909;
}
.entry-title {
font-size: 35px;
font-size: 3.5rem;
line-height: 1.2;
margin-bottom: 1.2em;
}
}
… etc for each @media
https://www.whatalanhadforlunch.com/