pagination.less 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. @import url('../../swiper-vars.less');
  2. :root {
  3. /*
  4. --swiper-pagination-color: var(--swiper-theme-color);
  5. --swiper-pagination-bullet-size: 8px;
  6. --swiper-pagination-bullet-width: 8px;
  7. --swiper-pagination-bullet-height: 8px;
  8. --swiper-pagination-bullet-inactive-color: #000;
  9. --swiper-pagination-bullet-inactive-opacity: 0.2;
  10. --swiper-pagination-bullet-opacity: 1;
  11. --swiper-pagination-bullet-horizontal-gap: 4px;
  12. --swiper-pagination-bullet-vertical-gap: 6px;
  13. */
  14. }
  15. .swiper-pagination {
  16. position: absolute;
  17. text-align: center;
  18. transition: 300ms opacity;
  19. transform: translate3d(0, 0, 0);
  20. z-index: 10;
  21. &.swiper-pagination-hidden {
  22. opacity: 0;
  23. }
  24. .swiper-pagination-disabled > &,
  25. &.swiper-pagination-disabled {
  26. display: none !important;
  27. }
  28. }
  29. /* Common Styles */
  30. .swiper-pagination-fraction,
  31. .swiper-pagination-custom,
  32. .swiper-horizontal > .swiper-pagination-bullets,
  33. .swiper-pagination-bullets.swiper-pagination-horizontal {
  34. bottom: 10px;
  35. left: 0;
  36. width: 100%;
  37. }
  38. /* Bullets */
  39. .swiper-pagination-bullets-dynamic {
  40. overflow: hidden;
  41. font-size: 0;
  42. .swiper-pagination-bullet {
  43. transform: scale(0.33);
  44. position: relative;
  45. }
  46. .swiper-pagination-bullet-active {
  47. transform: scale(1);
  48. }
  49. .swiper-pagination-bullet-active-main {
  50. transform: scale(1);
  51. }
  52. .swiper-pagination-bullet-active-prev {
  53. transform: scale(0.66);
  54. }
  55. .swiper-pagination-bullet-active-prev-prev {
  56. transform: scale(0.33);
  57. }
  58. .swiper-pagination-bullet-active-next {
  59. transform: scale(0.66);
  60. }
  61. .swiper-pagination-bullet-active-next-next {
  62. transform: scale(0.33);
  63. }
  64. }
  65. .swiper-pagination-bullet {
  66. width: var(--swiper-pagination-bullet-width, var(--swiper-pagination-bullet-size, 8px));
  67. height: var(--swiper-pagination-bullet-height, var(--swiper-pagination-bullet-size, 8px));
  68. display: inline-block;
  69. border-radius: 50%;
  70. background: var(--swiper-pagination-bullet-inactive-color, #000);
  71. opacity: var(--swiper-pagination-bullet-inactive-opacity, 0.2);
  72. button& {
  73. border: none;
  74. margin: 0;
  75. padding: 0;
  76. box-shadow: none;
  77. appearance: none;
  78. }
  79. .swiper-pagination-clickable & {
  80. cursor: pointer;
  81. }
  82. &:only-child {
  83. display: none !important;
  84. }
  85. }
  86. .swiper-pagination-bullet-active {
  87. opacity: var(--swiper-pagination-bullet-opacity, 1);
  88. background: var(--swiper-pagination-color, var(--swiper-theme-color));
  89. }
  90. .swiper-vertical > .swiper-pagination-bullets,
  91. .swiper-pagination-vertical.swiper-pagination-bullets {
  92. right: 10px;
  93. top: 50%;
  94. transform: translate3d(0px, -50%, 0);
  95. .swiper-pagination-bullet {
  96. margin: var(--swiper-pagination-bullet-vertical-gap, 6px) 0;
  97. display: block;
  98. }
  99. &.swiper-pagination-bullets-dynamic {
  100. top: 50%;
  101. transform: translateY(-50%);
  102. width: 8px;
  103. .swiper-pagination-bullet {
  104. display: inline-block;
  105. transition: 200ms transform, 200ms top;
  106. }
  107. }
  108. }
  109. .swiper-horizontal > .swiper-pagination-bullets,
  110. .swiper-pagination-horizontal.swiper-pagination-bullets {
  111. .swiper-pagination-bullet {
  112. margin: 0 var(--swiper-pagination-bullet-horizontal-gap, 4px);
  113. }
  114. &.swiper-pagination-bullets-dynamic {
  115. left: 50%;
  116. transform: translateX(-50%);
  117. white-space: nowrap;
  118. .swiper-pagination-bullet {
  119. transition: 200ms transform, 200ms left;
  120. }
  121. }
  122. }
  123. .swiper-horizontal.swiper-rtl > .swiper-pagination-bullets-dynamic .swiper-pagination-bullet {
  124. transition: 200ms transform, 200ms right;
  125. }
  126. /* Progress */
  127. .swiper-pagination-progressbar {
  128. background: rgba(0, 0, 0, 0.25);
  129. position: absolute;
  130. .swiper-pagination-progressbar-fill {
  131. background: var(--swiper-pagination-color, var(--swiper-theme-color));
  132. position: absolute;
  133. left: 0;
  134. top: 0;
  135. width: 100%;
  136. height: 100%;
  137. transform: scale(0);
  138. transform-origin: left top;
  139. }
  140. .swiper-rtl & .swiper-pagination-progressbar-fill {
  141. transform-origin: right top;
  142. }
  143. .swiper-horizontal > &,
  144. &.swiper-pagination-horizontal,
  145. .swiper-vertical > &.swiper-pagination-progressbar-opposite,
  146. &.swiper-pagination-vertical.swiper-pagination-progressbar-opposite {
  147. width: 100%;
  148. height: 4px;
  149. left: 0;
  150. top: 0;
  151. }
  152. .swiper-vertical > &,
  153. &.swiper-pagination-vertical,
  154. .swiper-horizontal > &.swiper-pagination-progressbar-opposite,
  155. &.swiper-pagination-horizontal.swiper-pagination-progressbar-opposite {
  156. width: 4px;
  157. height: 100%;
  158. left: 0;
  159. top: 0;
  160. }
  161. }
  162. .swiper-pagination-lock {
  163. display: none;
  164. }