Why is the $spacer variable defined using REM?
See original GitHub issueDiscussed in https://github.com/twbs/bootstrap/discussions/35461
<div type='discussions-op-text'>Originally posted by thenomadicmann December 2, 2021
What is the point of defining the $spacer
variable using REM units instead of pixels? If a user changes their browser’s default font-size settings to be able to read text easier, they’ve also now increased margins and paddings which may crowd a design and possibly break a page layout. Why not reserve using REM for font-size? On a related note, in BS4, the grid gutter width, $grid-gutter-width
, was set using pixels. In BS5 it switched to REM as well which causes the same unexpected behavior described above.</div>
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
What is the meaning of $spacer in bootstrap? - Stack Overflow
$spacer is a SASS variable. By default it's value is 1rem . Therefore mt-1 is margin-top:.25rem;. The value for each of the 6...
Read more >Generating Sizes, Line Heights and Spacers | Mathias Polligkeit
The sizes will be defined in rem (relative to the font size of the root element ). The size can then be generated...
Read more >Expand Bootstrap spacing classes with Sass | by Louis Wang
Here is a basic example of the spacing classes in use. Say you want to give 1.5rem(24px) bottom margin to a section element....
Read more >When to use Rem, Em, VW/VH, %, PX? : r/Frontend - Reddit
I tend to use Rem a lot for margins, padding, font sizes, etc (generally ... The rest of the units are dependent on...
Read more >Bootstrap Spacing - examples & tutorial
Responsive spacing with the latest Bootstrap 5. ... .me-1, 0.25rem ... 1 - (by default) for classes that set the margin or padding...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@thenomadicmann
Without seeing everything at play here I can only guess what’s going on but it appears these two elements, class.card-img and class.card-img-overlay, are positioned. The card-img is essentially the background and the card-img-overlay is bottom-left aligned.
If I’m right, the bottom-left alignment is your issue. Align it from the top ensuring you leave enough space for the image to fully display and not cause the elements to overlap.
e.g. card-img-overlay { top: 15rem; left: 0;}
Are you setting $font-size-root instead of $font-size-base somewhere ?