Last active
February 20, 2020 16:13
-
-
Save rizkysyazuli/6c55ca2be33c754984e8 to your computer and use it in GitHub Desktop.
[SCSS - Triangle] #scss
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
@mixin css-triangle($triangle-size, $triangle-color, $triangle-direction) { | |
content: ""; | |
display: block; | |
width: 0; | |
height: 0; | |
border: inset $triangle-size; | |
@if ($triangle-direction == top) { | |
border-color: $triangle-color transparent transparent transparent; | |
border-top-style: solid; | |
} | |
@if ($triangle-direction == bottom) { | |
border-color: transparent transparent $triangle-color transparent; | |
border-bottom-style: solid; | |
} | |
@if ($triangle-direction == left) { | |
border-color: transparent transparent transparent $triangle-color; | |
border-left-style: solid; | |
} | |
@if ($triangle-direction == right) { | |
border-color: transparent $triangle-color transparent transparent; | |
border-right-style: solid; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment