index.scss 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. @import '../common/abstracts/variable';
  2. @import '../common/abstracts/mixin';
  3. @include b(swiper-nav) {
  4. @include e(btn) {
  5. @include m(prev, next) {
  6. position: absolute;
  7. top: 50%;
  8. transform: translateY(-50%);
  9. width: $-swiper-nav-btn-size;
  10. height: $-swiper-nav-btn-size;
  11. border-radius: 50%;
  12. background: $-swiper-nav-btn-bg-color;
  13. &::after {
  14. position: absolute;
  15. left: 50%;
  16. top: 50%;
  17. display: block;
  18. content: '';
  19. width: 12rpx;
  20. height: 12rpx;
  21. border-color: $-swiper-nav-btn-color;
  22. border-style: solid;
  23. }
  24. }
  25. @include m(prev) {
  26. left: 30rpx;
  27. &::after {
  28. margin-left: 4rpx;
  29. border-width: 2rpx 0 0 2rpx;
  30. transform: translate(-50%, -50%) rotateZ(-45deg);
  31. }
  32. }
  33. @include m(next) {
  34. right: 30rpx;
  35. &::after {
  36. margin-left: -4rpx;
  37. border-width: 2rpx 2rpx 0 0;
  38. transform: translate(-50%, -50%) rotateZ(45deg);
  39. }
  40. }
  41. }
  42. @include m(dots, dots-bar) {
  43. display: flex;
  44. flex-direction: row;
  45. }
  46. @include m(fraction) {
  47. padding: 0 16rpx;
  48. height: $-swiper-nav-fraction-height;
  49. line-height: $-swiper-nav-fraction-height;
  50. border-radius: calc($-swiper-nav-fraction-height / 2);
  51. background: $-swiper-nav-fraction-bg-color;
  52. color: $-swiper-nav-fraction-color;
  53. font-size: $-swiper-nav-fraction-font-size;
  54. }
  55. @include e(item) {
  56. @include m(dots, dots-bar) {
  57. width: $-swiper-nav-dot-size;
  58. height: $-swiper-nav-dot-size;
  59. background: $-swiper-nav-dot-color;
  60. border-radius: 50%;
  61. margin: 0 10rpx;
  62. transition: all 0.4s ease-in;
  63. @include when(vertical) {
  64. margin: 10rpx 0;
  65. }
  66. @include when(active) {
  67. background-color: $-swiper-nav-dot-active-color;
  68. }
  69. }
  70. @include m(dots-bar) {
  71. @include when(vertical) {
  72. @include when(active) {
  73. width: $-swiper-nav-dot-size;
  74. height: $-swiper-nav-dots-bar-active-width;
  75. }
  76. }
  77. @include when(active) {
  78. width: $-swiper-nav-dots-bar-active-width;
  79. border-radius: calc($-swiper-nav-dot-size / 2);
  80. background-color: $-swiper-nav-dot-active-color;
  81. }
  82. }
  83. }
  84. @include m(left) {
  85. position: absolute;
  86. left: 24rpx;
  87. top: 50%;
  88. transform: translateY(-50%);
  89. }
  90. @include m(right) {
  91. position: absolute;
  92. right: 24rpx;
  93. top: 50%;
  94. transform: translateY(-50%);
  95. }
  96. @include m(top-left) {
  97. position: absolute;
  98. top: 24rpx;
  99. left: 24rpx;
  100. }
  101. @include m(top) {
  102. position: absolute;
  103. left: 50%;
  104. top: 24rpx;
  105. transform: translateX(-50%);
  106. }
  107. @include m(top-right) {
  108. position: absolute;
  109. top: 24rpx;
  110. right: 24rpx;
  111. }
  112. @include m(bottom-left) {
  113. position: absolute;
  114. left: 24rpx;
  115. bottom: 24rpx;
  116. }
  117. @include m(bottom) {
  118. position: absolute;
  119. left: 50%;
  120. bottom: 24rpx;
  121. transform: translateX(-50%);
  122. }
  123. @include m(bottom-right) {
  124. position: absolute;
  125. right: 24rpx;
  126. bottom: 24rpx;
  127. }
  128. @include m(vertical) {
  129. flex-direction: column;
  130. }
  131. }