index.less 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. @pagination-prefix-cls: rc-pagination;
  2. @primary-color: #1890ff;
  3. @pagination-item-bg: #fff;
  4. @pagination-item-size: 28px;
  5. @pagination-item-size-sm: 24px;
  6. @pagination-font-family: Arial;
  7. @pagination-font-weight-active: 500;
  8. @pagination-item-bg-active: #fff;
  9. @pagination-item-link-bg: #fff;
  10. @pagination-item-disabled-color-active: #fff;
  11. @pagination-item-disabled-bg-active: darken(hsv(0, 0, 96%), 10%);
  12. @pagination-item-input-bg: #fff;
  13. .@{pagination-prefix-cls} {
  14. display: flex;
  15. margin: 0;
  16. padding: 0;
  17. font-size: 14px;
  18. ul,
  19. ol {
  20. margin: 0;
  21. padding: 0;
  22. list-style: none;
  23. }
  24. &-start {
  25. justify-content: start;
  26. }
  27. &-center {
  28. justify-content: center;
  29. }
  30. &-end {
  31. justify-content: end;
  32. }
  33. &::after {
  34. display: block;
  35. clear: both;
  36. height: 0;
  37. overflow: hidden;
  38. visibility: hidden;
  39. content: ' ';
  40. }
  41. &-total-text {
  42. display: inline-block;
  43. height: @pagination-item-size;
  44. margin-right: 8px;
  45. line-height: @pagination-item-size - 2px;
  46. vertical-align: middle;
  47. }
  48. &-item {
  49. display: inline-block;
  50. min-width: @pagination-item-size;
  51. height: @pagination-item-size;
  52. margin-right: 8px;
  53. font-family: @pagination-font-family;
  54. line-height: @pagination-item-size - 2px;
  55. text-align: center;
  56. vertical-align: middle;
  57. list-style: none;
  58. background-color: @pagination-item-bg;
  59. border: 1px solid #d9d9d9;
  60. border-radius: 2px;
  61. outline: 0;
  62. cursor: pointer;
  63. user-select: none;
  64. a {
  65. display: block;
  66. padding: 0 6px;
  67. color: rgba(0, 0, 0, 0.85);
  68. transition: none;
  69. &:hover {
  70. text-decoration: none;
  71. }
  72. }
  73. &:focus,
  74. &:hover {
  75. border-color: @primary-color;
  76. transition: all 0.3s;
  77. a {
  78. color: @primary-color;
  79. }
  80. }
  81. &-active {
  82. font-weight: @pagination-font-weight-active;
  83. background: @pagination-item-bg-active;
  84. border-color: @primary-color;
  85. a {
  86. color: @primary-color;
  87. }
  88. &:focus,
  89. &:hover {
  90. border-color: #40a9ff;
  91. }
  92. &:focus a,
  93. &:hover a {
  94. color: #40a9ff;
  95. }
  96. }
  97. }
  98. &-jump-prev,
  99. &-jump-next {
  100. outline: 0;
  101. button {
  102. background: transparent;
  103. border: none;
  104. cursor: pointer;
  105. color: #666;
  106. }
  107. button:after {
  108. display: block;
  109. content: '•••';
  110. }
  111. }
  112. &-prev,
  113. &-jump-prev,
  114. &-jump-next {
  115. margin-right: 8px;
  116. }
  117. &-prev,
  118. &-next,
  119. &-jump-prev,
  120. &-jump-next {
  121. display: inline-block;
  122. min-width: @pagination-item-size;
  123. height: @pagination-item-size;
  124. color: rgba(0, 0, 0, 0.85);
  125. font-family: @pagination-font-family;
  126. line-height: @pagination-item-size;
  127. text-align: center;
  128. vertical-align: middle;
  129. list-style: none;
  130. border-radius: 2px;
  131. cursor: pointer;
  132. transition: all 0.3s;
  133. }
  134. &-prev,
  135. &-next {
  136. outline: 0;
  137. button {
  138. color: rgba(0, 0, 0, 0.85);
  139. cursor: pointer;
  140. user-select: none;
  141. }
  142. &:hover button {
  143. border-color: #40a9ff;
  144. }
  145. .@{pagination-prefix-cls}-item-link {
  146. display: block;
  147. width: 100%;
  148. height: 100%;
  149. font-size: 12px;
  150. text-align: center;
  151. background-color: @pagination-item-link-bg;
  152. border: 1px solid #d9d9d9;
  153. border-radius: 2px;
  154. outline: none;
  155. transition: all 0.3s;
  156. }
  157. &:focus .@{pagination-prefix-cls}-item-link,
  158. &:hover .@{pagination-prefix-cls}-item-link {
  159. color: @primary-color;
  160. border-color: @primary-color;
  161. }
  162. }
  163. &-prev button:after {
  164. content: '‹';
  165. display: block;
  166. }
  167. &-next button:after {
  168. content: '›';
  169. display: block;
  170. }
  171. &-disabled {
  172. &,
  173. &:hover,
  174. &:focus {
  175. cursor: not-allowed;
  176. .@{pagination-prefix-cls}-item-link {
  177. color: fade(#000, 25%);
  178. border-color: #d9d9d9;
  179. cursor: not-allowed;
  180. }
  181. }
  182. }
  183. &-slash {
  184. margin: 0 10px 0 12px;
  185. }
  186. &-options {
  187. display: inline-block;
  188. margin-left: 16px;
  189. vertical-align: middle;
  190. // IE11 css hack. `*::-ms-backdrop,` is a must have
  191. @media all and (-ms-high-contrast: none) {
  192. *::-ms-backdrop,
  193. & {
  194. vertical-align: top;
  195. }
  196. }
  197. &-size-changer.rc-select {
  198. display: inline-block;
  199. width: auto;
  200. margin-right: 8px;
  201. }
  202. &-quick-jumper {
  203. display: inline-block;
  204. height: 28px;
  205. line-height: 28px;
  206. vertical-align: top;
  207. input {
  208. width: 50px;
  209. margin: 0 8px;
  210. }
  211. }
  212. }
  213. &-simple &-prev,
  214. &-simple &-next {
  215. height: @pagination-item-size-sm;
  216. line-height: @pagination-item-size-sm;
  217. vertical-align: top;
  218. .@{pagination-prefix-cls}-item-link {
  219. height: @pagination-item-size-sm;
  220. background-color: transparent;
  221. border: 0;
  222. &::after {
  223. height: @pagination-item-size-sm;
  224. line-height: @pagination-item-size-sm;
  225. }
  226. }
  227. }
  228. &-simple &-simple-pager {
  229. display: flex;
  230. align-items: center;
  231. height: @pagination-item-size-sm;
  232. margin-right: 8px;
  233. input {
  234. box-sizing: border-box;
  235. height: 100%;
  236. padding: 0 6px;
  237. text-align: center;
  238. background-color: @pagination-item-input-bg;
  239. border: 1px solid #d9d9d9;
  240. border-radius: 2px;
  241. outline: none;
  242. transition: border-color 0.3s;
  243. &:hover {
  244. border-color: @primary-color;
  245. }
  246. }
  247. }
  248. // ============================ Disabled ============================
  249. &&-disabled {
  250. cursor: not-allowed;
  251. .@{pagination-prefix-cls}-item {
  252. background: hsv(0, 0, 96%);
  253. border-color: #d9d9d9;
  254. cursor: not-allowed;
  255. a {
  256. color: fade(#000, 25%);
  257. background: transparent;
  258. border: none;
  259. cursor: not-allowed;
  260. }
  261. &-active {
  262. background: @pagination-item-disabled-bg-active;
  263. border-color: transparent;
  264. a {
  265. color: @pagination-item-disabled-color-active;
  266. }
  267. }
  268. }
  269. .@{pagination-prefix-cls}-item-link {
  270. color: fade(#000, 25%);
  271. background: hsv(0, 0, 96%);
  272. border-color: #d9d9d9;
  273. cursor: not-allowed;
  274. }
  275. .@{pagination-prefix-cls}-item-link-icon {
  276. opacity: 0;
  277. }
  278. .@{pagination-prefix-cls}-item-ellipsis {
  279. opacity: 1;
  280. }
  281. }
  282. }
  283. @media only screen and (max-width: 992px) {
  284. .@{pagination-prefix-cls}-item {
  285. &-after-jump-prev,
  286. &-before-jump-next {
  287. display: none;
  288. }
  289. }
  290. }
  291. @media only screen and (max-width: 576px) {
  292. .@{pagination-prefix-cls}-options {
  293. display: none;
  294. }
  295. }