twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
170.47k stars 78.83k forks source link

Question regarding $font-size-base #24534

Closed myplaneticket closed 6 years ago

myplaneticket commented 6 years ago

Sorry to post this here, but who better to ask then the creators of BS4 :)

I couldn't find a reliable answer in the docs and was hoping to get some insight here to remove all doubts.

Should the font size for BS4 elements be changed from the root element only?

For example:

html { font-size: 14px }

Is it okay for me to change / override variables (using _custom.scss) in order to alter bootstrap's font size? Or should I not be doing it this way?

For example:

html { font-size: 16px }

// Changing bootstrap variable to 
$font-size-base:                    0.8125rem; //instead of 1rem
$font-size-lg:                      1.25rem;  
$font-size-sm:              0.75rem;  

$h1-font-size:              1.5rem;   
$h2-font-size:              1.375rem; 
$h3-font-size:              1.1875rem;
$h4-font-size:              1.0625rem;
$h5-font-size:                  0.9375rem;
$h6-font-size:              0.875rem;

$display1-size:                     5rem !default;
$display2-size:                     4.5rem !default;
$display3-size:                     3.5rem !default;
$display4-size:                     2.5rem !default;
andresgalante commented 6 years ago

Hey @myorangeca, we've changed font size to be relative to $font-size-base here: https://github.com/twbs/bootstrap/pull/24060

I'd say change $font-size-base and not the root size

joneldiablo commented 3 years ago

Hello, I see that $font-size-root not working on 5.1.0 but on 5.0.0 works fine, its an error? o.O