Created
April 7, 2014 21:14
-
-
Save justindujardin/10057651 to your computer and use it in GitHub Desktop.
LESS ZigZag Border
This file contains 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
/* | |
border-serrated - a zig zag triangle border with linear gradient | |
original SASS version: https://gist.github.com/justinmc/9837998 | |
*/ | |
.border-top-serrated(@size, @colorOuter) { | |
& { | |
position: relative; | |
padding-top: @size; | |
} | |
&:before { | |
top: 0px; | |
background-position: left top; | |
background:linear-gradient(-135deg, @colorOuter @size / 2, transparent 0), linear-gradient(135deg, @colorOuter @size / 2, transparent 0); | |
.border-serrated-helper(@size, @colorOuter); | |
} | |
} | |
.border-bottom-serrated(@size, @colorOuter) { | |
& { | |
position: relative; | |
padding-bottom: @size; | |
} | |
&:after { | |
bottom: 0px; | |
background-position: left bottom; | |
background:linear-gradient(-45deg, @colorOuter @size / 2, transparent 0), linear-gradient(45deg, @colorOuter @size / 2, transparent 0); | |
.border-serrated-helper(@size, @colorOuter); | |
} | |
} | |
.border-serrated-helper(@size, @colorOuter) { | |
content: " "; | |
display: block; | |
position: absolute; | |
left: 0px; | |
width: 100%; | |
height: @size; | |
background-repeat: repeat-x; | |
background-size: @size @size; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment