Skip to content

Instantly share code, notes, and snippets.

@rafaelrinaldi
Created November 20, 2013 21:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafaelrinaldi/7571083 to your computer and use it in GitHub Desktop.
Save rafaelrinaldi/7571083 to your computer and use it in GitHub Desktop.
Pure CSS carets mixin.
/**
* Pure CSS carets mixin.
* http://css-tricks.com/snippets/css/css-triangle
*/
@mixin caret($size: 3px, $color: #ccc, $direction: "down") {
width: 0;
height: 0;
@if $direction == "down" {
border-left: $size solid transparent;
border-right: $size solid transparent;
border-top: $size solid $color;
} @else if $direction == "up" {
border-left: $size solid transparent;
border-right: $size solid transparent;
border-bottom: $size solid $color;
} @else if $direction == "left" {
border-top: $size solid transparent;
border-bottom: $size solid transparent;
border-right:$size solid blue;
} @else if $direction == "right" {
border-top: $size solid transparent;
border-bottom: $size solid transparent;
border-left: $size solid $color;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment