pagination.scss 5.0 KB

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