I\'m having a hard time getting my head around font scaling.
I currently have a website with a body font-size
of 100%. 100% of what though? This seems t
No one has mentioned CSS variables yet, and this approach worked best for me, so:
Let's say you've got a column on your page that is 100% of the width of a mobile user's screen, but has a max-width
of 800px, so on desktop there's some space on either side of the column. Put this at the top of your page:
And now you can use that variable (instead of the built-in vw
unit) to set the size of your font. E.g.
p {
font-size: calc( var(--column-width) / 100 );
}
It's not a pure CSS approach, but it's pretty close.