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.

[Container] Background Color Extending to Margin

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

I would like to see an easy and out-of-the-box way to fully set the background color of a Container component with a set width.

Examples 🌈

Could be setting a property that would change the internal working/styles of a Container:

<Container maxWidth='lg' coloredMargin>
--- Code for a Hero ---
<Container>

Motivation 🔦

So far, architecturally speaking not being able to fully set a background color to a Container due to the width limits adds a lot of complexity and useless code, e.g., `parent divs1…

Implementing this, would reduce code complexity of many projects - including mine!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
aress31commented, Feb 18, 2022

Simple @oliviertassinari add a switch to replace the Container margin by a padding for these use cases and problem solved and more use case coverage without hacking parent boxes or faffing around with the CSS andf selectors…

2reactions
michaldudakcommented, Feb 17, 2022

How would you see it implemented without an additional tag? You can’t set padding: auto in CSS, so you need one element that has a background color and another nested one that restricts the width of the content. I suppose you could do some trickery with pseudoelements, but I haven’t checked. Plus, I don’t think it’s even worth trying.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extend background-color of header beyond container with css
I would like to extend a div background-color beyond the div (and the container div as well) so it reaches the width of...
Read more >
CSS Tricks: Expanding Beyond a Parent div - Modus Agency
- First set the width of the extended-content-container div to 500%. This will make the div you are trying to extend 5 time...
Read more >
[Solved] Extending div background-color to fill gutter
In my example (in the image at the url above) I would like to extend the white background to fill the page to...
Read more >
Understanding of Different CSS Margin Color - eduCBA
The following article provides an outline on CSS Margin Color. The margin property in HTML gives space around the outermost element's content of...
Read more >
Is there any way to make a background color stretch out to full ...
First, in 'Style Mode' - locate 'Sizes and Values' > 'Site Width' and set it to 80% - this can be adjusted to...
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