Last active
December 15, 2015 18:38
-
-
Save cherihung/5304845 to your computer and use it in GitHub Desktop.
LESS mixins to draw left or right arrows in CSS3.
This file contains 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
.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