Skip to content

Commit ef56c96

Browse files
authored
Merge pull request #299 from BeAPI/feature/fullwidth-background
Add mixin full width bg in container
2 parents ccb34d6 + 4a9a9e4 commit ef56c96

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* Background fullwidth mixin in a container
3+
*/
4+
5+
@mixin bg-fullwidth($color: $color-grey-100) {
6+
position: relative;
7+
8+
&::before {
9+
position: absolute;
10+
top: 0;
11+
left: 50%;
12+
width: 100vw;
13+
height: 100%;
14+
pointer-events: none;
15+
content: "";
16+
background-color: $color;
17+
transform: translate3d(-50%, 0, 0);
18+
19+
@include style-only {
20+
z-index: -1;
21+
}
22+
}
23+
}

src/scss/02-tools/tools.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@
3232
@import "./m-sr-only";
3333
@import "./m-style-only";
3434
@import "./m-reduced-motion";
35+
@import "./m-bg-fullwidth";
3536
@import "./m-block-vertical-spacing";

0 commit comments

Comments
 (0)