Skip to content

Instantly share code, notes, and snippets.

@miguelgr
Created November 19, 2013 22:59
Show Gist options
  • Save miguelgr/7554128 to your computer and use it in GitHub Desktop.
Save miguelgr/7554128 to your computer and use it in GitHub Desktop.
Sharped box
=sharped_box($width, $height, $point, $color, $two_sides: false)
height: $height
width: $width
background: $color
position: absolute
.caret
$opposite: opposite-position($point)
border: $height/2 solid transparent
border-#{$opposite}: $height/2 solid $color
border-#{$point}: 0
height: 0
width: 0
position: absolute
#{$point}: -$height/2
top: 0px
@if $two_sides
.caret_2
$opposite: opposite-position($point)
border: $height/2 solid transparent
border-#{$point}: $height/2 solid $color
border-#{$opposite}: 0
height: 0
width: 0
position: absolute
#{$opposite}: -$height/2
top: 0px
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment