persistentgrid 0.0.1.beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +5 -0
- data/lib/persistentgrid.rb +4 -0
- data/scss/pg/_helpers.scss +7 -0
- data/scss/pg/base/_all.scss +9 -0
- data/scss/pg/base/_behavior.scss +10 -0
- data/scss/pg/base/_helpers.scss +9 -0
- data/scss/pg/base/_settings.scss +10 -0
- data/scss/pg/base/baserules/_all.scss +8 -0
- data/scss/pg/base/baserules/_behavior.scss +125 -0
- data/scss/pg/base/baserules/_settings.scss +39 -0
- data/scss/pg/base/reset/_all.scss +9 -0
- data/scss/pg/base/reset/_behavior.scss +108 -0
- data/scss/pg/base/reset/_helpers.scss +7 -0
- data/scss/pg/base/reset/_settings.scss +27 -0
- data/scss/pg/base/reset/helpers/_all.scss +7 -0
- data/scss/pg/base/reset/helpers/_mixins.scss +395 -0
- data/scss/pg/base/typography/_all.scss +9 -0
- data/scss/pg/base/typography/_behavior.scss +31 -0
- data/scss/pg/base/typography/_helpers.scss +7 -0
- data/scss/pg/base/typography/_settings.scss +52 -0
- data/scss/pg/base/typography/helpers/_all.scss +8 -0
- data/scss/pg/base/typography/helpers/_functions.scss +160 -0
- data/scss/pg/base/typography/helpers/_mixins.scss +121 -0
- data/scss/pg/grid/_all.scss +9 -0
- data/scss/pg/grid/_behavior.scss +51 -0
- data/scss/pg/grid/_helpers.scss +8 -0
- data/scss/pg/grid/_settings.scss +48 -0
- data/scss/pg/grid/helpers/_functions.scss +140 -0
- data/scss/pg/grid/helpers/_mixins.scss +247 -0
- data/scss/pg/helpers/_all.scss +11 -0
- data/scss/pg/helpers/_colors.scss +163 -0
- data/scss/pg/helpers/_fonts.scss +21 -0
- data/scss/pg/helpers/_functions.scss +91 -0
- data/scss/pg/helpers/_mixins.scss +7 -0
- data/scss/pg/helpers/_settings.scss +11 -0
- data/scss/pg/helpers/fonts/_bree-serif.scss +27 -0
- data/scss/pg/helpers/fonts/_example.scss +47 -0
- data/scss/pg/helpers/fonts/_lato.scss +36 -0
- data/scss/pg/helpers/fonts/_monospace.scss +43 -0
- data/scss/pg/helpers/fonts/_raleway.scss +35 -0
- data/scss/pg/helpers/fonts/_righteous.scss +27 -0
- data/scss/pg/helpers/fonts/_roboto.scss +38 -0
- data/scss/pg/helpers/fonts/_sans-serif.scss +43 -0
- data/scss/pg/helpers/fonts/_serif.scss +43 -0
- data/scss/pg/helpers/fonts/_sofia-pro.scss +44 -0
- data/scss/pg/helpers/fonts/_varela-round.scss +28 -0
- data/scss/pg/helpers/fonts/icon-fonts/_fontawesome.scss +34 -0
- data/scss/pg/helpers/fonts/icon-fonts/_foundation-accessability.scss +76 -0
- data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_bootstrap.scss +84 -0
- data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_core.scss +129 -0
- data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_extras.scss +93 -0
- data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_icons.scss +381 -0
- data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_mixins.scss +48 -0
- data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_path.scss +14 -0
- data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_variables.scss +734 -0
- data/scss/pg/helpers/fonts/icon-fonts/foundation-accessability/_settings.scss +28 -0
- data/scss/pg/helpers/library/_lists.scss +462 -0
- data/scss/pg/helpers/mixins/_all.scss +15 -0
- data/scss/pg/helpers/mixins/_anchors.scss +125 -0
- data/scss/pg/helpers/mixins/_baseline.scss +53 -0
- data/scss/pg/helpers/mixins/_breakpoints.scss +35 -0
- data/scss/pg/helpers/mixins/_content.scss +19 -0
- data/scss/pg/helpers/mixins/_css-triangle.scss +70 -0
- data/scss/pg/helpers/mixins/_elements.scss +106 -0
- data/scss/pg/helpers/mixins/_module.scss +327 -0
- data/scss/pg/helpers/mixins/_text.scss +87 -0
- data/scss/pg/helpers/mixins/_units.scss +67 -0
- data/scss/pg/helpers/settings/_all.scss +7 -0
- data/scss/pg/helpers/settings/_breakpoints.scss +21 -0
- data/scss/pg/modules/_all.scss +9 -0
- data/scss/pg/modules/_behavior.scss +13 -0
- data/scss/pg/modules/_helpers.scss +13 -0
- data/scss/pg/modules/_settings.scss +13 -0
- data/scss/pg/modules/accordions/_all.scss +8 -0
- data/scss/pg/modules/accordions/_behavior.scss +5 -0
- data/scss/pg/modules/accordions/_helpers.scss +5 -0
- data/scss/pg/modules/accordions/_settings.scss +4 -0
- data/scss/pg/modules/buttons/_all.scss +8 -0
- data/scss/pg/modules/buttons/_behavior.scss +89 -0
- data/scss/pg/modules/buttons/_helpers.scss +7 -0
- data/scss/pg/modules/buttons/_settings.scss +153 -0
- data/scss/pg/modules/buttons/helpers/_mixins.scss +33 -0
- data/scss/pg/modules/forms/_all.scss +8 -0
- data/scss/pg/modules/forms/_behavior.bak.scss +215 -0
- data/scss/pg/modules/forms/_behavior.scss +215 -0
- data/scss/pg/modules/forms/_helpers.scss +8 -0
- data/scss/pg/modules/forms/_settings.scss +10 -0
- data/scss/pg/modules/forms/helpers/_mixins.scss +94 -0
- data/scss/pg/modules/forms/settings/forms.scss +19 -0
- data/scss/pg/modules/forms/settings/input.scss +256 -0
- data/scss/pg/modules/forms/settings/labels.scss +101 -0
- data/scss/pg/modules/lists/_all.scss +9 -0
- data/scss/pg/modules/lists/_behavior.scss +99 -0
- data/scss/pg/modules/lists/_helpers.scss +11 -0
- data/scss/pg/modules/lists/_settings.scss +49 -0
- data/scss/pg/modules/tables/_all.scss +8 -0
- data/scss/pg/modules/tables/_behavior.scss +79 -0
- data/scss/pg/modules/tables/_helpers.scss +7 -0
- data/scss/pg/modules/tables/_settings.scss +69 -0
- data/scss/pg/modules/tables/helpers/_mixins.scss +9 -0
- data/scss/pg/modules/tabs/_all.scss +8 -0
- data/scss/pg/modules/tabs/_behavior.scss +77 -0
- data/scss/pg/modules/tabs/_helpers.scss +7 -0
- data/scss/pg/modules/tabs/_settings.scss +8 -0
- data/scss/pg/modules/tabs/helpers/_mixins.scss +4 -0
- data/scss/pg/skins/_crossinghippos.scss +8 -0
- data/scss/pg/skins/crossinghippos/_all.scss +9 -0
- data/scss/pg/skins/crossinghippos/_behavior.scss +10 -0
- data/scss/pg/skins/crossinghippos/_helpers.scss +8 -0
- data/scss/pg/skins/crossinghippos/_settings.scss +9 -0
- data/scss/pg/skins/crossinghippos/buttons/_all.scss +9 -0
- data/scss/pg/skins/crossinghippos/buttons/_behavior.scss +25 -0
- data/scss/pg/skins/crossinghippos/buttons/_helpers.scss +7 -0
- data/scss/pg/skins/crossinghippos/buttons/_settings.scss +50 -0
- data/scss/pg/skins/crossinghippos/forms/_all.scss +9 -0
- data/scss/pg/skins/crossinghippos/forms/_base.scss +7 -0
- data/scss/pg/skins/crossinghippos/forms/_behavior.scss +259 -0
- data/scss/pg/skins/crossinghippos/forms/_settings.scss +29 -0
- data/scss/pg/skins/crossinghippos/linkbar/_all.scss +8 -0
- data/scss/pg/skins/crossinghippos/linkbar/_behavior.scss +73 -0
- data/scss/pg/skins/crossinghippos/linkbar/_helpers.scss +5 -0
- data/scss/pg/skins/crossinghippos/linkbar/_settings.scss +27 -0
- data/templates/base/manifest.rb +15 -0
- data/templates/base/screen.scss +39 -0
- data/templates/grid/manifest.rb +15 -0
- data/templates/grid/screen.scss +36 -0
- data/templates/modules/manifest.rb +15 -0
- data/templates/modules/screen.scss +44 -0
- metadata +210 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
$fontFileName: "/PGFramework/Fonts/accessibility_foundicons";
|
2
|
+
$fontName: "AccessibilityFoundicons";
|
3
|
+
$classPrefix: "foundicon-";
|
4
|
+
|
5
|
+
@mixin i-class($name,$pua) {
|
6
|
+
.#{$classPrefix}#{$name}:before {
|
7
|
+
content: "\f#{$pua}";
|
8
|
+
}
|
9
|
+
}
|
10
|
+
|
11
|
+
@mixin ie-class($name,$pua) {
|
12
|
+
.#{$classPrefix}#{$name} {
|
13
|
+
*zoom: expression( this.runtimeStyle['zoom'] = "1", this.innerHTML = "#{$pua};");
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
@mixin face {
|
18
|
+
@font-face {
|
19
|
+
font-family: $fontName;
|
20
|
+
src: url('#{$fontFileName}.eot');
|
21
|
+
src: url('#{$fontFileName}.eot?#iefix') format('embedded-opentype'),
|
22
|
+
url('#{$fontFileName}.woff') format('woff'),
|
23
|
+
url('#{$fontFileName}.ttf') format('truetype'),
|
24
|
+
url('#{$fontFileName}.svg##{$fontName}') format('svg');
|
25
|
+
font-weight: normal;
|
26
|
+
font-style: normal;
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,462 @@
|
|
1
|
+
// /* -------------------------------------------------------------------------------// *
|
2
|
+
// * A couple of advanced Sass list functions
|
3
|
+
// * -------------------------------------------------------------------------------// *
|
4
|
+
// *
|
5
|
+
// * first($list)
|
6
|
+
// * Returns first element of $list
|
7
|
+
// *
|
8
|
+
// * last($list)
|
9
|
+
// * Returns last element of $list
|
10
|
+
// *
|
11
|
+
// * last-index($list, $value)
|
12
|
+
// * Returns last index of $value in $list
|
13
|
+
// *
|
14
|
+
// * to-string($list, $glue: '', $is-nested: false)
|
15
|
+
// * Joins all elements of $list with $glue
|
16
|
+
// *
|
17
|
+
// * prepend($list, $value)
|
18
|
+
// * Add $value as first index of $list
|
19
|
+
// *
|
20
|
+
// * insert-nth($list, $index, $value)
|
21
|
+
// * Add $value at $index in $list
|
22
|
+
// *
|
23
|
+
// * replace($list, $old-value, $new-value, $recursive: false)
|
24
|
+
// * Replace $old-value by $new-value in $list
|
25
|
+
// *
|
26
|
+
// * replace-nth($list, $index, $value)
|
27
|
+
// * Replace value at $index from $list by $value
|
28
|
+
// *
|
29
|
+
// * remove($list, $value, $recursive: false)
|
30
|
+
// * Remove value(s) $value from $list
|
31
|
+
// *
|
32
|
+
// * remove-nth($list, $index)
|
33
|
+
// * Remove value from $list at index $index
|
34
|
+
// *
|
35
|
+
// * slice($list, $start: 1, $end: length($list))
|
36
|
+
// * Slices $list between $start and $end
|
37
|
+
// *
|
38
|
+
// * reverse($list, $recursive: false)
|
39
|
+
// * Reverses the order of $list
|
40
|
+
// *
|
41
|
+
// * loop($list, $value: 1)
|
42
|
+
// * Shift indexes from $list of $value
|
43
|
+
// *
|
44
|
+
// * -------------------------------------------------------------------------------// *
|
45
|
+
// * CodePen: http://codepen.io/HugoGiraudel/pen/loAgq
|
46
|
+
// * Repository: https://github.com/HugoGiraudel/Sass-snippets/blob/master/src/list-functions/
|
47
|
+
// * -------------------------------------------------------------------------------// */
|
48
|
+
|
49
|
+
|
50
|
+
// /**
|
51
|
+
// * Returns first element of $list
|
52
|
+
// * -------------------------------------------------------------------------------
|
53
|
+
// * @example first(a, b, c) => a
|
54
|
+
// * -------------------------------------------------------------------------------
|
55
|
+
// * @param $list [List] : list
|
56
|
+
// * -------------------------------------------------------------------------------
|
57
|
+
// * @return [Literal]
|
58
|
+
// */
|
59
|
+
@function first($list) {
|
60
|
+
@return nth($list, 1);
|
61
|
+
}
|
62
|
+
|
63
|
+
// /**
|
64
|
+
// * Returns last element of $list
|
65
|
+
// * -------------------------------------------------------------------------------
|
66
|
+
// * @example last( (a, b, c) ) => c
|
67
|
+
// * -------------------------------------------------------------------------------
|
68
|
+
// * @param $list [List] : list
|
69
|
+
// * -------------------------------------------------------------------------------
|
70
|
+
// * @return [Literal]
|
71
|
+
// */
|
72
|
+
@function last($list) {
|
73
|
+
@return nth($list, length($list));
|
74
|
+
}
|
75
|
+
|
76
|
+
// /**
|
77
|
+
// * Returns last index of $value in $list
|
78
|
+
// * -------------------------------------------------------------------------------
|
79
|
+
// * @example last-index( (a, b, c), z ) => null
|
80
|
+
// * @example last-index( (a, b, c, a), a ) => 4
|
81
|
+
// * -------------------------------------------------------------------------------
|
82
|
+
// * @param $list [List] : list
|
83
|
+
// * @param $value [Literal] : value to be searched for
|
84
|
+
// * -------------------------------------------------------------------------------
|
85
|
+
// * @return [Number]
|
86
|
+
// */
|
87
|
+
@function last-index($list, $value) {
|
88
|
+
@for $i from length($list)*-1 through -1 {
|
89
|
+
@if nth($list, abs($i)) == $value {
|
90
|
+
@return abs($i);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
@return null;
|
95
|
+
}
|
96
|
+
|
97
|
+
// /**
|
98
|
+
// * Joins all elements of $list with $glue
|
99
|
+
// * -------------------------------------------------------------------------------
|
100
|
+
// * @example to-string( (a, b, c) ) => abc
|
101
|
+
// * @example to-string( (a, b, c), '-' ) => a-b-c
|
102
|
+
// * @example to-string( (a, b c, d) ) => abcd
|
103
|
+
// * -------------------------------------------------------------------------------
|
104
|
+
// * @param $list [List] : list
|
105
|
+
// * @param $glue [String] : value to use as a join string
|
106
|
+
// * @param $is-nested [Boolean] : strictly internal boolean for recursivity
|
107
|
+
// * -------------------------------------------------------------------------------
|
108
|
+
// * @return [String]
|
109
|
+
// */
|
110
|
+
@function to-string($list, $glue: '', $is-nested: false) {
|
111
|
+
$result: null;
|
112
|
+
|
113
|
+
@for $i from 1 through length($list) {
|
114
|
+
$e: nth($list, $i);
|
115
|
+
|
116
|
+
@if type-of($e) == list {
|
117
|
+
$result: $result#{to-string($e, $glue, true)};
|
118
|
+
}
|
119
|
+
|
120
|
+
@else {
|
121
|
+
$result: if($i != length($list) or $is-nested, $result#{$e}#{$glue}, $result#{$e});
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
@return $result;
|
126
|
+
}
|
127
|
+
|
128
|
+
// /**
|
129
|
+
// * Add $value as first index of $list
|
130
|
+
// * -------------------------------------------------------------------------------
|
131
|
+
// * @example prepend( (a, b, c), z ) => z, a, b, c
|
132
|
+
// * @example prepend( (a, b, c), y z ) => y z, a, b, c
|
133
|
+
// * -------------------------------------------------------------------------------
|
134
|
+
// * @param $list [List] : list
|
135
|
+
// * @param $value [Literal] : value to prepend to the list
|
136
|
+
// * -------------------------------------------------------------------------------
|
137
|
+
// * @return [List]
|
138
|
+
// */
|
139
|
+
@function prepend($list, $value) {
|
140
|
+
@return join($value, $list);
|
141
|
+
}
|
142
|
+
|
143
|
+
// /**
|
144
|
+
// * Add $value at $index in $list
|
145
|
+
// * -------------------------------------------------------------------------------
|
146
|
+
// * @example insert-nth( (a, b, c), 2, z ) => a, z, b, c
|
147
|
+
// * @example insert-nth( (a, b, c), 0, z ) => error
|
148
|
+
// * @example insert-nth( (a, b, c), -1, z ) => error
|
149
|
+
// * @example insert-nth( (a, b, c), 10, z ) => error
|
150
|
+
// * -------------------------------------------------------------------------------
|
151
|
+
// * @param $list [List] : list
|
152
|
+
// * @param $index [Number] : index to add
|
153
|
+
// * @param $value [Literal] : value to add
|
154
|
+
// * -------------------------------------------------------------------------------
|
155
|
+
// * @raise [Error] if $index isn't an integer
|
156
|
+
// * @raise [Error] if $index is strictly lesser than 1
|
157
|
+
// * @raise [Error] if $index is strictly greater than length of $list
|
158
|
+
// * -------------------------------------------------------------------------------
|
159
|
+
// * @return [List]
|
160
|
+
// */
|
161
|
+
@function insert-nth($list, $index, $value) {
|
162
|
+
$result: null;
|
163
|
+
|
164
|
+
@if type-of($index) != number {
|
165
|
+
@warn "$index: #{quote($index)} is not a number for `insert-nth`.";
|
166
|
+
}
|
167
|
+
|
168
|
+
@else if $index < 1 {
|
169
|
+
@warn "List index 0 must be a non-zero integer for `insert-nth`";
|
170
|
+
}
|
171
|
+
|
172
|
+
@else if $index > length($list) {
|
173
|
+
@warn "List index is #{$index} but list is only #{length($list)} item long for `insert-nth'.";
|
174
|
+
}
|
175
|
+
|
176
|
+
@else {
|
177
|
+
$result: ();
|
178
|
+
|
179
|
+
@for $i from 1 through length($list) {
|
180
|
+
@if $i == $index {
|
181
|
+
$result: append($result, $value);
|
182
|
+
}
|
183
|
+
|
184
|
+
$result: append($result, nth($list, $i));
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
@return $result;
|
189
|
+
}
|
190
|
+
|
191
|
+
// /**
|
192
|
+
// * Replace value at $index from $list by $value
|
193
|
+
// * -------------------------------------------------------------------------------
|
194
|
+
// * @example replace-nth( (a, b, c), 2, z ) => a, z, c
|
195
|
+
// * @example replace-nth( (a, b, c), 0, z ) => error
|
196
|
+
// * @example replace-nth( (a, b, c), -1, z ) => a, b, z
|
197
|
+
// * @example replace-nth( (a, b, c), 10, z ) => error
|
198
|
+
// * @example replace-nth( (a, b, c), -10, z ) => error
|
199
|
+
// * -------------------------------------------------------------------------------
|
200
|
+
// * @param $list [List] : list
|
201
|
+
// * @param $index [Number] : index to update
|
202
|
+
// * @param $value [Literal] : new value for index $index
|
203
|
+
// * -------------------------------------------------------------------------------
|
204
|
+
// * @raise [Error] if $index isn't an integer
|
205
|
+
// * @raise [Error] if $index is 0
|
206
|
+
// * @raise [Error] if abs value of $index is strictly greater than length of $list
|
207
|
+
// * -------------------------------------------------------------------------------
|
208
|
+
// * @return [List]
|
209
|
+
// */
|
210
|
+
@function replace-nth($list, $index, $value) {
|
211
|
+
$result: null;
|
212
|
+
|
213
|
+
@if type-of($index) != number {
|
214
|
+
@warn "$index: #{quote($index)} is not a number for `replace-nth`.";
|
215
|
+
}
|
216
|
+
|
217
|
+
@else if $index == 0 {
|
218
|
+
@warn "List index 0 must be a non-zero integer for `replace-nth`.";
|
219
|
+
}
|
220
|
+
|
221
|
+
@else if abs($index) > length($list) {
|
222
|
+
@warn "List index is #{$index} but list is only #{length($list)} item long for `replace-nth`.";
|
223
|
+
}
|
224
|
+
|
225
|
+
@else {
|
226
|
+
$result: ();
|
227
|
+
$index: if($index < 0, length($list) + $index + 1, $index);
|
228
|
+
|
229
|
+
@for $i from 1 through length($list) {
|
230
|
+
@if $i == $index {
|
231
|
+
$result: append($result, $value);
|
232
|
+
}
|
233
|
+
|
234
|
+
@else {
|
235
|
+
$result: append($result, nth($list, $i));
|
236
|
+
}
|
237
|
+
}
|
238
|
+
}
|
239
|
+
|
240
|
+
@return $result;
|
241
|
+
}
|
242
|
+
|
243
|
+
// /**
|
244
|
+
// * Replace $old-value by $new-value in $list
|
245
|
+
// * -------------------------------------------------------------------------------
|
246
|
+
// * @example replace( (a, b, c), b, z ) => a, z, c
|
247
|
+
// * @example replace( (a, b, c), y, z ) => a, b, c
|
248
|
+
// * @example replace( (a, b, c a), a, z ) => z, b, c z
|
249
|
+
// * @example replace( (a, b, c a), a, z, true ) => z, b, c z
|
250
|
+
// * -------------------------------------------------------------------------------
|
251
|
+
// * @param $list [List] : list
|
252
|
+
// * @param $old-value [Literal] : value to replace
|
253
|
+
// * @param $new-value [Literal] : new value for $old-value
|
254
|
+
// * @param $recursive [Boolean] : enable / disable recursivity
|
255
|
+
// * -------------------------------------------------------------------------------
|
256
|
+
// * @return [List]
|
257
|
+
// */
|
258
|
+
@function replace($list, $old-value, $new-value, $recursive: false) {
|
259
|
+
$result: ();
|
260
|
+
|
261
|
+
@for $i from 1 through length($list) {
|
262
|
+
@if type-of(nth($list, $i)) == list and $recursive {
|
263
|
+
$result: append($result, replace(nth($list, $i), $old-value, $new-value, $recursive));
|
264
|
+
}
|
265
|
+
|
266
|
+
@else {
|
267
|
+
@if nth($list, $i) == $old-value {
|
268
|
+
$result: append($result, $new-value);
|
269
|
+
}
|
270
|
+
|
271
|
+
@else {
|
272
|
+
$result: append($result, nth($list, $i));
|
273
|
+
}
|
274
|
+
}
|
275
|
+
}
|
276
|
+
|
277
|
+
@return $result;
|
278
|
+
}
|
279
|
+
|
280
|
+
// /**
|
281
|
+
// * Remove value from $list at index $index
|
282
|
+
// * -------------------------------------------------------------------------------
|
283
|
+
// * @example remove-nth( (a, b, c), 2 ) => a, c
|
284
|
+
// * @example remove-nth( (a, b, c), 0 ) => error
|
285
|
+
// * @example remove-nth( (a, b, c), -1 ) => a, b
|
286
|
+
// * @example remove-nth( (a, b, c), 10 ) => error
|
287
|
+
// * @example remove-nth( (a, b, c), -10 ) => error
|
288
|
+
// * -------------------------------------------------------------------------------
|
289
|
+
// * @param $list [List] : list
|
290
|
+
// * @param $index [Number] : index to remove
|
291
|
+
// * -------------------------------------------------------------------------------
|
292
|
+
// * @raise [Error] if $index isn't an integer
|
293
|
+
// * @raise [Error] if $index is 0
|
294
|
+
// * @raise [Error] if abs value of $index is strictly greater then length of $list
|
295
|
+
// * -------------------------------------------------------------------------------
|
296
|
+
// * @return [List]
|
297
|
+
// */
|
298
|
+
@function remove-nth($list, $index) {
|
299
|
+
$result: null;
|
300
|
+
|
301
|
+
@if type-of($index) != number {
|
302
|
+
@warn "$index: #{quote($index)} is not a number for `remove-nth`.";
|
303
|
+
}
|
304
|
+
|
305
|
+
@else if $index == 0 {
|
306
|
+
@warn "List index 0 must be a non-zero integer for `remove-nth`.";
|
307
|
+
}
|
308
|
+
|
309
|
+
@else if abs($index) > length($list) {
|
310
|
+
@warn "List index is #{$index} but list is only #{length($list)} item long for `remove-nth`.";
|
311
|
+
}
|
312
|
+
|
313
|
+
@else {
|
314
|
+
$result: ();
|
315
|
+
$index: if($index < 0, length($list) + $index + 1, $index);
|
316
|
+
|
317
|
+
@for $i from 1 through length($list) {
|
318
|
+
@if $i != $index {
|
319
|
+
$result: append($result, nth($list, $i));
|
320
|
+
}
|
321
|
+
}
|
322
|
+
}
|
323
|
+
|
324
|
+
@return $result;
|
325
|
+
}
|
326
|
+
|
327
|
+
// /**
|
328
|
+
// * Remove value(s) $value from $list
|
329
|
+
// * -------------------------------------------------------------------------------
|
330
|
+
// * @example remove( (a, b, c), b ) => a, c
|
331
|
+
// * @example remove( (a, b, c), z ) => a, b, c
|
332
|
+
// * @example remove( (a, b, c b), b ) => a, c b
|
333
|
+
// * @example remove( (a, b, c b), b, true ) => a, c
|
334
|
+
// * -------------------------------------------------------------------------------
|
335
|
+
// * @param $list [List] : list
|
336
|
+
// * @param $value [Literal] : value to remove
|
337
|
+
// * @param $recursive [Boolean] : enable / disable recursivity
|
338
|
+
// * -------------------------------------------------------------------------------
|
339
|
+
// * @return [List]
|
340
|
+
// */
|
341
|
+
@function remove($list, $value, $recursive: false) {
|
342
|
+
$result: ();
|
343
|
+
|
344
|
+
@for $i from 1 through length($list) {
|
345
|
+
@if type-of(nth($list, $i)) == list and $recursive {
|
346
|
+
$result: append($result, remove(nth($list, $i), $value, $recursive));
|
347
|
+
}
|
348
|
+
|
349
|
+
@else if nth($list, $i) != $value {
|
350
|
+
$result: append($result, nth($list, $i));
|
351
|
+
}
|
352
|
+
}
|
353
|
+
|
354
|
+
@return $result;
|
355
|
+
}
|
356
|
+
|
357
|
+
// /**
|
358
|
+
// * Slices $list between $start and $end
|
359
|
+
// * -------------------------------------------------------------------------------
|
360
|
+
// * @example slice( (a, b, c, d), 2, 3 ) => b, c
|
361
|
+
// * @example slice( (a, b, c, d), 3, 2 ) => error
|
362
|
+
// * @example slice( (a, b, c, d), 3, 5 ) => error
|
363
|
+
// * @example slice( (a, b, c, d), -1, 3 ) => error
|
364
|
+
// * @example slice( (a, b, c, d), 0, 3 ) => error
|
365
|
+
// * @example slice( (a, b, c, d), 3, 3 ) => c
|
366
|
+
// * -------------------------------------------------------------------------------
|
367
|
+
// * @param $list [List] : list
|
368
|
+
// * @param $start [Number] : start index
|
369
|
+
// * @param $end [Number] : end index
|
370
|
+
// * -------------------------------------------------------------------------------
|
371
|
+
// * @raise [Error] if $start or $end aren't integers
|
372
|
+
// * @raise [Error] if $start is greater than $end
|
373
|
+
// * @raise [Error] if $start or $end is strictly lesser than 1
|
374
|
+
// * @raise [Error] if $start is strictly greater than length of $list
|
375
|
+
// * @raise [Error] if $end is strictly greater than length of $list
|
376
|
+
// * -------------------------------------------------------------------------------
|
377
|
+
// * @return [List]
|
378
|
+
// */
|
379
|
+
@function slice($list, $start: 1, $end: length($list)) {
|
380
|
+
$result: null;
|
381
|
+
|
382
|
+
@if type-of($start) != number or type-of($end) != number {
|
383
|
+
@warn "Either $start or $end are not a number for `slice`.";
|
384
|
+
}
|
385
|
+
|
386
|
+
@else if $start > $end {
|
387
|
+
@warn "The start index has to be lesser than or equals to the end index for `slice`.";
|
388
|
+
}
|
389
|
+
|
390
|
+
@else if $start < 1 or $end < 1 {
|
391
|
+
@warn "List indexes must be non-zero integers for `slice`.";
|
392
|
+
}
|
393
|
+
|
394
|
+
@else if $start > length($list) {
|
395
|
+
@warn "List index is #{$start} but list is only #{length($list)} item long for `slice`.";
|
396
|
+
}
|
397
|
+
|
398
|
+
@else if $end > length($list) {
|
399
|
+
@warn "List index is #{$end} but list is only #{length($list)} item long for `slice`.";
|
400
|
+
}
|
401
|
+
|
402
|
+
@else {
|
403
|
+
$result: ();
|
404
|
+
|
405
|
+
@for $i from $start through $end {
|
406
|
+
$result: append($result, nth($list, $i));
|
407
|
+
}
|
408
|
+
}
|
409
|
+
|
410
|
+
@return $result;
|
411
|
+
}
|
412
|
+
|
413
|
+
// /**
|
414
|
+
// * Reverses the order of $list
|
415
|
+
// * -------------------------------------------------------------------------------
|
416
|
+
// * @example reverse( (a, b, c) ) => c, b, a
|
417
|
+
// * @example reverse( (a, b, c a) ) => c a, b, a
|
418
|
+
// * @example reverse( (a, b, c a), true ) => a c, b, a
|
419
|
+
// * @example reverse( a ) => a
|
420
|
+
// * -------------------------------------------------------------------------------
|
421
|
+
// * @param $list [List] : list
|
422
|
+
// * @param $recursive [Boolean] : enable / disable recursivity
|
423
|
+
// * -------------------------------------------------------------------------------
|
424
|
+
// * @return [List]
|
425
|
+
// */
|
426
|
+
@function reverse($list, $recursive: false) {
|
427
|
+
$result: ();
|
428
|
+
|
429
|
+
@for $i from length($list)*-1 through -1 {
|
430
|
+
@if type-of(nth($list, abs($i))) == list and $recursive {
|
431
|
+
$result: append($result, reverse(nth($list, abs($i)), $recursive));
|
432
|
+
}
|
433
|
+
|
434
|
+
@else {
|
435
|
+
$result: append($result, nth($list, abs($i)));
|
436
|
+
}
|
437
|
+
}
|
438
|
+
|
439
|
+
@return $result;
|
440
|
+
}
|
441
|
+
|
442
|
+
// /**
|
443
|
+
// * Shift indexes from $list of $value
|
444
|
+
// * -------------------------------------------------------------------------------
|
445
|
+
// * @example loop( (a, b, c, d, e) ) => e, a, b, c, d
|
446
|
+
// * @example loop( (a, b, c, d, e), 2 ) => d, e, a, b, c
|
447
|
+
// * @example loop( (a, b, c, d, e), -2 ) => c, d, e, a, b
|
448
|
+
// * -------------------------------------------------------------------------------
|
449
|
+
// * @param $list [List] : list
|
450
|
+
// * @param $value [Number] : number of position between old and new indexes
|
451
|
+
// * -------------------------------------------------------------------------------
|
452
|
+
// * @return [List]
|
453
|
+
// */
|
454
|
+
@function loop($list, $value: 1) {
|
455
|
+
$result: ();
|
456
|
+
|
457
|
+
@for $i from 0 to length($list) {
|
458
|
+
$result: append($result, nth($list, ($i - $value) % length($list) + 1));
|
459
|
+
}
|
460
|
+
|
461
|
+
@return $result;
|
462
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// /**
|
2
|
+
// * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
|
3
|
+
// * Licensed under GNU General Public License version 2 or later; see LICENSE.txt
|
4
|
+
// */
|
5
|
+
@if $trace-imports { @debug 'imported'; }
|
6
|
+
|
7
|
+
@import "anchors";
|
8
|
+
@import "baseline";
|
9
|
+
@import "breakpoints";
|
10
|
+
@import "content";
|
11
|
+
@import "css-triangle";
|
12
|
+
@import "elements";
|
13
|
+
@import "module";
|
14
|
+
@import "text";
|
15
|
+
@import "units";
|
@@ -0,0 +1,125 @@
|
|
1
|
+
// /**
|
2
|
+
// * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
|
3
|
+
// * Licensed under GNU General Public License version 2 or later; see LICENSE.txt
|
4
|
+
// */
|
5
|
+
@if $trace-imports { @debug 'imported'; }
|
6
|
+
|
7
|
+
|
8
|
+
// Wraps @content in a selector - call from within a mixin
|
9
|
+
// ==========================================================================
|
10
|
+
// @example @include wrap(a){ color: Blue; }; => a { color: Blue; }
|
11
|
+
// @example @include wrap(false){ color: Blue; }; => color: Blue;
|
12
|
+
// --------------------------------------------------------------------------
|
13
|
+
// @param $selector [String] the selector to be used: a, .class, #id, ::pseudo
|
14
|
+
|
15
|
+
@mixin wrap($selector)
|
16
|
+
{
|
17
|
+
@if $selector {
|
18
|
+
#{$selector} {
|
19
|
+
@content;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
@else {
|
23
|
+
@content;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
|
28
|
+
// Mixin anchor colors in a bulletproof way
|
29
|
+
// ==========================================================================
|
30
|
+
// @example @include wrap(a){ color: Blue; }; => a { color: Blue; }
|
31
|
+
// @example @include wrap(false){ color: Blue; }; => color: Blue;
|
32
|
+
// --------------------------------------------------------------------------
|
33
|
+
// @param $selector [String] the selector to be used or false for none
|
34
|
+
// @param $color [String] the color for an unvisited link
|
35
|
+
// @param $color-hover [String] the color for a hover link
|
36
|
+
// @param $color-active [String] the color for an active link
|
37
|
+
// @param $color-visited [String] the color for a visited link
|
38
|
+
// @param $mixin-states [Boolean] add states for use with JavaScript
|
39
|
+
|
40
|
+
@mixin anchor-color($selector, $color, $color-hover, $color-active, $color-visited, $mixin-states: true)
|
41
|
+
{
|
42
|
+
@include wrap($selector) {
|
43
|
+
|
44
|
+
color: $color;
|
45
|
+
|
46
|
+
// Check if they are a different color then the default, else skip it
|
47
|
+
$color-hover: if($color-hover==$color, false, $color-hover);
|
48
|
+
$color-active: if($color-active==$color, false, $color-active);
|
49
|
+
$color-visited: if($color-visited==$color, false, $color-visited);
|
50
|
+
|
51
|
+
@if $mixin-states {
|
52
|
+
|
53
|
+
@if $color-hover {
|
54
|
+
&:hover {
|
55
|
+
@extend .is-#{$selector}-hover;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
@if $color-active {
|
59
|
+
&:active {
|
60
|
+
@extend .is-#{$selector}-active;
|
61
|
+
}
|
62
|
+
}
|
63
|
+
@if $color-visited {
|
64
|
+
&:visited {
|
65
|
+
@extend .is-#{$selector}-visited;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
@else {
|
70
|
+
|
71
|
+
@if $color-hover {
|
72
|
+
&:hover {
|
73
|
+
color: $color-hover;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
@if $color-active {
|
77
|
+
&:active {
|
78
|
+
color: $color-active;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
@if $color-visited {
|
82
|
+
&:visited {
|
83
|
+
color: $color-visited;
|
84
|
+
@if $color-hover {
|
85
|
+
&:hover {
|
86
|
+
color: $color-hover;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
@if $color-active {
|
90
|
+
&:active {
|
91
|
+
color: $color-active;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
@if $mixin-states {
|
99
|
+
@if $color-hover {
|
100
|
+
.is-#{$selector}-hover {
|
101
|
+
color: $color-hover;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
@if $color-active {
|
105
|
+
.is-#{$selector}-active {
|
106
|
+
color: $color-hover;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
@if $color-visited {
|
110
|
+
.is-#{$selector}-visited {
|
111
|
+
color: $color-visited;
|
112
|
+
@if $color-hover {
|
113
|
+
&:hover {
|
114
|
+
@extend .is-#{$selector}-hover;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
@if $color-active {
|
118
|
+
&:active {
|
119
|
+
@extend .is-#{$selector}-active;
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
// /**
|
2
|
+
// * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
|
3
|
+
// * Licensed under GNU General Public License version 2 or later; see LICENSE.txt
|
4
|
+
// */
|
5
|
+
@if $trace-imports { @debug 'imported'; }
|
6
|
+
|
7
|
+
// Use for top and bottom margins and paddings
|
8
|
+
// Declare like: @include vertical-rhythm(1, padding-top);
|
9
|
+
// Uses the project's $base-line-height variable as declared in the Vertical Rhythm module settings
|
10
|
+
@mixin vertical-rhythm($lines, $property)
|
11
|
+
{
|
12
|
+
#{$property}: rhythm($lines);
|
13
|
+
}
|
14
|
+
|
15
|
+
// Use for left and right margins and paddings
|
16
|
+
// Declare like: @include horizontal-rhythm(1, padding-top);
|
17
|
+
// Uses the project's $column-spacing variable as declared in the Persistent Grid module settings
|
18
|
+
@mixin horizontal-rhythm($factor, $property)
|
19
|
+
{
|
20
|
+
#{$property}: horizontal-rhythm($factor);
|
21
|
+
}
|
22
|
+
|
23
|
+
// Mixin all four values at once
|
24
|
+
@mixin padding($units)
|
25
|
+
{
|
26
|
+
$top: nth($units, 1);
|
27
|
+
$right: nth($units, 2);
|
28
|
+
$bottom: nth($units, 3);
|
29
|
+
$left: nth($units, 4);
|
30
|
+
|
31
|
+
$top: if($top!=0, rhythm($top), $top);
|
32
|
+
$right: if($right!=0, column-padding($right), $right);
|
33
|
+
$bottom: if($bottom!=0, rhythm($bottom), $bottom);
|
34
|
+
$left: if($left!=0, column-padding($left), $left);
|
35
|
+
|
36
|
+
padding: $top $right $bottom $left;
|
37
|
+
}
|
38
|
+
|
39
|
+
// Mixin all four values at once
|
40
|
+
@mixin margin($units)
|
41
|
+
{
|
42
|
+
$top: nth($units, 1);
|
43
|
+
$right: nth($units, 2);
|
44
|
+
$bottom: nth($units, 3);
|
45
|
+
$left: nth($units, 4);
|
46
|
+
|
47
|
+
$top: if($top!=0, rhythm($top), $top);
|
48
|
+
$right: if($right!=0, column-padding($right), $right);
|
49
|
+
$bottom: if($bottom!=0, rhythm($bottom), $bottom);
|
50
|
+
$left: if($left!=0, column-padding($left), $left);
|
51
|
+
|
52
|
+
margin: $top $right $bottom $left;
|
53
|
+
}
|