question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why is the $spacer variable defined using REM?

See original GitHub issue

Discussed 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:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JSieffertcommented, Dec 15, 2021

@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;}

0reactions
asyncdesigncommented, Jan 23, 2022

Are you setting $font-size-root instead of $font-size-base somewhere ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found