Skip to content

Commit 6c10348

Browse files
committed
fix: pagination [ci visual]
1 parent b97799a commit 6c10348

File tree

4 files changed

+1651
-301
lines changed

4 files changed

+1651
-301
lines changed

src/styles/mixins/_mixins.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,13 @@
321321
@content;
322322
}
323323

324+
@mixin fd-flex-between {
325+
display: flex;
326+
justify-content: space-between;
327+
align-items: center;
328+
@content;
329+
}
330+
324331
@mixin fd-inline-flex-center {
325332
display: inline-flex;
326333
justify-content: center;

src/styles/pagination.scss

Lines changed: 52 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -8,93 +8,84 @@
88
$block: #{$fd-namespace}-pagination;
99

1010
.#{$block} {
11-
12-
$fd-pagination-link-padding-x: 0.25rem;
13-
$fd-pagination-padding-x: 0.5rem;
14-
1511
@include fd-reset();
12+
@include fd-flex-between();
1613

1714
font-size: var(--sapFontSize);
15+
padding: 0 1rem;
16+
height: 2.75rem;
17+
width: 100%;
1818

19-
&__total {
19+
.#{$block}__per-page {
2020
@include fd-reset();
21-
22-
font-size: var(--sapFontSize);
23-
color: var(--sapContent_LabelColor);
24-
margin-right: $fd-pagination-padding-x;
25-
26-
@include fd-rtl() {
27-
margin-right: 0;
28-
margin-left: $fd-pagination-padding-x;
29-
}
21+
@include fd-flex-center();
3022
}
3123

32-
&__nav {
24+
.#{$block}__nav {
3325
@include fd-reset();
34-
35-
display: inline-block;
36-
padding-left: 0;
37-
margin-left: 0;
38-
list-style: none;
39-
margin-bottom: 0;
26+
@include fd-flex-center();
27+
@include fd-set-margins-x('auto', 'auto');
4028
}
4129

42-
&__more {
30+
.#{$block}__more {
4331
@include fd-reset();
4432

4533
&::before {
4634
content: "...";
47-
color: var(--sapLinkColor);
48-
font-weight: bold;
35+
display: block;
36+
width: 1.5rem;
37+
text-align: center;
4938
}
5039
}
5140

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-
}
41+
.#{$block}__input {
42+
min-width: 2.5rem;
43+
text-align: center;
44+
45+
/** Hide arrows so the text will be centered in the input. */
6946

70-
&--previous,
71-
&--next {
72-
@include fd-reset();
73-
@include fd-link();
47+
/** Firefox */
48+
-moz-appearance: textfield;
7449

75-
font-size: var(--sapFontSize);
76-
padding-left: $fd-pagination-padding-x;
77-
padding-right: $fd-pagination-padding-x;
50+
/** WebKit/Blink */
51+
&::-webkit-outer-spin-button,
52+
&::-webkit-inner-spin-button {
53+
-webkit-appearance: none;
54+
margin: 0;
7855
}
7956

80-
&--previous {
81-
@include fd-icon("navigation-left-arrow");
57+
&-label {
58+
display: none;
59+
}
60+
}
8261

83-
font-size: var(--sapFontSmallSize);
62+
.#{$block}__input-label,
63+
.#{$block}__per-page-label {
64+
flex-shrink: 0;
65+
align-self: center;
66+
}
8467

85-
@include fd-rtl() {
86-
@include fd-icon("navigation-right-arrow");
87-
}
88-
}
68+
.#{$block}__button--mobile {
69+
display: none;
70+
}
71+
}
8972

90-
&--next {
91-
@include fd-icon("navigation-right-arrow");
73+
@media (max-width: 599px) {
74+
.#{$block} {
75+
.#{$block}__per-page + .#{$block}__nav {
76+
@include fd-set-margins-x('auto', 0);
77+
}
9278

93-
font-size: var(--sapFontSmallSize);
79+
.#{$block}__total,
80+
.#{$block}__per-page-label,
81+
.#{$block}__link,
82+
.#{$block}__more {
83+
display: none;
84+
}
9485

95-
@include fd-rtl() {
96-
@include fd-icon("navigation-left-arrow");
97-
}
86+
.#{$block}__button--mobile,
87+
.#{$block}__input-label {
88+
display: flex;
9889
}
9990
}
10091
}

0 commit comments

Comments
 (0)