Created
March 21, 2019 18:58
-
-
Save tomfordweb/6e931f56c09f35f9f25c94ea1656e6ae to your computer and use it in GitHub Desktop.
SASS Mixin: Full Width Pseudo Elements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// adapted from | |
// https://css-tricks.com/full-browser-width-bars/ | |
@mixin full-width-pseudo($bg, $pos: relative) { | |
/* negative offset = section padding */ | |
margin: 0 -30px; | |
/* add back section padding value */ | |
padding: 0.25rem 30px; | |
position: 'absolute'; | |
background: $bg; | |
&:before, &:after { | |
content: ""; | |
position: absolute; | |
/* fill vertically */ | |
top: 0; | |
bottom: 0; | |
width: 9600px; | |
right: 100%; | |
background: $bg; | |
} | |
&:after { | |
width: 320px; | |
left: 100%; | |
/* you're free to do something totally different here */ | |
background: $bg; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment