Advertisement
Guest User

Untitled

a guest
May 6th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. @mixin arrow($settings){
  2. $arrow-direction: map-get($settings, direction);
  3. $arrow-color: map-get($settings, color);
  4. $arrow-size: map-get($settings, size);
  5.  
  6. width: 0;
  7. height: 0;
  8. display: inline-block;
  9.  
  10. @if ($arrow-direction == down){
  11. border-left: $arrow-size solid transparent;
  12. border-right: $arrow-size solid transparent;
  13. border-top: $arrow-size solid $arrow-color;
  14. } @else if ($arrow-direction == up) {
  15. border-left: $arrow-size solid transparent;
  16. border-right: $arrow-size solid transparent;
  17. border-bottom: $arrow-size solid $arrow-color;
  18. } @else if ($arrow-direction == left){
  19. border-top: $arrow-size solid transparent;
  20. border-bottom: $arrow-size solid transparent;
  21. border-right: $arrow-size solid $arrow-color;
  22. } @else if ($arrow-direction == right){
  23. border-top: $arrow-size solid transparent;
  24. border-bottom: $arrow-size solid transparent;
  25. border-left: $arrow-size solid $arrow-color;
  26. }
  27. }
  28.  
  29. //EXAMPLE USAGE
  30.  
  31. .right {
  32. @include arrow((
  33. direction: 'right',
  34. color: orange,
  35. size: 30px
  36. ));
  37. }
  38.  
  39. .down {
  40. @include arrow((
  41. direction: 'down',
  42. color: black,
  43. size: 30px
  44. ));
  45. }
  46.  
  47. .up {
  48. @include arrow((
  49. direction: 'up',
  50. color: blue,
  51. size: 60px
  52. ));
  53. }
  54.  
  55. .left {
  56. @include arrow((
  57. direction: 'left',
  58. color: red,
  59. size: 10px
  60. ));
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement