-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy path_pagination.scss
244 lines (214 loc) · 9.24 KB
/
_pagination.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
.pagination {
// scss-docs-start pagination-css-vars
--#{$prefix}pagination-padding-x: #{$pagination-padding-x};
--#{$prefix}pagination-label-padding-x: #{$pagination-label-padding-x}; // Boosted mod
--#{$prefix}pagination-padding-y: #{$pagination-padding-y};
--#{$prefix}pagination-margin-y: #{$pagination-margin-y}; // Boosted mod
--#{$prefix}pagination-gap: #{$pagination-gap}; // Boosted mod
--#{$prefix}pagination-margin-x-first-last: #{$pagination-margin-x-first-last}; // Boosted mod
--#{$prefix}pagination-item-max-width: #{$pagination-item-max-width}; // Boosted mod
@include rfs($pagination-font-size, --#{$prefix}pagination-font-size);
--#{$prefix}pagination-font-weight: #{$font-weight-bold}; // Boosted mod
--#{$prefix}pagination-color: #{$pagination-color};
--#{$prefix}pagination-bg: #{$pagination-bg};
--#{$prefix}pagination-border-width: #{$pagination-border-width};
--#{$prefix}pagination-border-color: #{$pagination-border-color};
--#{$prefix}pagination-border-radius: #{$pagination-border-radius};
--#{$prefix}pagination-hover-color: #{$pagination-hover-color};
--#{$prefix}pagination-hover-bg: #{$pagination-hover-bg};
--#{$prefix}pagination-hover-border-color: #{$pagination-hover-border-color};
--#{$prefix}pagination-focus-color: #{$pagination-focus-color};
--#{$prefix}pagination-focus-bg: #{$pagination-focus-bg};
--#{$prefix}pagination-focus-box-shadow: #{$pagination-focus-box-shadow};
--#{$prefix}pagination-active-color: #{$pagination-active-color};
--#{$prefix}pagination-active-bg: #{$pagination-active-bg};
--#{$prefix}pagination-active-border-color: #{$pagination-active-border-color};
--#{$prefix}pagination-active-item-color: #{$pagination-active-item-color}; // Boosted mod
--#{$prefix}pagination-active-item-bg: #{$pagination-active-item-bg}; // Boosted mod
--#{$prefix}pagination-active-item-border-color: #{$pagination-active-item-border}; // Boosted mod
--#{$prefix}pagination-disabled-color: #{$pagination-disabled-color};
--#{$prefix}pagination-disabled-bg: #{$pagination-disabled-bg};
--#{$prefix}pagination-disabled-border-color: #{$pagination-disabled-border-color};
--#{$prefix}pagination-icon: #{$pagination-icon}; // Boosted mod
--#{$prefix}pagination-icon-min-width: #{$pagination-icon-min-width}; // Boosted mod
--#{$prefix}pagination-icon-size: #{$pagination-icon-size}; // Boosted mod
--#{$prefix}pagination-icon-width: #{$pagination-icon-width}; // Boosted mod
--#{$prefix}pagination-icon-height: #{$pagination-icon-height}; // Boosted mod
// scss-docs-end pagination-css-vars
display: flex;
flex-wrap: if($pagination-margin-start == (-$pagination-border-width), null, wrap); // Boosted mod
margin: var(--#{$prefix}pagination-margin-y) 0; // Boosted mod
@include list-unstyled();
}
.page-link {
position: relative;
box-sizing: content-box; // Boosted mod
display: flex; // Boosted mod
gap: var(--#{$prefix}pagination-gap); // Boosted mod
align-items: center; // Boosted mod
justify-content: center; // Boosted mod
padding: var(--#{$prefix}pagination-padding-y) var(--#{$prefix}pagination-padding-x);
@include font-size(var(--#{$prefix}pagination-font-size));
font-weight: var(--#{$prefix}pagination-font-weight); // Boosted mod
color: var(--#{$prefix}pagination-color);
text-decoration: if($link-decoration == none, null, none);
background-color: var(--#{$prefix}pagination-bg);
border: var(--#{$prefix}pagination-border-width) solid var(--#{$prefix}pagination-border-color);
@include transition($pagination-transition);
// Boosted mod: embed icon as mask-image
@include button-icon(
var(--#{$prefix}pagination-icon),
var(--#{$prefix}pagination-icon-min-width),
var(--#{$prefix}pagination-icon-size),
$size: var(--#{$prefix}pagination-icon-width) var(--#{$prefix}pagination-icon-height) ,
$selector: ".page-item:first-child .page-link, .page-item:last-child .page-link",
$position: calc(50% - 1px)
);
// End mod
&:hover {
z-index: 2;
color: var(--#{$prefix}pagination-hover-color);
text-decoration: if($link-hover-decoration == underline, none, null);
background-color: var(--#{$prefix}pagination-hover-bg);
border-color: var(--#{$prefix}pagination-hover-border-color);
}
&:focus {
z-index: 5; // Boosted mod
color: var(--#{$prefix}pagination-focus-color);
background-color: var(--#{$prefix}pagination-focus-bg);
outline: $pagination-focus-outline;
box-shadow: var(--#{$prefix}pagination-focus-box-shadow);
}
// Boosted mod
&:active,
&:active > & {
color: var(--#{$prefix}pagination-active-item-color);
background-color: var(--#{$prefix}pagination-active-item-bg);
border-color: var(--#{$prefix}pagination-active-item-border-color);
}
// End mod
&.active,
.active > & {
z-index: 3;
color: var(--#{$prefix}pagination-active-color);
@include gradient-bg(var(--#{$prefix}pagination-active-bg));
border-color: var(--#{$prefix}pagination-active-border-color);
}
&.disabled,
.disabled > & {
color: var(--#{$prefix}pagination-disabled-color);
pointer-events: none;
background-color: var(--#{$prefix}pagination-disabled-bg);
border-color: var(--#{$prefix}pagination-disabled-border-color);
}
}
.page-item {
&:not(:first-child) .page-link {
margin-left: $pagination-margin-start;
}
@if $pagination-margin-start == calc(#{$pagination-border-width} * -1) {
&:first-child {
.page-link {
@include border-start-radius(var(--#{$prefix}pagination-border-radius));
}
}
&:last-child {
.page-link {
@include border-end-radius(var(--#{$prefix}pagination-border-radius));
}
}
} @else {
// Add border-radius to all pageLinks in case they have left margin
.page-link {
@include border-radius(var(--#{$prefix}pagination-border-radius));
}
}
// Boosted mod
&:first-child:not(.active) .page-link,
&:last-child:not(.active) .page-link {
border-color: currentcolor;
&:hover {
color: var(--#{$prefix}pagination-active-color);
background-color: var(--#{$prefix}pagination-active-bg);
border-color: var(--#{$prefix}pagination-active-border-color);
}
&.active {
border-color: var(--#{$prefix}pagination-border-color);
}
&:active {
color: var(--#{$prefix}pagination-active-item-color);
background-color: var(--#{$prefix}pagination-active-item-bg);
border-color: var(--#{$prefix}pagination-active-item-border-color);
}
}
&:first-child .page-link,
&:last-child .page-link {
&:not([title]) {
--#{$prefix}pagination-padding-x: var(--#{$prefix}pagination-label-padding-x);
}
}
&:first-child .page-link {
margin-right: var(--#{$prefix}pagination-margin-x-first-last);
&::before {
/* rtl:raw:
transform: scaleX(-1);
*/
}
}
&:last-child .page-link {
&::before {
order: 1;
/* rtl:remove */
transform: scaleX(-1);
}
}
&:last-child:not(:nth-child(2)) .page-link {
margin-left: var(--#{$prefix}pagination-margin-x-first-last);
}
&:not(:first-child):not(:last-child) .page-link {
max-width: var(--#{$prefix}pagination-item-max-width);
}
@include media-breakpoint-down(sm) {
@include pagination-max-items(4);
}
@include media-breakpoint-between(sm, md) {
@include pagination-max-items(6);
}
@include media-breakpoint-between(md, lg) {
@include pagination-max-items(8);
}
@include media-breakpoint-between(lg, xl) {
@include pagination-max-items(10);
}
@include media-breakpoint-up(xl) {
@include pagination-max-items(12);
}
// End mod
}
//
// Sizing
//
// Boosted mod: no pagination sizes
// Boosted mod: dark variant
.pagination-dark {
// scss-docs-start pagination-dark-css-vars
--#{$prefix}pagination-color: #{$pagination-dark-color}; // Boosted mod
--#{$prefix}pagination-bg: #{$pagination-dark-bg}; // Boosted mod
--#{$prefix}pagination-border-color: #{$pagination-dark-border-color}; // Boosted mod
--#{$prefix}pagination-hover-color: #{$pagination-dark-hover-color}; // Boosted mod
--#{$prefix}pagination-hover-bg: #{$pagination-dark-hover-bg}; // Boosted mod
--#{$prefix}pagination-hover-border-color: #{$pagination-dark-hover-border-color}; // Boosted mod
--#{$prefix}pagination-focus-color: #{$pagination-dark-focus-color}; // Boosted mod
--#{$prefix}pagination-focus-bg: #{$pagination-dark-focus-bg}; // Boosted mod
--#{$prefix}pagination-active-color: #{$pagination-dark-active-color}; // Boosted mod
--#{$prefix}pagination-active-bg: #{$pagination-dark-active-bg}; // Boosted mod
--#{$prefix}pagination-active-border-color: #{$pagination-dark-active-border-color}; // Boosted mod
--#{$prefix}pagination-active-item-color: #{$pagination-dark-active-item-color}; // Boosted mod
--#{$prefix}pagination-active-item-bg: #{$pagination-dark-active-item-bg}; // Boosted mod
--#{$prefix}pagination-active-item-border-color: #{$pagination-dark-active-item-border-color}; // Boosted mod
--#{$prefix}pagination-disabled-color: #{$pagination-dark-disabled-color}; // Boosted mod
--#{$prefix}pagination-disabled-bg: #{$pagination-dark-disabled-bg}; // Boosted mod
--#{$prefix}pagination-disabled-border-color: #{$pagination-dark-disabled-border-color}; // Boosted mod
// scss-docs-end pagination-dark-css-vars
}
// End mod