Skip to content

Instantly share code, notes, and snippets.

@EvanLovely
Created August 29, 2013 07:06
Show Gist options
  • Save EvanLovely/6375005 to your computer and use it in GitHub Desktop.
Save EvanLovely/6375005 to your computer and use it in GitHub Desktop.
A Pen by Evan Lovely.
<div class="box"></div>
<br />
<div class="box bigger"></div>
@import "compass";
@mixin arrow($size:6px, $color: #2f89c3, $sides: both) {
position: relative;
&:before,
&:after {
content: "";
border-bottom: $color $size solid;
position: absolute;
top: -1 * $size;
}
@if $sides == left or both {
&:before {
border-left: transparent $size solid;
margin-left: -1 * $size;
}
}
@if $sides == right or both {
&:after {
border-right: transparent $size solid;
margin-right: (-1 * $size) + 1;
}
}
}
.box {
margin: 1em;
padding: 0.75em;
background: #2f89c3;
width: 50px;
height: 50px;
@include arrow($sides: both);
}
.box.bigger {
@include arrow(10px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment