-
Notifications
You must be signed in to change notification settings - Fork 11
/
_pagination.scss
162 lines (131 loc) · 3.83 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
// Foundation for Sites by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
////
/// @group pagination
////
/// Font size of pagination items.
/// @type Number
$pagination-font-size: rem-calc(14) !default;
/// Default bottom margin of the media object.
/// @type Number
$pagination-margin-bottom: $global-margin !default;
/// Text color of pagination items.
/// @type Color
$pagination-item-color: $black !default;
/// Padding inside of pagination items.
/// @type Number
$pagination-item-padding: rem-calc(3 10) !default;
/// Right margin to separate pagination items.
/// @type Number
$pagination-item-spacing: rem-calc(1) !default;
/// Default radius for pagination items.
/// @type Number
$pagination-radius: $global-radius !default;
/// Background color of pagination items on hover.
/// @type Color
$pagination-item-background-hover: $light-gray !default;
/// Background color of pagination item for the current page.
/// @type Color
$pagination-item-background-current: $primary-color !default;
/// Text color of the pagination item for the current page.
/// @type Color
$pagination-item-color-current: foreground($pagination-item-background-current) !default;
/// Text color of a disabled pagination item.
/// @type Color
$pagination-item-color-disabled: $medium-gray !default;
/// Color of the ellipsis in a pagination menu.
/// @type Color
$pagination-ellipsis-color: $black !default;
/// If `false`, don't display page number links on mobile, only next/previous links.
/// @type Boolean
$pagination-mobile-items: false !default;
/// If `true`, arrows are added to the next and previous links of pagination.
/// @type Boolean
$pagination-arrows: true !default;
/// Adds styles for a pagination container. Apply this to a `<ul>`.
@mixin pagination-container {
@include clearfix;
margin-#{$global-left}: 0;
margin-bottom: $pagination-margin-bottom;
// List item
li {
font-size: $pagination-font-size;
margin-#{$global-right}: $pagination-item-spacing;
border-radius: $pagination-radius;
@if $pagination-mobile-items {
display: inline-block;
}
@else {
display: none;
&:last-child,
&:first-child {
display: inline-block;
}
@include breakpoint(medium) {
display: inline-block;
}
}
}
// Page links
a,
button {
color: $pagination-item-color;
display: block;
padding: $pagination-item-padding;
border-radius: $global-radius;
&:hover {
background: $pagination-item-background-hover;
}
}
}
/// Adds styles for the current pagination item. Apply this to an `<a>`.
@mixin pagination-item-current {
padding: $pagination-item-padding;
background: $pagination-item-background-current;
color: $pagination-item-color-current;
cursor: default;
}
/// Adds styles for a disabled pagination item. Apply this to an `<a>`.
@mixin pagination-item-disabled {
padding: $pagination-item-padding;
color: $pagination-item-color-disabled;
cursor: default;
&:hover {
background: transparent;
}
}
/// Adds styles for an ellipsis for use in a pagination list.
@mixin pagination-ellipsis {
content: '\2026';
padding: $pagination-item-padding;
color: $pagination-ellipsis-color;
}
@mixin foundation-pagination {
.pagination {
@include pagination-container;
.current {
@include pagination-item-current;
}
.disabled {
@include pagination-item-disabled;
}
.ellipsis::after {
@include pagination-ellipsis;
}
}
@if $pagination-arrows {
.pagination-previous a::before,
.pagination-previous.disabled::before {
content: '\00ab';
display: inline-block;
margin-#{$global-right}: 0.5rem;
}
.pagination-next a::after,
.pagination-next.disabled::after {
content: '\00bb';
display: inline-block;
margin-#{$global-left}: 0.5rem;
}
}
}