piecss 0.2.0.0 → 0.3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/lib/piecss.rb +16 -5
  3. data/sass/piecss/_settings.scss +6 -3
  4. data/sass/piecss/_utilities.scss +3 -0
  5. data/sass/piecss/behavior/_anchor.scss +1 -1
  6. data/sass/piecss/settings/_base.scss +5 -25
  7. data/sass/piecss/settings/_breakpoint.scss +112 -18
  8. data/sass/piecss/settings/_button.scss +2 -2
  9. data/sass/piecss/settings/_colour.scss +152 -0
  10. data/sass/piecss/settings/_constants.scss +0 -143
  11. data/sass/piecss/settings/_font.scss +0 -21
  12. data/sass/piecss/settings/_form.scss +7 -9
  13. data/sass/piecss/settings/{_grid.scss → _layout.scss} +43 -44
  14. data/sass/piecss/settings/_list.scss +1 -1
  15. data/sass/piecss/settings/_miscellaneous.scss +5 -0
  16. data/sass/piecss/settings/_rhythm.scss +0 -0
  17. data/sass/piecss/settings/_typography.scss +13 -0
  18. data/sass/piecss/settings/fonts/_example.scss +36 -36
  19. data/sass/piecss/settings/fonts/_monospace.scss +33 -33
  20. data/sass/piecss/settings/fonts/_sans-serif.scss +33 -33
  21. data/sass/piecss/settings/fonts/_serif.scss +33 -33
  22. data/sass/piecss/settings/fonts/_verdana.scss +34 -34
  23. data/sass/piecss/utilities/_breakpoint.scss +5 -5
  24. data/sass/piecss/utilities/_cache.scss +8 -4
  25. data/sass/piecss/utilities/_colour.scss +37 -0
  26. data/sass/piecss/utilities/_element.scss +85 -88
  27. data/sass/piecss/utilities/_image.scss +20 -22
  28. data/sass/piecss/utilities/_layout.scss +382 -213
  29. data/sass/piecss/utilities/_list.scss +2 -0
  30. data/sass/piecss/utilities/_miscellaneous.scss +161 -99
  31. data/sass/piecss/utilities/_rhythm.scss +27 -59
  32. data/sass/piecss/utilities/_side.scss +155 -154
  33. data/sass/piecss/utilities/_string.scss +68 -0
  34. data/sass/piecss/utilities/_svg.scss +47 -0
  35. data/sass/piecss/utilities/_typography.scss +96 -107
  36. data/sass/piecss/utilities/_unit.scss +85 -50
  37. data/templates/project/_sets/_button.scss +1 -1
  38. data/templates/project/_sets/_form.scss +1 -1
  39. data/templates/project/_sets.scss +1 -1
  40. data/templates/project/_settings.scss +1 -1
  41. metadata +13 -40
  42. data/sass/piecss/settings/fonts/_asap.scss +0 -44
  43. data/sass/piecss/settings/fonts/_bree-serif.scss +0 -23
  44. data/sass/piecss/settings/fonts/_lato.scss +0 -32
  45. data/sass/piecss/settings/fonts/_pt-sans.scss +0 -40
  46. data/sass/piecss/settings/fonts/_raleway.scss +0 -31
  47. data/sass/piecss/settings/fonts/_righteous.scss +0 -23
  48. data/sass/piecss/settings/fonts/_roboto-slab.scss +0 -37
  49. data/sass/piecss/settings/fonts/_roboto.scss +0 -35
  50. data/sass/piecss/settings/fonts/_sofia-pro.scss +0 -40
  51. data/sass/piecss/settings/fonts/_varela-round.scss +0 -24
  52. data/sass/piecss/settings/fonts/icon-fonts/_fontawesome.scss +0 -33
  53. data/sass/piecss/settings/fonts/icon-fonts/_foundation-accessability.scss +0 -75
  54. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_bootstrap.scss +0 -84
  55. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_core.scss +0 -129
  56. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_extras.scss +0 -93
  57. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_icons.scss +0 -381
  58. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_mixins.scss +0 -48
  59. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_path.scss +0 -14
  60. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_variables.scss +0 -734
  61. data/sass/piecss/settings/fonts/icon-fonts/foundation-accessability/_settings.scss +0 -28
@@ -19,8 +19,10 @@
19
19
  /// @param {String} $type
20
20
  ///
21
21
 
22
+ // scss-lint:disable Indentation
22
23
  @mixin list-style-type($type) {
23
24
  %list--#{$type} {
24
25
  list-style-type: $type;
25
26
  }
26
27
  }
28
+ // scss-lint:enable Indentation
@@ -11,6 +11,7 @@
11
11
  // old-ie
12
12
  // old-mozilla
13
13
  // inline-block
14
+ // pseudo-element
14
15
 
15
16
 
16
17
  // 1. Functions
@@ -18,7 +19,7 @@
18
19
 
19
20
  ///
20
21
  /// Converts a value to a proper boolean value
21
- ///
22
+ ///
22
23
  /// @since 0.1
23
24
  ///
24
25
  /// @param {*} $value
@@ -27,19 +28,21 @@
27
28
  ///
28
29
 
29
30
  @function to-bool($value) {
31
+
30
32
  @if not $value or $value == "" or $value == 0 {
31
33
  @return false;
32
34
  }
35
+
33
36
  @return true;
34
37
  }
35
38
 
36
39
  ///
37
40
  /// Converts a list of property values to a property map. Use to convert 'old-style' associative arrays to SASS's new Map type.
38
- ///
41
+ ///
39
42
  /// @example
40
- /// list-to-map((color #FFF, text-align left))
43
+ /// list-to-map((color $white, text-align left))
41
44
  /// // Output:
42
- /// (color: #FFF, text-align: left)
45
+ /// (color: $white, text-align: left)
43
46
  ///
44
47
  /// @since 0.1
45
48
  ///
@@ -48,14 +51,14 @@
48
51
  /// @return {Map}
49
52
  ///
50
53
 
51
- @function list-to-map($properties)
52
- {
53
- $map: ();
54
- @each $property in $properties {
55
- $map: map-merge($map, ( nth($property,1): nth($property,2) ) );
56
- }
54
+ @function list-to-map($properties) {
57
55
 
58
- @return $map;
56
+ $map: ();
57
+ @each $property in $properties {
58
+ $map: map-merge($map, (nth($property, 1): nth($property, 2)));
59
+ }
60
+
61
+ @return $map;
59
62
  }
60
63
 
61
64
 
@@ -64,68 +67,70 @@
64
67
 
65
68
  ///
66
69
  /// Mixin for border properties
67
- ///
70
+ ///
71
+ /// @todo: fix line 96: #{$property}-#{$key}
72
+ ///
68
73
  /// @since 0.1
69
74
  ///
70
- /// @param {String | Map | List | Numner} $values - The border (or outline) properties
75
+ /// @param {String | Map | List | Number} $values - The border (or outline) properties
71
76
  /// @param {Bool} $outline - If true, will render the values as outline properties
72
77
  ///
73
78
 
74
- @mixin border($values, $outline: false)
75
- {
76
- // This mixin needs a value-map to work, so convert argument if it is not a value-map;
77
- @if not(is-value-map($values, $keys-border)) {
78
- $values: value-map($values, $keys-border);
79
- }
79
+ @mixin border($values, $outline: false) {
80
80
 
81
- $property: if($outline, outline, border);
81
+ // This mixin needs a value-map to work, so convert argument if it is not a value-map;
82
+ @if not(is-value-map($values, $keys-border)) {
83
+ $values: value-map($values, $keys-border);
84
+ }
82
85
 
83
- // Rem fallback
84
- $width: map-get($values, width);
85
- @if type-of($width)==number and unit($width)==rem {
86
- #{$property}-width: to-px($width);
87
- }
86
+ $property: if($outline, outline, border);
88
87
 
89
- @if map-has-key($values, width) and map-has-key($values, style) and map-has-key($values, color) {
90
- #{$property}: map-get($values, width) map-get($values, style) map-get($values, color);
91
- }
92
- @else {
93
- @each $key, $value in $values {
94
- #{$property}-#{$key}: $value;
95
- }
96
- }
88
+ // Rem fallback
89
+ $width: map-get($values, width);
90
+ @if type-of($width) == number and unit($width) == rem {
91
+ #{$property}-width: to-px($width);
92
+ }
97
93
 
94
+ @if map-has-key($values, width) and map-has-key($values, style) and map-has-key($values, color) {
95
+ #{$property}: map-get($values, width) map-get($values, style) map-get($values, color);
96
+ }
97
+ @else {
98
+ @each $key, $value in $values {
99
+ // styleguide:ignore:start
100
+ #{$property}-#{$key}: $value;
101
+ // styleguide:ignore:end
102
+ }
103
+ }
98
104
  }
99
105
 
100
106
  ///
101
107
  /// @alias border
102
108
  ///
103
109
 
104
- @mixin outline($attributes)
105
- {
106
- @include border($attributes, true);
110
+ @mixin outline($attributes) {
111
+ @include border($attributes, true);
107
112
  }
108
113
 
109
114
 
110
115
  ///
111
116
  /// Provides a cross-browser method to implement opacity. This replaces [Compass's](http://compass-style.org/reference/compass/css3/opacity/) mixin by the same name with a more accessible implementation.
112
- ///
117
+ ///
113
118
  /// @since 0.1
114
119
  ///
115
120
  /// @param {Number} $opacity - A number between 0 and 1, where 0 is transparent and 1 is opaque.
116
121
  ///
117
122
 
118
123
  @mixin opacity($opacity) {
119
- @include old-ie() {
120
- filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})");
121
- }
122
- opacity: $opacity;
124
+ @include old-ie() {
125
+ filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})");
126
+ }
127
+ opacity: $opacity;
123
128
  }
124
129
 
125
130
 
126
131
  ///
127
132
  /// Conditional mixin of property
128
- ///
133
+ ///
129
134
  /// @since 0.1
130
135
  /// @deprecated
131
136
  ///
@@ -133,16 +138,15 @@
133
138
  /// @param {Bool | *} $value - A value for the property, or false if the property should not be rendered.
134
139
  ///
135
140
 
136
- @mixin property($property, $value)
137
- {
138
- @if to-bool($value) {
139
- $property: $value;
140
- }
141
+ @mixin property($property, $value) {
142
+ @if to-bool($value) {
143
+ $property: $value;
144
+ }
141
145
  }
142
146
 
143
147
  ///
144
- /// Support for old-mozilla, use it to separate old-ie declarations from your other declarations with either a separate stylesheet or added specificity (Modernizr).
145
- ///
148
+ /// Support for old-ie, use it to separate old-ie declarations from your other declarations with either a separate stylesheet or added specificity (Modernizr).
149
+ ///
146
150
  /// @since 0.1
147
151
  ///
148
152
  /// @example
@@ -150,15 +154,15 @@
150
154
  ///
151
155
 
152
156
  @mixin old-ie() {
153
- @if $legacy-support-for-ie {
154
- @content;
155
- }
157
+ @if $legacy-support-for-ie {
158
+ @content;
159
+ }
156
160
  }
157
161
 
158
162
 
159
163
  ///
160
- /// Support for old-mozilla, use it to separate old-mozilla declarations from your other declarations with either a separate stylesheet or added specificity (Modernizr).
161
- ///
164
+ /// Support for old-mozilla, use it to separate old-mozilla declarations from your other declarations with either a separate stylesheet or added specificity (Modernizr).
165
+ ///
162
166
  /// @since 0.1
163
167
  ///
164
168
  /// @example
@@ -166,80 +170,138 @@
166
170
  ///
167
171
 
168
172
  @mixin old-mozilla() {
169
- @if $legacy-support-for-mozilla {
170
- @content;
171
- }
173
+ @if $legacy-support-for-mozilla {
174
+ @content;
175
+ }
172
176
  }
173
177
 
174
178
 
175
179
  ///
176
180
  /// Provides a cross-browser method to implement display: inline-block;. This replaces [Compass's](http://compass-style.org/reference/compass/css3/inline_block/) mixin by the same name with a more accessible implementation.
177
181
  /// See for valid property values: [http://www.w3schools.com/cssref/pr_pos_vertical-align.asp](http://www.w3schools.com/cssref/pr_pos_vertical-align.asp)
178
- ///
182
+ ///
179
183
  /// @since 0.1
180
184
  ///
181
185
  /// @example
182
- /// @include inline-block(baseline);
186
+ /// @include inline-block(baseline);
183
187
  ///
184
188
  /// @param {String} $vertical-alignment (baseline) - Set $inline-block-alignment to none or false to disable the output of a vertical-align property in the inline-block mixin. Or set it to a legal value for vertical-align to change the default.
185
189
  ///
186
190
 
187
191
  @mixin inline-block($vertical-alignment: baseline) {
188
- $vertical-alignment: unquote($vertical-alignment);
192
+ $vertical-alignment: unquote($vertical-alignment);
189
193
 
190
- @include old-mozilla() {
191
- display: -moz-inline-stack;
192
- }
194
+ @include old-mozilla() {
195
+ display: -moz-inline-stack;
196
+ }
193
197
 
194
- display: inline-block;
195
- @if to-bool($vertical-alignment) {
196
- vertical-align: #{$vertical-alignment};
197
- }
198
+ display: inline-block;
199
+ @if to-bool($vertical-alignment) {
200
+ vertical-align: #{$vertical-alignment};
201
+ }
198
202
 
199
- @include old-ie() {
200
- zoom: 1;
201
- display: inline;
202
- vertical-align: #{$vertical-alignment};
203
- }
203
+ @include old-ie() {
204
+ zoom: 1;
205
+ display: inline;
206
+ vertical-align: #{$vertical-alignment};
207
+ }
204
208
  }
205
209
 
206
210
 
207
211
  ///
208
- /// Accepts a string which a valid appearance
212
+ /// Accepts a string with a valid appearance
209
213
  ///
210
214
  /// @since 0.1
211
215
  ///
212
216
  /// @param {String} $appearance
213
217
  ///
214
218
 
215
- @mixin reset-appearance($appearance)
216
- {
217
- @include -reset-webkit-appearance($appearance);
218
- @include -reset-mozilla-appearance($appearance);
219
+ @mixin reset-appearance($appearance) {
220
+ appearance: $appearance;
219
221
  }
220
222
 
221
- ///
222
- /// Accepts a string which a valid appearance
223
- ///
224
- /// @since 0.1
225
- ///
226
- /// @param {String} $appearance
227
- ///
228
-
229
- @mixin -reset-webkit-appearance($appearance)
230
- {
231
- -webkit-appearance: $appearance;
223
+
224
+ ///
225
+ /// Mixin to clear floats
226
+ ///
227
+ /// @since 1.0
228
+ ///
229
+
230
+ @mixin clearfix {
231
+ @include pseudo-element("before""after") {
232
+ content: " ";
233
+ display: table;
234
+ }
235
+ @include pseudo-element("after") {
236
+ clear: both;
237
+ }
238
+ /**
239
+ * For IE 6/7 only
240
+ */
241
+ // scss-lint:disable UnnecessaryParentReference PropertySpelling PseudoElement
242
+ @include old-ie() {
243
+ & {
244
+ // styleguide:ignore:start
245
+ *zoom: 1;
246
+ // styleguide:ignore:end
232
247
  }
248
+ }
249
+ // scss-lint:enable UnnecessaryParentReference PropertySpelling PseudoElement
250
+ }
251
+
252
+
253
+ ///
254
+ /// Accessible hide mixin
255
+ ///
256
+ /// @since 1.0
257
+ ///
258
+
259
+ @mixin hide() {
260
+ position: absolute;
261
+ left: -9999em;
262
+ }
233
263
 
234
- ///
235
- /// Accepts a string which a valid appearance
236
- ///
237
- /// @since 0.1
238
- ///
239
- /// @param {String} $appearance
240
- ///
241
-
242
- @mixin -reset-mozilla-appearance($appearance)
243
- {
244
- -moz-appearance: $appearance;
264
+
265
+ ///
266
+ /// Old IE does not process the double colon standard for pseudo-elements.
267
+ /// This mixin adds a single-colon fallback when ``$legacy-support-for-ie` is true.
268
+ ///
269
+ /// @since 1.0
270
+ ///
271
+ /// @todo Check if selector is a valid placement and handle accordingly
272
+ ///
273
+ /// @param {String} $selector (&) - The selector to append the pseudo-element to
274
+ /// @param {List | String} $placement (before) - The pseudo-element(s)
275
+ ///
276
+ /// @return {Bool}
277
+ ///
278
+
279
+ @mixin pseudo-element($placements: "before", $selectors: "&") {
280
+
281
+ $_placements: ("before", "after", "first-line", "first-letter");
282
+
283
+ // Create the selector
284
+ $_selectors: ();
285
+ @each $selector in $selectors {
286
+ @each $placement in $placements {
287
+ $_selectors: append($_selectors, "#{$selector}::#{$placement}");
288
+ }
289
+ }
290
+ #{implode($_selectors, ", ")} {
291
+ @content;
292
+ }
293
+ @include old-ie() {
294
+ // Create the selector
295
+ $_selectors: ();
296
+ @each $selector in $selectors {
297
+ @each $placement in $placements {
298
+ $_selectors: append($_selectors, "#{$selector}:#{$placement}");
299
+ }
300
+ }
301
+ // scss-lint:disable PseudoElement
302
+ #{implode($_selectors, ", ")} {
303
+ @content;
245
304
  }
305
+ // scss-lint:enable PseudoElement
306
+ }
307
+ }
@@ -12,13 +12,13 @@
12
12
  // hrhythm
13
13
  // 2c. Miscellaneaous;
14
14
  // debug-rhythm
15
-
15
+
16
16
 
17
17
  // 1. Functions
18
18
 
19
19
  ///
20
20
  /// Calculates a value based on the [$rhythm](./#variable-rhythm).
21
- ///
21
+ ///
22
22
  /// @since 0.1
23
23
  /// @access private
24
24
  ///
@@ -27,58 +27,25 @@
27
27
  /// @return {Number} - The calculated span in px
28
28
  ///
29
29
 
30
- @function -rhythm-units($units: 1)
31
- {
32
- @return abs($rhythm * $units);
30
+ @function -rhythm-units($units: 1) {
31
+ @return $rhythm * $units;
33
32
  }
34
33
 
35
-
36
34
  ///
37
35
  /// Find the optimal rhythm units for a given size in px.
38
- /// If the specified span is too small for the size, find the next best one
36
+ /// If the specified span is too small for the size, find the next best one
39
37
  /// based on a specified increment.
40
38
  ///
41
39
  /// @since 0.1
42
- ///
40
+ ///
43
41
  /// @param {Number} $units - The number of rhythm units to span (whole or fraction), 1 equals 1 $rhythm
44
- /// @param {Number} $size-px - The size in px
45
- /// @param {Number} $increment - The increment in rhythm-units (whole or fraction)
46
42
  ///
47
- /// @return {Number} - The calculated span in px
43
+ /// @return {Number} - The calculated rhythm in px
48
44
  ///
49
45
 
50
- @function rhythm($args...)
51
- {
52
- $units: false;
53
- $size-px: false;
54
- $increment: false;
55
-
56
- @each $var in $args {
57
- @if unitless($var) and not($units) {
58
- $units: $var;
59
- } @elseif unitless($var) and not($increment) {
60
- $increment: $var;
61
- } @elseif not(unitless($var)) and unit($var)==px {
62
- $size-px: $var;
63
- }
64
- }
65
-
66
- @if not($units) {
67
- $units: 1;
68
- }
69
- @if not($increment) {
70
- $increment: 1;
71
- }
72
-
73
- @if $size-px {
74
- @while $size-px >= -rhythm-units($units) {
75
- $units: $units + $increment;
76
- }
77
- }
78
-
79
- $span: -rhythm-units($units);
80
-
81
- @return $span;
46
+ @function rhythm($units: 1) {
47
+ // @todo error handling
48
+ @return -rhythm-units($units);
82
49
  }
83
50
 
84
51
 
@@ -89,7 +56,7 @@
89
56
  ///
90
57
  /// @example
91
58
  /// @include rhythm(1, padding-left);
92
- ///
59
+ ///
93
60
  /// @since 0.1
94
61
  ///
95
62
  /// @param {Number} $units - The fraction of the gutter measurement
@@ -97,8 +64,7 @@
97
64
  /// @param {Number} $context (16px) - The font-size context
98
65
  ///
99
66
 
100
- @mixin rhythm($units, $property, $context: $default-font-size)
101
- {
67
+ @mixin rhythm($units, $property, $context: $font-size) {
102
68
  // @if strip-unit($units)==0 {
103
69
  // #{$property}: 0;
104
70
  // }
@@ -117,20 +83,22 @@
117
83
  /// @param {Number} $rhythm - The rhythm height
118
84
  ///
119
85
 
120
- @mixin debug-rhythm($rhythm: $rhythm)
121
- {
122
- $to: transparent;
123
- $from: rgba(226, 255, 255, .5);
86
+ // scss-lint:disable ImportantRule DuplicateProperty
87
+ @mixin debug-rhythm($rhythm: $rhythm) {
88
+ $to: transparent;
89
+ $from: rgba($lightcyan, .5);
124
90
 
125
- background-image: -webkit-linear-gradient($from 50%, $to 50%);
126
- background-image: linear-gradient($from 50%, $to 50%);
127
- background-size: 2*$rhythm 2*$rhythm;
91
+ background-image: linear-gradient($from 50%, $to 50%);
92
+ background-size: (2 * $rhythm) (2 * $rhythm);
128
93
 
129
- * {
130
- background-color: transparent !important;
131
- background-image: none !important;
132
- outline: rgba(255,0,255,.1) dotted 1px;
133
- outline: #D6D6D6 dotted 1px;
134
- outline: lighten(rgb(255,0,255),.1) dotted 1px \9;
94
+ * {
95
+ background-image: none !important;
96
+ background-color: transparent !important;
97
+ outline: rgba($fuchsia, .1) dotted 1px;
98
+ outline: $lightgray dotted 1px;
99
+ @include old-ie {
100
+ outline: lighten($fuchsia, .1) dotted 1px \9;
135
101
  }
102
+ }
136
103
  }
104
+ // scss-lint:enable ImportantRule DuplicateProperty