| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- // Pagination
- // default look for page item, first and last item
- .page-item {
- border-radius: 5rem;
- &:not(.prev-item),
- &:not(.next-item),
- &:not(.first),
- &:not(.last),
- &:not(.active) {
- .page-link {
- line-height: 1.3;
- }
- }
- .page-link {
- display: flex;
- align-items: center;
- justify-content: center;
- }
- &.previous,
- &.prev,
- &.next,
- &.first,
- &.last {
- .page-link {
- width: auto;
- }
- }
- &.prev-item,
- &.next-item {
- .page-link {
- transition: all 0.2s ease-out;
- }
- }
- // prev and next item separated styles
- &.prev-item {
- margin-right: 0.3571rem;
- .page-link {
- border-radius: 50%;
- &:before {
- background-image: url(str-replace(str-replace($chevron-left, 'currentColor', $pagination-color), '#', '%23'));
- background-repeat: no-repeat;
- background-position: center;
- background-size: 14px;
- color: $body-color;
- width: 8px;
- height: 18px;
- content: '';
- }
- &:hover {
- background: $pagination-hover-bg;
- color: $pagination-hover-color;
- }
- &:active,
- &:hover {
- background-color: $primary !important;
- &:before {
- background-image: url(str-replace(str-replace($chevron-left, 'currentColor', $white), '#', '%23')) !important;
- }
- }
- }
- &.disabled {
- .page-link {
- &:before {
- background-image: url(str-replace(
- str-replace($chevron-left, 'currentColor', $pagination-disabled-color),
- '#',
- '%23'
- ));
- }
- }
- }
- & ~ .page-item:nth-child(2) {
- border-top-left-radius: 5rem;
- border-bottom-left-radius: 5rem;
- .page-link {
- border-top-left-radius: 5rem !important;
- border-bottom-left-radius: 5rem !important;
- }
- }
- & ~ .page-item:nth-last-child(2) {
- border-top-right-radius: 5rem;
- border-bottom-right-radius: 5rem;
- .page-link {
- border-top-right-radius: 5rem !important;
- border-bottom-right-radius: 5rem !important;
- }
- }
- }
- &.next-item {
- margin-left: 0.3571rem;
- .page-link {
- border-radius: 50%;
- &:after {
- background-image: url(str-replace(str-replace($chevron-right, 'currentColor', $pagination-color), '#', '%23'));
- background-repeat: no-repeat;
- background-position: center;
- background-size: 14px;
- width: 8px;
- height: 18px;
- content: '';
- }
- &:hover {
- background: $pagination-hover-bg;
- color: $pagination-hover-color;
- }
- &:active,
- &:hover {
- background-color: $primary !important;
- &:after {
- background-image: url(str-replace(
- str-replace($chevron-right, 'currentColor', $white),
- '#',
- '%23'
- )) !important;
- }
- }
- }
- &.disabled {
- .page-link {
- &:after {
- background-image: url(str-replace(
- str-replace($chevron-right, 'currentColor', $pagination-disabled-color),
- '#',
- '%23'
- ));
- }
- }
- }
- }
- // prev and next style
- &.prev,
- &.previous {
- .page-link {
- &:before {
- background-image: url(str-replace(str-replace($chevron-left, 'currentColor', $pagination-color), '#', '%23'));
- background-repeat: no-repeat;
- background-position: center;
- background-size: 14px;
- color: $body-color;
- width: 12px;
- height: 18px;
- content: '';
- }
- // &:active,
- &:hover {
- &:before {
- background-image: url(str-replace(
- str-replace($chevron-left, 'currentColor', $pagination-active-color),
- '#',
- '%23'
- )) !important;
- }
- }
- }
- &.disabled {
- .page-link {
- &:before {
- background-image: url(str-replace(
- str-replace($chevron-left, 'currentColor', $pagination-disabled-color),
- '#',
- '%23'
- ));
- }
- }
- }
- }
- &.next {
- .page-link {
- &:after {
- background-image: url(str-replace(str-replace($chevron-right, 'currentColor', $pagination-color), '#', '%23'));
- background-repeat: no-repeat;
- background-position: center;
- background-size: 14px;
- color: $body-color;
- width: 12px;
- height: 18px;
- content: '';
- }
- // &:active,
- &:hover {
- &:after {
- background-image: url(str-replace(
- str-replace($chevron-right, 'currentColor', $primary),
- '#',
- '%23'
- )) !important;
- }
- }
- }
- &.disabled {
- .page-link {
- &:after {
- background-image: url(str-replace(
- str-replace($chevron-right, 'currentColor', $pagination-disabled-color),
- '#',
- '%23'
- ));
- }
- }
- }
- }
- &.disabled {
- .page-link {
- color: $pagination-disabled-color;
- }
- }
- // page link customization
- .page-link {
- border: none;
- margin: 0;
- margin-left: 0;
- font-size: 1rem;
- min-width: 2.286rem;
- &:focus {
- box-shadow: none;
- }
- &:hover {
- color: $primary;
- }
- }
- // for active page item
- &.active {
- background-color: $pagination-bg;
- border-radius: 0;
- .page-link {
- z-index: 3;
- border-radius: 5rem;
- background-color: $primary;
- color: $white !important;
- font-weight: 600;
- }
- }
- // if you don't want separated look
- &:first-child:not(.prev-item) {
- &.active {
- border-top-left-radius: 1.428rem;
- border-bottom-left-radius: 1.428rem;
- .page-link {
- border-radius: 5rem;
- }
- }
- .page-link {
- border-top-left-radius: 1.428rem;
- border-bottom-left-radius: 1.428rem;
- }
- }
- &:last-child:not(.next-item) {
- &.active {
- border-top-right-radius: 1.428rem;
- border-bottom-right-radius: 1.428rem;
- .page-link {
- border-radius: 5rem;
- }
- }
- .page-link {
- border-top-right-radius: 1.428rem;
- border-bottom-right-radius: 1.428rem;
- }
- }
- }
- // For Pagination Font sizes
- .pagination {
- // For Pagination lg
- &.pagination-lg {
- .page-item {
- .page-link {
- font-size: $pagination-font-size-lg;
- min-width: 2.6rem;
- }
- }
- }
- // For Pagination sm
- &.pagination-sm {
- .page-item {
- .page-link {
- font-size: $pagination-font-size-sm;
- min-width: 2rem;
- }
- }
- }
- }
|