Skip to content

Is there any rule for the sizing values used in Bootstrap SCSS? #40898

Discussion options

You must be logged in to vote

I'm not sure if there are explicit rules documented somewhere, but it’s primarily tied to the spacing scale you're using. Common values like 0.25rem, 0.75rem, and 1.25rem are based on a 16px font size base, so, for instance, 0.25 * 16 gives you 4px. If you use something like 0.19rem, that would equal 3.04px, which isn’t ideal because non-integer pixel values can lead to inconsistencies or rounding issues in rendering.
On top of that, the choice between using rem, px, or em can also depend on how you want the layout to behave when users zoom in or out. It depends on the use cases and renderings.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MohamadSalman11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants