twbs/bootstrap

Add @font-weight-base variable

Closed this issue · 6 comments

Bootstrap resets the font properties of many of its elements (see #15925, etc), setting amongst other things the font-weight to normal (400).

This makes it very hard to use a different cross site default (in my particular case, needed the default for font-weight to be 300).

Could we solve this by using a @base-font-weight variable instead of the hard-coded normal value?

Thanks!

mdo commented

Hmm, doesn't seem that necessary. What do we reset to normal that isn't normal already? I know we reset our headings, but that's about it.

For brevity: https://gist.github.com/ruiramos/f3c66ca82c872bc321b8
I stumbled across this problem specifically on the .dropdown-menu > li > a styling (my body font-weight is set to 300 but options inside a dropdown remain 400).

mdo commented

I'm unsure why we're resetting the font-weight on our dropdowns, other than perhaps folks are overriding it on their navs and it gets inherited. That line has been there since v2, so it might be removable. Despite those instances of the font-weight: normal, I don't see a pattern that we'd want to establish with a global base variable. Sure we're resetting all those to the same value, but that doesn't indicate a relationship between those values.

Beyond that, I'm unsure we'd want to add any new configuration variables like this so late in v3.

mdo commented

Punting on it for now.

X-Ref: #9002

Hello! I was looking for this var recently and just wanted to share the use case.

Essentially, the font I was using looked a little bold at the "normal" size; so, I wanted to drop the weight down.

I knew that $headings-font-weight existed and assumed there must be a corresponding one for $font-weight-base.

Honestly, I was relieved not to see it, having been concerned at the prospect of added complexity if it was being used broadly in _type.scss or _reboot.scss. That said, I can see adding it for body since $headings-font-weight exists, and since it's a recurrent configuration requirement with certain types of fonts.

Thanks