Skip to content

Instantly share code, notes, and snippets.

@fahimalizain
Created February 20, 2019 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fahimalizain/8ad34ebde12c6e01c0962cb75091b8e3 to your computer and use it in GitHub Desktop.
Save fahimalizain/8ad34ebde12c6e01c0962cb75091b8e3 to your computer and use it in GitHub Desktop.
Negate bootstrap .container fixed widths. This helps to span any element across the screen, even though its inside a .container without using position absolute or fixed
.spread-screen {
width: 100vh;
// bootstrap 4
// the following are referenced from bootstrap.scss/_grid.scss
// mixins/_grid.scss @make-container @make-container-max-widths mixins
margin-left: -$spacer;
@each $breakpoint, $container-max-width in $container-max-widths {
@include media-breakpoint-up($breakpoint, $grid-breakpoints) {
margin-left: calc(-1 * (((100vw - #{$container-max-width}) / 2) + (#{$grid-gutter-width} / 2)));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment