You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Additional Font Weight Classes #23969
I think it would be great to include some more font-weight options in bootstrap. Even when you look at the documentation, you can see that the weights have been modified because current design sensibilities call for a wider range of font weights that the default. I realized that when I'm creating bootstrap projects, I end up modifying the font-weights a lot, so maybe this could be added into the classes.
Although font-weight-bold and font-weight-normal exist, I feel like there needs to be a bit more broad. I'm proposing adding some font-weight classes.
Hi @planetoftheweb reading your issue I noticed that font-weight-light is defined on the code base but not surfaced on the docs. I've sent a PR to add it #23970
As for adding more utility classes I think it's a good idea, in fact I am doing it at my own project.
From a bootstrap perspective I'd make sure to test it in different browsers and OS. Since Bootstrap has a System Font Stack, it might be the case that some font families don't have a specific weight (in numbers).
Using keywords is a safer bet and users can always define them on their projects.
We could add them, but we must have a note that based on the font used, the result might not be the expected one, and it's the developer's job to make sure the font weight they are using exists.
It would set font-weight: 500 !important; similar to how font-weight-light is defined.
I find it very useful and keep adding it to my projects; it would be nice if it was part of bootstrap. I understand that it may not work with all fonts but at least it sets the intent. How's font-weight-light any different?
Activity
[-]Add Font Weight Classes[/-][+]Feature Request: Additional Font Weight Classes[/+]andresgalante commentedon Sep 17, 2017
Hi @planetoftheweb reading your issue I noticed that
font-weight-lightis defined on the code base but not surfaced on the docs. I've sent a PR to add it #23970As for adding more utility classes I think it's a good idea, in fact I am doing it at my own project.
From a bootstrap perspective I'd make sure to test it in different browsers and OS. Since Bootstrap has a System Font Stack, it might be the case that some font families don't have a specific weight (in numbers).
Using keywords is a safer bet and users can always define them on their projects.
anyway, good idea 👍
XhmikosR commentedon Oct 19, 2017
We could add them, but we must have a note that based on the font used, the result might not be the expected one, and it's the developer's job to make sure the font weight they are using exists.
See for example an issue with our docs, #24419.
add 'lighter' and 'bolder' font weight classes
polys commentedon Jun 11, 2018
Could you add
font-weight-mediumas well please?It would set
font-weight: 500 !important;similar to howfont-weight-lightis defined.I find it very useful and keep adding it to my projects; it would be nice if it was part of bootstrap. I understand that it may not work with all fonts but at least it sets the intent. How's
font-weight-lightany different?add 'lighter' and 'bolder' font weight classes (#26580)
ADD 'font-weight-medium' WEIGHT CLASS (twbs#23969)
mdo commentedon Dec 14, 2018
Closing since we had the lighter/bolder added. For any other weights and utilities, please feel free to open PRs to suggest :).