A Pen by Evan Lovely on CodePen.
Created
August 29, 2013 07:06
-
-
Save EvanLovely/6375005 to your computer and use it in GitHub Desktop.
A Pen by Evan Lovely.
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
<div class="box"></div> | |
<br /> | |
<div class="box bigger"></div> |
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
@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