Mosh explains how to set the base HTML font size to 10px to simplify REM calculations; i.e. coding “font-size: 62.5%;” on the HTML element. So once we do that what’s the sense of using type-scale.com? Aren’t all the suggested font-sizes on header elements now rendered inaccurate?
The font sizes at type-scale.com are defined in units relative to the root/html element, so they will be accurate regardless of what you set the html element’s font-size to. In fact, if you change the “Base Size” at type-scale to 10px, you will see that the generated CSS is doing exactly the same thing that Mosh is doing with the html font-size. Here’s that generated CSS:
@import url('https://fonts.googleapis.com/css?family=Poppins:400');
html {font-size: 62.5%;} /*10px*/
body {
background: white;
font-family: 'Poppins', sans-serif;
font-weight: 400;
line-height: 1.75;
color: #000000;
}
p {margin-bottom: 1rem;}
h1, h2, h3, h4, h5 {
margin: 3rem 0 1.38rem;
font-family: 'Poppins', sans-serif;
font-weight: 400;
line-height: 1.3;
}
h1 {
margin-top: 0;
font-size: 3.052rem;
}
h2 {font-size: 2.441rem;}
h3 {font-size: 1.953rem;}
h4 {font-size: 1.563rem;}
h5 {font-size: 1.25rem;}
small, .text_small {font-size: 0.8rem;}