_pagination.scss 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. // Pagination
  2. // default look for page item, first and last item
  3. .page-item {
  4. border-radius: 5rem;
  5. &:not(.prev-item),
  6. &:not(.next-item),
  7. &:not(.first),
  8. &:not(.last),
  9. &:not(.active) {
  10. .page-link {
  11. line-height: 1.3;
  12. }
  13. }
  14. .page-link {
  15. display: flex;
  16. align-items: center;
  17. justify-content: center;
  18. }
  19. &.previous,
  20. &.prev,
  21. &.next,
  22. &.first,
  23. &.last {
  24. .page-link {
  25. width: auto;
  26. }
  27. }
  28. &.prev-item,
  29. &.next-item {
  30. .page-link {
  31. transition: all 0.2s ease-out;
  32. }
  33. }
  34. // prev and next item separated styles
  35. &.prev-item {
  36. margin-right: 0.3571rem;
  37. .page-link {
  38. border-radius: 50%;
  39. &:before {
  40. background-image: url(str-replace(str-replace($chevron-left, 'currentColor', $pagination-color), '#', '%23'));
  41. background-repeat: no-repeat;
  42. background-position: center;
  43. background-size: 14px;
  44. color: $body-color;
  45. width: 8px;
  46. height: 18px;
  47. content: '';
  48. }
  49. &:hover {
  50. background: $pagination-hover-bg;
  51. color: $pagination-hover-color;
  52. }
  53. &:active,
  54. &:hover {
  55. background-color: $primary !important;
  56. &:before {
  57. background-image: url(str-replace(str-replace($chevron-left, 'currentColor', $white), '#', '%23')) !important;
  58. }
  59. }
  60. }
  61. &.disabled {
  62. .page-link {
  63. &:before {
  64. background-image: url(str-replace(
  65. str-replace($chevron-left, 'currentColor', $pagination-disabled-color),
  66. '#',
  67. '%23'
  68. ));
  69. }
  70. }
  71. }
  72. & ~ .page-item:nth-child(2) {
  73. border-top-left-radius: 5rem;
  74. border-bottom-left-radius: 5rem;
  75. .page-link {
  76. border-top-left-radius: 5rem !important;
  77. border-bottom-left-radius: 5rem !important;
  78. }
  79. }
  80. & ~ .page-item:nth-last-child(2) {
  81. border-top-right-radius: 5rem;
  82. border-bottom-right-radius: 5rem;
  83. .page-link {
  84. border-top-right-radius: 5rem !important;
  85. border-bottom-right-radius: 5rem !important;
  86. }
  87. }
  88. }
  89. &.next-item {
  90. margin-left: 0.3571rem;
  91. .page-link {
  92. border-radius: 50%;
  93. &:after {
  94. background-image: url(str-replace(str-replace($chevron-right, 'currentColor', $pagination-color), '#', '%23'));
  95. background-repeat: no-repeat;
  96. background-position: center;
  97. background-size: 14px;
  98. width: 8px;
  99. height: 18px;
  100. content: '';
  101. }
  102. &:hover {
  103. background: $pagination-hover-bg;
  104. color: $pagination-hover-color;
  105. }
  106. &:active,
  107. &:hover {
  108. background-color: $primary !important;
  109. &:after {
  110. background-image: url(str-replace(
  111. str-replace($chevron-right, 'currentColor', $white),
  112. '#',
  113. '%23'
  114. )) !important;
  115. }
  116. }
  117. }
  118. &.disabled {
  119. .page-link {
  120. &:after {
  121. background-image: url(str-replace(
  122. str-replace($chevron-right, 'currentColor', $pagination-disabled-color),
  123. '#',
  124. '%23'
  125. ));
  126. }
  127. }
  128. }
  129. }
  130. // prev and next style
  131. &.prev,
  132. &.previous {
  133. .page-link {
  134. &:before {
  135. background-image: url(str-replace(str-replace($chevron-left, 'currentColor', $pagination-color), '#', '%23'));
  136. background-repeat: no-repeat;
  137. background-position: center;
  138. background-size: 14px;
  139. color: $body-color;
  140. width: 12px;
  141. height: 18px;
  142. content: '';
  143. }
  144. // &:active,
  145. &:hover {
  146. &:before {
  147. background-image: url(str-replace(
  148. str-replace($chevron-left, 'currentColor', $pagination-active-color),
  149. '#',
  150. '%23'
  151. )) !important;
  152. }
  153. }
  154. }
  155. &.disabled {
  156. .page-link {
  157. &:before {
  158. background-image: url(str-replace(
  159. str-replace($chevron-left, 'currentColor', $pagination-disabled-color),
  160. '#',
  161. '%23'
  162. ));
  163. }
  164. }
  165. }
  166. }
  167. &.next {
  168. .page-link {
  169. &:after {
  170. background-image: url(str-replace(str-replace($chevron-right, 'currentColor', $pagination-color), '#', '%23'));
  171. background-repeat: no-repeat;
  172. background-position: center;
  173. background-size: 14px;
  174. color: $body-color;
  175. width: 12px;
  176. height: 18px;
  177. content: '';
  178. }
  179. // &:active,
  180. &:hover {
  181. &:after {
  182. background-image: url(str-replace(
  183. str-replace($chevron-right, 'currentColor', $primary),
  184. '#',
  185. '%23'
  186. )) !important;
  187. }
  188. }
  189. }
  190. &.disabled {
  191. .page-link {
  192. &:after {
  193. background-image: url(str-replace(
  194. str-replace($chevron-right, 'currentColor', $pagination-disabled-color),
  195. '#',
  196. '%23'
  197. ));
  198. }
  199. }
  200. }
  201. }
  202. &.disabled {
  203. .page-link {
  204. color: $pagination-disabled-color;
  205. }
  206. }
  207. // page link customization
  208. .page-link {
  209. border: none;
  210. margin: 0;
  211. margin-left: 0;
  212. font-size: 1rem;
  213. min-width: 2.286rem;
  214. &:focus {
  215. box-shadow: none;
  216. }
  217. &:hover {
  218. color: $primary;
  219. }
  220. }
  221. // for active page item
  222. &.active {
  223. background-color: $pagination-bg;
  224. border-radius: 0;
  225. .page-link {
  226. z-index: 3;
  227. border-radius: 5rem;
  228. background-color: $primary;
  229. color: $white !important;
  230. font-weight: 600;
  231. }
  232. }
  233. // if you don't want separated look
  234. &:first-child:not(.prev-item) {
  235. &.active {
  236. border-top-left-radius: 1.428rem;
  237. border-bottom-left-radius: 1.428rem;
  238. .page-link {
  239. border-radius: 5rem;
  240. }
  241. }
  242. .page-link {
  243. border-top-left-radius: 1.428rem;
  244. border-bottom-left-radius: 1.428rem;
  245. }
  246. }
  247. &:last-child:not(.next-item) {
  248. &.active {
  249. border-top-right-radius: 1.428rem;
  250. border-bottom-right-radius: 1.428rem;
  251. .page-link {
  252. border-radius: 5rem;
  253. }
  254. }
  255. .page-link {
  256. border-top-right-radius: 1.428rem;
  257. border-bottom-right-radius: 1.428rem;
  258. }
  259. }
  260. }
  261. // For Pagination Font sizes
  262. .pagination {
  263. // For Pagination lg
  264. &.pagination-lg {
  265. .page-item {
  266. .page-link {
  267. font-size: $pagination-font-size-lg;
  268. min-width: 2.6rem;
  269. }
  270. }
  271. }
  272. // For Pagination sm
  273. &.pagination-sm {
  274. .page-item {
  275. .page-link {
  276. font-size: $pagination-font-size-sm;
  277. min-width: 2rem;
  278. }
  279. }
  280. }
  281. }