<span class="zigzag "></span>
<span class="zigzag {{ modifier }}"></span>
/* No context defined. */
$zzheight: 10px;
$zzhalfheight: calc($zzheight / 2);
$zzthickness: 130%; // increase to make the line thicker
$zzoffset: 4px;
$zzdegree: 135deg;
@mixin zigzag($bgcolor) {
position: relative;
z-index: 1;
display: block;
height: $zzheight;
background: $bgcolor;
&::before,
&::after {
content: '';
position: absolute;
right: 0;
left: 0;
display: block;
}
&::before {
top: $zzthickness;
height: ($zzheight - $zzoffset);
background:
linear-gradient(-$zzdegree, $zzlinecolor $zzhalfheight, transparent 0) 0 $zzhalfheight,
linear-gradient($zzdegree, $zzlinecolor $zzhalfheight, transparent 0) 0 $zzhalfheight;
background-repeat: repeat-x;
background-position: top left;
background-size: $zzheight $zzheight;
}
&::after {
top: 100%;
height: $zzheight;
background:
linear-gradient(-$zzdegree, $bgcolor $zzhalfheight, transparent 0) 0 $zzhalfheight,
linear-gradient($zzdegree, $bgcolor $zzhalfheight, transparent 0) 0 $zzhalfheight;
background-repeat: repeat-x;
background-position: top left;
background-size: $zzheight $zzheight;
}
}
.zigzag,
%zigzag {
@include zigzag($zzbgc);
}
// Modifier: Gray background
.zigzag--gray,
%zigzag--gray {
@include zigzag($brand-gray-10);
}
// Modifier: Primary background
.zigzag--primary,
%zigzag--primary {
@include zigzag($brand-primary-25);
}
No notes defined.