[Container] Background Color Extending to Margin
See original GitHub issueDuplicates
- 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:
- Created 2 years ago
- Reactions:3
- Comments:16 (8 by maintainers)
Top 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 >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
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…
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.