pagination.less 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. //
  2. // Pagination
  3. // --------------------------------------------------
  4. .pagination {
  5. position: relative;
  6. display: block;
  7. background: @pagination-bg;
  8. color: @pagination-color;
  9. padding: 0;
  10. display: inline-block;
  11. border-radius: @pagination-border-radius;
  12. word-spacing: -0.5px;
  13. @media (min-width: @screen-sm-min) {
  14. display: inline-block;
  15. }
  16. @media (max-width: @screen-xs-max) {
  17. height: 41px;
  18. padding: 0 55px 0 52px;
  19. overflow: auto;
  20. white-space: nowrap;
  21. border-radius: @pagination-border-radius;
  22. }
  23. li {
  24. display: inline-block;
  25. margin-right: -2px;
  26. vertical-align: middle;
  27. word-spacing: normal;
  28. a {
  29. position: static;
  30. }
  31. // Pseudos and states
  32. &.active {
  33. > a, > span {
  34. background-color: @pagination-hover-bg;
  35. color: @inverse;
  36. border-color: mix(@pagination-bg, white, 80%);
  37. &,
  38. &:hover,
  39. &:focus {
  40. background-color: @pagination-hover-bg;
  41. color: @pagination-color;
  42. border-color: mix(@pagination-bg, white, 80%);
  43. }
  44. }
  45. &.previous,
  46. &.next {
  47. > a, > span {
  48. margin: 0;
  49. &,
  50. &:hover,
  51. &:focus {
  52. background-color: @pagination-hover-bg;
  53. color: @pagination-color;
  54. }
  55. }
  56. }
  57. }
  58. &:first-child {
  59. > a,
  60. > span {
  61. border-radius: @pagination-border-radius 0 0 @pagination-border-radius;
  62. border-left: none;
  63. }
  64. &.previous + li {
  65. > a,
  66. > span {
  67. border-left-width: 0;
  68. }
  69. }
  70. }
  71. &:last-child {
  72. margin-right: 0;
  73. > a,
  74. > span {
  75. &,
  76. &:hover,
  77. &:focus {
  78. border-radius: 0 @pagination-border-radius @pagination-border-radius 0;
  79. }
  80. }
  81. }
  82. &.previous,
  83. &.next {
  84. > a,
  85. > span {
  86. border-right: 2px solid mix(@pagination-bg, white, 66%);
  87. font-size: floor((@component-font-size-base * 1.067)); // ~16px
  88. min-width: auto;
  89. padding: 12px 17px;
  90. background-color: transparent;
  91. }
  92. }
  93. &.next {
  94. > a,
  95. > span {
  96. border-right: none;
  97. }
  98. }
  99. &.disabled {
  100. > a,
  101. > span {
  102. color: @pagination-color;
  103. background-color: fade(@inverse, 30%);
  104. border-right-color: mix(@pagination-bg, white, 80%);
  105. cursor: @cursor-disabled;
  106. &:hover,
  107. &:focus,
  108. &:active {
  109. background-color: fade(@inverse, 40%);
  110. color: @pagination-color;
  111. }
  112. }
  113. }
  114. @media (max-width: @screen-xs-max) {
  115. &.next,
  116. &.previous {
  117. background-color: @pagination-bg;
  118. position: absolute;
  119. right: 0;
  120. top: 0;
  121. z-index: 10;
  122. border-radius: 0 @pagination-border-radius @pagination-border-radius 0;
  123. }
  124. &.previous {
  125. left: 0;
  126. right: auto;
  127. border-radius: @pagination-border-radius 0 0 @pagination-border-radius;
  128. }
  129. }
  130. // Link
  131. > a,
  132. > span {
  133. display: inline-block;
  134. background: transparent;
  135. border: none;
  136. border-left: 2px solid mix(@pagination-bg, white, 66%);
  137. color: @inverse;
  138. font-size: ceil((@component-font-size-base * 0.933)); // ~14px
  139. line-height: 16px;
  140. min-height: 41px;
  141. min-width: 41px;
  142. outline: none;
  143. padding: 12px 10px;
  144. text-align: center;
  145. transition: .25s ease-out;
  146. &:hover,
  147. &:focus {
  148. background-color: @pagination-hover-bg;
  149. color: @pagination-color;
  150. }
  151. &:active {
  152. background-color: @pagination-hover-bg;
  153. color: @pagination-color;
  154. }
  155. }
  156. }
  157. // Navigation buttons
  158. > .btn {
  159. &.previous,
  160. &.next {
  161. margin-right: 8px;
  162. font-size: ceil((@component-font-size-base * 0.933)); // ~14px
  163. line-height: 1.429; // ~20px
  164. padding-left: 23px;
  165. padding-right: 23px;
  166. [class*="fui-"] {
  167. font-size: @icon-normal;
  168. margin-left: -2px;
  169. margin-top: -2px;
  170. }
  171. }
  172. &.next {
  173. margin-left: 8px;
  174. margin-right: 0;
  175. [class*="fui-"] {
  176. margin-right: -2px;
  177. margin-left: 4px;
  178. }
  179. }
  180. }
  181. // Responsive
  182. // --------------------------------------
  183. @media (max-width: @screen-xs-max) {
  184. & {
  185. > .btn {
  186. display: block;
  187. margin: 0;
  188. width: 50%;
  189. &:first-child {
  190. border-bottom: 2px solid mix(@pagination-bg, white, 80%);
  191. border-radius: @pagination-border-radius 0 0;
  192. &.btn-primary { border-bottom-color: mix(@brand-secondary, white, 80%); }
  193. &.btn-danger { border-bottom-color: mix(@brand-danger, white, 80%); }
  194. &.btn-warning { border-bottom-color: mix(@brand-warning, white, 80%); }
  195. &.btn-success { border-bottom-color: mix(@brand-success, white, 80%); }
  196. &.btn-info { border-bottom-color: mix(@brand-info, white, 80%); }
  197. &.btn-inverse { border-bottom-color: mix(@brand-primary, white, 80%); }
  198. > [class*="fui"] { margin-left: -20px; }
  199. }
  200. & + ul {
  201. padding: 0;
  202. text-align: center;
  203. border-radius: 0 0 @pagination-border-radius @pagination-border-radius;
  204. }
  205. & + ul + .btn {
  206. border-bottom: 2px solid mix(@pagination-bg, white, 80%);
  207. position: absolute;
  208. right: 0;
  209. top: 0;
  210. border-radius: 0 @pagination-border-radius 0 0;
  211. &.btn-primary { border-bottom-color: mix(@brand-secondary, white, 80%); }
  212. &.btn-danger { border-bottom-color: mix(@brand-danger, white, 80%); }
  213. &.btn-warning { border-bottom-color: mix(@brand-warning, white, 80%); }
  214. &.btn-success { border-bottom-color: mix(@brand-success, white, 80%); }
  215. &.btn-info { border-bottom-color: mix(@brand-info, white, 80%); }
  216. &.btn-inverse { border-bottom-color: mix(@brand-primary, white, 80%); }
  217. > [class*="fui"] { margin-right: -20px; }
  218. }
  219. }
  220. ul {
  221. display: block;
  222. > li {
  223. > a {
  224. border-radius: 0;
  225. }
  226. }
  227. }
  228. }
  229. }
  230. }
  231. // Alternate Colors
  232. // --------------------------------------------------
  233. .pagination-danger { .pagination-variant(@brand-danger, @btn-danger-hover-bg, @btn-danger-active-bg); }
  234. .pagination-success { .pagination-variant(@brand-success, @btn-success-hover-bg, @btn-success-active-bg); }
  235. .pagination-warning { .pagination-variant(@brand-warning, @btn-warning-hover-bg, @btn-warning-active-bg); }
  236. .pagination-info { .pagination-variant(@brand-info, @btn-info-hover-bg, @btn-info-active-bg); }
  237. .pagination-inverse { .pagination-variant(@brand-primary, @btn-inverse-hover-bg, @btn-inverse-active-bg); }
  238. // Ultra minimal pagination
  239. // --------------------------------------------------
  240. .pagination-minimal {
  241. > li {
  242. &:first-child {
  243. border-radius: @pagination-border-radius 0 0 @pagination-border-radius;
  244. &.previous + li {
  245. > a,
  246. > span {
  247. border-left-width: 5px;
  248. }
  249. }
  250. }
  251. &:last-child {
  252. border-radius: 0 @pagination-border-radius @pagination-border-radius 0;
  253. }
  254. &.previous,
  255. &.next {
  256. > a,
  257. > span {
  258. background: transparent;
  259. border: none;
  260. border-right: 2px solid mix(@pagination-bg, white, 66%);
  261. margin: 0 9px 0 0;
  262. padding: 12px 17px;
  263. border-radius: @pagination-border-radius 0 0 @pagination-border-radius;
  264. &,
  265. &:hover,
  266. &:focus {
  267. border-color: mix(@pagination-bg, white, 66%) !important;
  268. }
  269. @media (max-width: @screen-xs-max) {
  270. margin-right: 0;
  271. }
  272. }
  273. }
  274. &.next {
  275. margin-left: 9px;
  276. > a,
  277. > span {
  278. border-left: 2px solid mix(@pagination-bg, white, 66%);
  279. border-right: none;
  280. margin: 0;
  281. border-radius: 0 @pagination-border-radius @pagination-border-radius 0;
  282. }
  283. }
  284. &.active {
  285. > a,
  286. > span {
  287. background-color: @inverse;
  288. border-color: @inverse;
  289. border-width: 2px !important;
  290. color: @pagination-bg;
  291. margin: 10px 5px 9px;
  292. &:hover,
  293. &:focus {
  294. background-color: @inverse;
  295. border-color: @inverse;
  296. color: @pagination-bg;
  297. }
  298. }
  299. &.previous,
  300. &.next {
  301. border-color: mix(@pagination-bg, white, 66%);
  302. }
  303. &.previous {
  304. margin-right: 6px;
  305. }
  306. }
  307. // Link
  308. > a,
  309. > span {
  310. background: @inverse;
  311. border: 5px solid @pagination-bg;
  312. color: @inverse;
  313. line-height: 16px;
  314. margin: 7px 2px 6px;
  315. min-width: 0;
  316. min-height: 16px;
  317. padding: 0 4px;
  318. border-radius: 50px;
  319. background-clip: padding-box;
  320. transition: background .2s ease-out, border-color 0s ease-out, color .2s ease-out;
  321. &:hover,
  322. &:focus {
  323. background-color: @pagination-hover-bg;
  324. border-color: @pagination-hover-bg;
  325. color: @inverse;
  326. transition: background .2s ease-out, border-color .2s ease-out, color .2s ease-out;
  327. }
  328. &:active {
  329. background-color: mix(@brand-secondary, black, 85%);
  330. border-color: mix(@brand-secondary, black, 85%);
  331. }
  332. }
  333. }
  334. }
  335. // Text only pagination (no graphics)
  336. // --------------------------------------------------
  337. .pagination-plain {
  338. font-size: floor((@component-font-size-base * 1.067)); // ~16px
  339. font-weight: 700;
  340. list-style-type: none;
  341. margin: 0 0 20px;
  342. padding: 0;
  343. height: 57px;
  344. > li {
  345. display: inline;
  346. &.previous {
  347. padding-right: 23px;
  348. }
  349. &.next {
  350. padding-left: 20px;
  351. }
  352. &.active {
  353. > a {
  354. color: mix(@gray-light, white, 66%);
  355. }
  356. }
  357. > a {
  358. padding: 0 5px;
  359. }
  360. }
  361. @media (max-width: @screen-xs-min) {
  362. overflow: hidden;
  363. text-align: center;
  364. > li {
  365. &.previous {
  366. display: block;
  367. margin-bottom: 10px;
  368. text-align: left;
  369. width: 50%;
  370. }
  371. &.next {
  372. float: right;
  373. margin-top: -64px;
  374. text-align: right;
  375. width: 50%;
  376. }
  377. }
  378. }
  379. @media (min-width: @screen-sm-min) {
  380. height: auto;
  381. }
  382. }
  383. // Pagination dropdown
  384. // --------------------------------------------------
  385. .pagination-dropdown {
  386. ul {
  387. min-width: 67px;
  388. width: auto;
  389. left: 50%;
  390. margin-left: -34px;
  391. li {
  392. display: block;
  393. margin-right: 0;
  394. &:first-child {
  395. > a,
  396. > span {
  397. border-radius: @pagination-border-radius @pagination-border-radius 0 0;
  398. }
  399. }
  400. &:last-child {
  401. > a,
  402. > span {
  403. border-radius: 0 0 @pagination-border-radius @pagination-border-radius !important;
  404. }
  405. }
  406. > a,
  407. > span {
  408. border-left: none;
  409. display: block;
  410. float: none;
  411. padding: 8px 10px 7px;
  412. text-align: center;
  413. min-height: 0;
  414. }
  415. }
  416. }
  417. &.dropup {
  418. position: relative;
  419. }
  420. }