pagination.scss 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. @use 'mixins/mixins' as *;
  2. @use 'mixins/utils' as *;
  3. @use 'mixins/var' as *;
  4. @use 'common/var' as *;
  5. @mixin pagination-button {
  6. display: flex;
  7. justify-content: center;
  8. align-items: center;
  9. font-size: getCssVar('pagination-font-size');
  10. min-width: getCssVar('pagination-button-width');
  11. height: getCssVar('pagination-button-height');
  12. line-height: getCssVar('pagination-button-height');
  13. color: getCssVar('pagination-button-color');
  14. background: getCssVar('pagination-bg-color');
  15. padding: 0 4px;
  16. border: none;
  17. border-radius: getCssVar('pagination-border-radius');
  18. cursor: pointer;
  19. text-align: center;
  20. box-sizing: border-box;
  21. * {
  22. pointer-events: none;
  23. }
  24. &:focus {
  25. outline: none;
  26. }
  27. &:hover {
  28. color: getCssVar('pagination-hover-color');
  29. }
  30. &.is-active {
  31. color: getCssVar('pagination-hover-color');
  32. cursor: default;
  33. font-weight: bold;
  34. &.is-disabled {
  35. font-weight: bold;
  36. color: getCssVar('text-color', 'secondary');
  37. }
  38. }
  39. &:disabled,
  40. &.is-disabled {
  41. color: getCssVar('pagination-button-disabled-color');
  42. background-color: getCssVar('pagination-button-disabled-bg-color');
  43. cursor: not-allowed;
  44. }
  45. &:focus-visible {
  46. outline: 1px solid getCssVar('pagination-hover-color');
  47. outline-offset: -1px;
  48. }
  49. }
  50. @include b(pagination) {
  51. @include set-component-css-var('pagination', $pagination);
  52. white-space: nowrap;
  53. color: getCssVar('pagination-text-color');
  54. font-size: getCssVar('pagination-font-size');
  55. font-weight: normal;
  56. display: flex;
  57. align-items: center;
  58. .#{$namespace}-input__inner {
  59. text-align: center;
  60. -moz-appearance: textfield;
  61. }
  62. .#{$namespace}-select {
  63. width: 128px;
  64. }
  65. button {
  66. @include pagination-button;
  67. }
  68. .btn-prev,
  69. .btn-next {
  70. .#{$namespace}-icon {
  71. display: block;
  72. font-size: 12px;
  73. font-weight: bold;
  74. width: inherit;
  75. }
  76. }
  77. & > * {
  78. @include when(first) {
  79. margin-left: 0 !important;
  80. }
  81. @include when(last) {
  82. margin-right: 0 !important;
  83. }
  84. }
  85. .btn-prev {
  86. margin-left: getCssVar('pagination-item-gap');
  87. }
  88. @include e(sizes) {
  89. margin-left: getCssVar('pagination-item-gap');
  90. font-weight: normal;
  91. color: getCssVar('text-color', 'regular');
  92. }
  93. @include e(total) {
  94. margin-left: getCssVar('pagination-item-gap');
  95. font-weight: normal;
  96. color: getCssVar('text-color', 'regular');
  97. &[disabled='true'] {
  98. color: getCssVar('text-color', 'placeholder');
  99. }
  100. }
  101. @include e(jump) {
  102. display: flex;
  103. align-items: center;
  104. margin-left: getCssVar('pagination-item-gap');
  105. font-weight: normal;
  106. color: getCssVar('text-color', 'regular');
  107. &[disabled='true'] {
  108. color: getCssVar('text-color', 'placeholder');
  109. }
  110. @include e(goto) {
  111. margin-right: 8px;
  112. }
  113. @include e(editor) {
  114. text-align: center;
  115. box-sizing: border-box;
  116. &.#{$namespace}-input {
  117. width: 56px;
  118. }
  119. .#{$namespace}-input__inner::-webkit-inner-spin-button,
  120. .#{$namespace}-input__inner::-webkit-outer-spin-button {
  121. -webkit-appearance: none;
  122. margin: 0;
  123. }
  124. }
  125. @include e(classifier) {
  126. margin-left: 8px;
  127. }
  128. }
  129. @include e(rightwrapper) {
  130. flex: 1;
  131. display: flex;
  132. align-items: center;
  133. justify-content: flex-end;
  134. }
  135. @include when(background) {
  136. .btn-prev,
  137. .btn-next,
  138. .#{$namespace}-pager li {
  139. margin: 0 4px;
  140. background-color: getCssVar('pagination-button-bg-color');
  141. &.is-active {
  142. background-color: getCssVar('color-primary');
  143. color: getCssVar('color-white');
  144. }
  145. &:disabled,
  146. &.is-disabled {
  147. color: getCssVar('text-color', 'placeholder');
  148. background-color: getCssVar('disabled-bg-color');
  149. &.is-active {
  150. color: getCssVar('text-color', 'secondary');
  151. background-color: getCssVar('fill-color', 'dark');
  152. }
  153. }
  154. }
  155. .btn-prev {
  156. margin-left: getCssVar('pagination-item-gap');
  157. }
  158. }
  159. @include m(small) {
  160. .btn-prev,
  161. .btn-next,
  162. .#{$namespace}-pager li {
  163. height: getCssVar('pagination-button-height-small');
  164. line-height: getCssVar('pagination-button-height-small');
  165. font-size: getCssVar('pagination-font-size-small');
  166. min-width: getCssVar('pagination-button-width-small');
  167. }
  168. span:not([class*='suffix']),
  169. button {
  170. font-size: getCssVar('pagination-font-size-small');
  171. }
  172. .#{$namespace}-select {
  173. width: 100px;
  174. }
  175. }
  176. @include m(large) {
  177. .btn-prev,
  178. .btn-next,
  179. .#{$namespace}-pager li {
  180. height: getCssVar('pagination-button-height-large');
  181. line-height: getCssVar('pagination-button-height-large');
  182. min-width: getCssVar('pagination-button-width-large');
  183. }
  184. .#{$namespace}-select .#{$namespace}-input {
  185. width: 160px;
  186. }
  187. }
  188. }
  189. @include b(pager) {
  190. user-select: none;
  191. list-style: none;
  192. font-size: 0;
  193. padding: 0;
  194. margin: 0;
  195. display: flex;
  196. align-items: center;
  197. li {
  198. @include pagination-button;
  199. }
  200. }