mixin.scss 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. @mixin clearfix {
  2. &:after {
  3. content: "";
  4. display: table;
  5. clear: both;
  6. }
  7. }
  8. @mixin scrollBar {
  9. &::-webkit-scrollbar-track-piece {
  10. background: #d3dce6;
  11. }
  12. &::-webkit-scrollbar {
  13. width: 6px;
  14. }
  15. &::-webkit-scrollbar-thumb {
  16. background: #99a9bf;
  17. border-radius: 20px;
  18. }
  19. }
  20. @mixin relative {
  21. position: relative;
  22. width: 100%;
  23. height: 100%;
  24. }
  25. @mixin pct($pct) {
  26. width: #{$pct};
  27. position: relative;
  28. margin: 0 auto;
  29. }
  30. @mixin triangle($width, $height, $color, $direction) {
  31. $width: $width/2;
  32. $color-border-style: $height solid $color;
  33. $transparent-border-style: $width solid transparent;
  34. height: 0;
  35. width: 0;
  36. @if $direction==up {
  37. border-bottom: $color-border-style;
  38. border-left: $transparent-border-style;
  39. border-right: $transparent-border-style;
  40. }
  41. @else if $direction==right {
  42. border-left: $color-border-style;
  43. border-top: $transparent-border-style;
  44. border-bottom: $transparent-border-style;
  45. }
  46. @else if $direction==down {
  47. border-top: $color-border-style;
  48. border-left: $transparent-border-style;
  49. border-right: $transparent-border-style;
  50. }
  51. @else if $direction==left {
  52. border-right: $color-border-style;
  53. border-top: $transparent-border-style;
  54. border-bottom: $transparent-border-style;
  55. }
  56. }