Skip to content

Instantly share code, notes, and snippets.

@ttamminen
Last active December 21, 2015 04:18
Show Gist options
  • Save ttamminen/6248177 to your computer and use it in GitHub Desktop.
Save ttamminen/6248177 to your computer and use it in GitHub Desktop.
Sass mixin to create vertical divider. Divider height will be same as previous container that is set position: relative. Working demo can be found from http://jsfiddle.net/ttamminen/dzHDQ/
@mixin vertical-divider(
$primaryColor: #eee,
$secondaryColor: #aaa,
$dividerWidth: 2px)
{
width: 1px;
height: 1px;
&:after {
content: "";
position: absolute;
top: 0;
bottom: 0;
width: 2px;
border-left: $dividerWidth solid $primaryColor;
background-color: $secondaryColor;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment