|
7 | 7 |
|
8 | 8 | $block: #{$fd-namespace}-pagination;
|
9 | 9 |
|
10 |
| -.#{$block} { |
| 10 | +@mixin fd-pagination-mobile() { |
| 11 | + .#{$block}__per-page + .#{$block}__nav { |
| 12 | + @include fd-set-margins-x('auto', 0); |
| 13 | + } |
11 | 14 |
|
12 |
| - $fd-pagination-link-padding-x: 0.25rem; |
13 |
| - $fd-pagination-padding-x: 0.5rem; |
| 15 | + .#{$block}__total, |
| 16 | + .#{$block}__per-page-label, |
| 17 | + .#{$block}__link, |
| 18 | + .#{$block}__more { |
| 19 | + display: none; |
| 20 | + } |
14 | 21 |
|
15 |
| - @include fd-reset(); |
| 22 | + .#{$block}__button--mobile, |
| 23 | + .#{$block}__label { |
| 24 | + display: flex; |
| 25 | + } |
| 26 | +} |
16 | 27 |
|
17 |
| - font-size: var(--sapFontSize); |
| 28 | +.#{$block} { |
| 29 | + @include fd-reset(); |
18 | 30 |
|
19 |
| - &__total { |
20 |
| - @include fd-reset(); |
| 31 | + @include fd-flex-vertical-center() { |
| 32 | + justify-content: space-between; |
| 33 | + } |
21 | 34 |
|
22 |
| - font-size: var(--sapFontSize); |
23 |
| - color: var(--sapContent_LabelColor); |
24 |
| - margin-right: $fd-pagination-padding-x; |
| 35 | + padding: 0 1rem; |
| 36 | + height: 2.75rem; |
| 37 | + width: 100%; |
25 | 38 |
|
26 |
| - @include fd-rtl() { |
27 |
| - margin-right: 0; |
28 |
| - margin-left: $fd-pagination-padding-x; |
29 |
| - } |
| 39 | + &__per-page { |
| 40 | + @include fd-reset(); |
| 41 | + @include fd-flex-center(); |
30 | 42 | }
|
31 | 43 |
|
32 | 44 | &__nav {
|
33 | 45 | @include fd-reset();
|
34 |
| - |
35 |
| - display: inline-block; |
36 |
| - padding-left: 0; |
37 |
| - margin-left: 0; |
38 |
| - list-style: none; |
39 |
| - margin-bottom: 0; |
| 46 | + @include fd-flex-center(); |
| 47 | + @include fd-set-margins-x-equal('auto'); |
40 | 48 | }
|
41 | 49 |
|
42 | 50 | &__more {
|
43 | 51 | @include fd-reset();
|
44 | 52 |
|
45 | 53 | &::before {
|
46 | 54 | content: "...";
|
47 |
| - color: var(--sapLinkColor); |
48 |
| - font-weight: bold; |
| 55 | + display: block; |
| 56 | + width: 1.5rem; |
| 57 | + text-align: center; |
49 | 58 | }
|
50 | 59 | }
|
51 | 60 |
|
52 |
| - &__link { |
53 |
| - @include fd-reset(); |
54 |
| - @include fd-link(); |
55 |
| - |
56 |
| - font-size: var(--sapFontSize); |
57 |
| - background-color: transparent; |
58 |
| - padding-left: $fd-pagination-link-padding-x; |
59 |
| - padding-right: $fd-pagination-link-padding-x; |
60 |
| - position: relative; |
61 |
| - text-decoration: none; |
62 |
| - |
63 |
| - @include fd-selected() { |
64 |
| - color: var(--sapContent_LabelColor); |
65 |
| - text-decoration: none; |
66 |
| - cursor: default; |
67 |
| - font-weight: bold; |
68 |
| - } |
| 61 | + .#{$block}__input { |
| 62 | + width: auto; |
| 63 | + min-width: 2.5rem; |
| 64 | + text-align: center; |
69 | 65 |
|
70 |
| - &--previous, |
71 |
| - &--next { |
72 |
| - @include fd-reset(); |
73 |
| - @include fd-link(); |
| 66 | + /** Hide arrows so the text will be centered in the input. */ |
74 | 67 |
|
75 |
| - font-size: var(--sapFontSize); |
76 |
| - padding-left: $fd-pagination-padding-x; |
77 |
| - padding-right: $fd-pagination-padding-x; |
| 68 | + /** Firefox */ |
| 69 | + -moz-appearance: textfield; |
| 70 | + |
| 71 | + /** WebKit/Blink */ |
| 72 | + &::-webkit-outer-spin-button, |
| 73 | + &::-webkit-inner-spin-button { |
| 74 | + -webkit-appearance: none; |
| 75 | + margin: 0; |
78 | 76 | }
|
| 77 | + } |
79 | 78 |
|
80 |
| - &--previous { |
81 |
| - @include fd-icon("navigation-left-arrow"); |
| 79 | + .#{$block}__label, |
| 80 | + .#{$block}__per-page-label { |
| 81 | + flex-shrink: 0; |
| 82 | + align-self: center; |
| 83 | + } |
82 | 84 |
|
83 |
| - font-size: var(--sapFontSmallSize); |
| 85 | + .#{$block}__label { |
| 86 | + display: none; |
| 87 | + } |
84 | 88 |
|
| 89 | + .#{$block}__button { |
| 90 | + [class*='sap-icon'] { |
85 | 91 | @include fd-rtl() {
|
86 |
| - @include fd-icon("navigation-right-arrow"); |
| 92 | + transform: rotate(180deg); |
87 | 93 | }
|
88 | 94 | }
|
89 | 95 |
|
90 |
| - &--next { |
91 |
| - @include fd-icon("navigation-right-arrow"); |
| 96 | + &--mobile { |
| 97 | + display: none; |
| 98 | + } |
| 99 | + } |
92 | 100 |
|
93 |
| - font-size: var(--sapFontSmallSize); |
| 101 | + &--mobile { |
| 102 | + @include fd-pagination-mobile(); |
| 103 | + } |
| 104 | +} |
94 | 105 |
|
95 |
| - @include fd-rtl() { |
96 |
| - @include fd-icon("navigation-left-arrow"); |
97 |
| - } |
98 |
| - } |
| 106 | +@media (max-width: 599px) { |
| 107 | + .#{$block} { |
| 108 | + @include fd-pagination-mobile(); |
99 | 109 | }
|
100 | 110 | }
|
0 commit comments