Skip to content

Commit b21f314

Browse files
authored
fix(styles): pagination styles update (#2912)
BREAKING CHANGE: update pagination markup
1 parent 35e02cc commit b21f314

File tree

5 files changed

+2128
-298
lines changed

5 files changed

+2128
-298
lines changed

src/styles/pagination.scss

Lines changed: 67 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -7,94 +7,104 @@
77

88
$block: #{$fd-namespace}-pagination;
99

10-
.#{$block} {
10+
@mixin fd-pagination-mobile() {
11+
.#{$block}__per-page + .#{$block}__nav {
12+
@include fd-set-margins-x('auto', 0);
13+
}
1114

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+
}
1421

15-
@include fd-reset();
22+
.#{$block}__button--mobile,
23+
.#{$block}__label {
24+
display: flex;
25+
}
26+
}
1627

17-
font-size: var(--sapFontSize);
28+
.#{$block} {
29+
@include fd-reset();
1830

19-
&__total {
20-
@include fd-reset();
31+
@include fd-flex-vertical-center() {
32+
justify-content: space-between;
33+
}
2134

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%;
2538

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();
3042
}
3143

3244
&__nav {
3345
@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');
4048
}
4149

4250
&__more {
4351
@include fd-reset();
4452

4553
&::before {
4654
content: "...";
47-
color: var(--sapLinkColor);
48-
font-weight: bold;
55+
display: block;
56+
width: 1.5rem;
57+
text-align: center;
4958
}
5059
}
5160

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;
6965

70-
&--previous,
71-
&--next {
72-
@include fd-reset();
73-
@include fd-link();
66+
/** Hide arrows so the text will be centered in the input. */
7467

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;
7876
}
77+
}
7978

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+
}
8284

83-
font-size: var(--sapFontSmallSize);
85+
.#{$block}__label {
86+
display: none;
87+
}
8488

89+
.#{$block}__button {
90+
[class*='sap-icon'] {
8591
@include fd-rtl() {
86-
@include fd-icon("navigation-right-arrow");
92+
transform: rotate(180deg);
8793
}
8894
}
8995

90-
&--next {
91-
@include fd-icon("navigation-right-arrow");
96+
&--mobile {
97+
display: none;
98+
}
99+
}
92100

93-
font-size: var(--sapFontSmallSize);
101+
&--mobile {
102+
@include fd-pagination-mobile();
103+
}
104+
}
94105

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();
99109
}
100110
}

0 commit comments

Comments
 (0)