When it comes to setting font sizes for easier calculations in REM values, I currently use this approach:
html { font-size: 62.5%; }
body { font-size: 1.6rem; } /* 16px */
However, Bootstrap 5 uses the root value (which is typically set at 62.5%) to calculate all sizes. It provides variables like $font-size-root
and $font-size-base
, and I've tried manipulating those to achieve accurate calculations.
Initially, I attempted setting the root to match HTML value and the base to align with body value, but that resulted in incorrect outcomes. Adjusting either the base or the root to 1.6rem
or 1rem
also produced wrong results.
I'm curious if there's a way to customize Bootstrap 5 so that when I specify a value like 3.2rem
for $h1-font-size
, it will output a result equivalent to 32px
(computed style).
This would streamline my calculations significantly, ensuring Bootstrap adheres to the same standards as the rest of the CSS.
Thank you in advance for any suggestions! I've conducted some searches here, but unfortunately, didn't find relevant questions.