-
Notifications
You must be signed in to change notification settings - Fork 10
/
_pagination.scss
executable file
·162 lines (140 loc) · 4.59 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 by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
@import "global";
//
// @variables
//
$include-pagination-classes: $include-html-classes !default;
// We use these to control the pagination container
$pagination-height: rem-calc(24) !default;
$pagination-margin: rem-calc(-5) !default;
// We use these to set the list-item properties
$pagination-li-float: $default-float !default;
$pagination-li-height: rem-calc(24) !default;
$pagination-li-font-color: #222 !default;
$pagination-li-font-size: rem-calc(14) !default;
$pagination-li-margin: rem-calc(5) !default;
// We use these for the pagination anchor links
$pagination-link-pad: rem-calc(1 10 1) !default;
$pagination-link-font-color: #999 !default;
$pagination-link-active-bg: scale-color(#fff, $lightness: -10%) !default;
// We use these for disabled anchor links
$pagination-link-unavailable-cursor: default !default;
$pagination-link-unavailable-font-color: #999 !default;
$pagination-link-unavailable-bg-active: transparent !default;
// We use these for currently selected anchor links
$pagination-link-current-background: $primary-color !default;
$pagination-link-current-font-color: #fff !default;
$pagination-link-current-font-weight: $font-weight-bold !default;
$pagination-link-current-cursor: default !default;
$pagination-link-current-active-bg: $primary-color !default;
// @mixins
//
// Style the pagination container. Currently only used when centering elements.
// $center - Default: false, Options: true
@mixin pagination-container($center:false) {
@if $center { text-align: center; }
}
// @mixins
// Style unavailable list items
@mixin pagination-unavailable-item {
a, button {
cursor: $pagination-link-unavailable-cursor;
color: $pagination-link-unavailable-font-color;
}
&:hover a,
& a:focus,
&:hover button,
& button:focus
{ background: $pagination-link-unavailable-bg-active; }
}
// @mixins
// Style the current list item. Do not assume that the current item has
// an anchor <a> element.
// $has-anchor - Default: true, Options: false
@mixin pagination-current-item($has-anchor: true) {
@if $has-anchor {
a, button {
background: $pagination-link-current-background;
color: $pagination-link-current-font-color;
font-weight: $pagination-link-current-font-weight;
cursor: $pagination-link-current-cursor;
&:hover,
&:focus { background: $pagination-link-current-active-bg; }
}
} @else {
height: auto;
padding: $pagination-link-pad;
background: $pagination-link-current-background;
color: $pagination-link-current-font-color;
font-weight: $pagination-link-current-font-weight;
cursor: $pagination-link-current-cursor;
@include radius;
&:hover,
&:focus { background: $pagination-link-current-active-bg; }
}
}
// @mixins
//
// We use this mixin to set the properties for the creating Foundation pagination
// $center - Left or center align the li elements. Default: false
// $base-style - Sets base styles for pagination. Default: true, Options: false
// $use-default-classes - Makes unavailable & current classes available for use. Default: true
@mixin pagination($center:false, $base-style:true, $use-default-classes:true) {
@if $base-style {
display: block;
min-height: $pagination-height;
margin-#{$default-float}: $pagination-margin;
li {
height: $pagination-li-height;
color: $pagination-li-font-color;
font-size: $pagination-li-font-size;
margin-#{$default-float}: $pagination-li-margin;
a, button {
display: block;
padding: $pagination-link-pad;
color: $pagination-link-font-color;
background: none;
@include radius;
font-weight: normal;
font-size: 1em;
line-height: inherit;
@include single-transition(background-color);
}
&:hover a,
a:focus,
&:hover button,
button:focus
{ background: $pagination-link-active-bg; }
@if $use-default-classes {
&.unavailable { @include pagination-unavailable-item(); }
&.current { @include pagination-current-item(); }
}
}
}
// Left or center align the li elements
li {
@if $center {
float: none;
display: inline-block;
} @else {
float: $pagination-li-float;
display: block;
}
}
}
@include exports("pagination") {
@if $include-pagination-classes {
ul.pagination {
@include pagination;
}
/* Pagination centred wrapper */
.pagination-centered {
@include pagination-container(true);
ul.pagination {
@include pagination(true, false);
}
}
}
}