Skip to content

Instantly share code, notes, and snippets.

@cherihung
Last active December 15, 2015 18:38
Show Gist options
  • Save cherihung/5304845 to your computer and use it in GitHub Desktop.
Save cherihung/5304845 to your computer and use it in GitHub Desktop.
LESS mixins to draw left or right arrows in CSS3.
.rightArrow(@color, @alpha, @size) {
left: 100%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
border-left-color: @color;
border-width: @size*@px;
top: 50%;
margin-top: (0-@size)*@px;
}
.bottomArrow(@color, @alpha, @size) {
top: 100%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
border-top-color: @color;
border-width: @size*@px;
left: 50%;
margin-left: (0-@size)*@px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment