piecss 0.1.0.alpha.01

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.
Files changed (63) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +7 -0
  3. data/lib/piecss.rb +6 -0
  4. data/sass/piecss/behavior.scss +11 -0
  5. data/sass/piecss/behavior/anchor.scss +30 -0
  6. data/sass/piecss/behavior/base.scss +4 -0
  7. data/sass/piecss/behavior/base/normalize.scss +458 -0
  8. data/sass/piecss/behavior/base/preset.scss +57 -0
  9. data/sass/piecss/behavior/form.scss +120 -0
  10. data/sass/piecss/behavior/grid.scss +4 -0
  11. data/sass/piecss/behavior/grid/layout.scss +170 -0
  12. data/sass/piecss/behavior/grid/rhythm.scss +54 -0
  13. data/sass/piecss/behavior/list.scss +189 -0
  14. data/sass/piecss/settings.scss +18 -0
  15. data/sass/piecss/settings/base.scss +177 -0
  16. data/sass/piecss/settings/breakpoint.scss +32 -0
  17. data/sass/piecss/settings/constants.scss +147 -0
  18. data/sass/piecss/settings/fonts.scss +31 -0
  19. data/sass/piecss/settings/fonts/_asap.scss +44 -0
  20. data/sass/piecss/settings/fonts/_bree-serif.scss +23 -0
  21. data/sass/piecss/settings/fonts/_example.scss +43 -0
  22. data/sass/piecss/settings/fonts/_lato.scss +32 -0
  23. data/sass/piecss/settings/fonts/_monospace.scss +39 -0
  24. data/sass/piecss/settings/fonts/_pt-sans.scss +40 -0
  25. data/sass/piecss/settings/fonts/_raleway.scss +31 -0
  26. data/sass/piecss/settings/fonts/_righteous.scss +23 -0
  27. data/sass/piecss/settings/fonts/_roboto.scss +34 -0
  28. data/sass/piecss/settings/fonts/_sans-serif.scss +39 -0
  29. data/sass/piecss/settings/fonts/_serif.scss +39 -0
  30. data/sass/piecss/settings/fonts/_sofia-pro.scss +40 -0
  31. data/sass/piecss/settings/fonts/_varela-round.scss +24 -0
  32. data/sass/piecss/settings/fonts/_verdana.scss +40 -0
  33. data/sass/piecss/settings/fonts/icon-fonts/_fontawesome.scss +33 -0
  34. data/sass/piecss/settings/fonts/icon-fonts/_foundation-accessability.scss +75 -0
  35. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_bootstrap.scss +84 -0
  36. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_core.scss +129 -0
  37. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_extras.scss +93 -0
  38. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_icons.scss +381 -0
  39. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_mixins.scss +48 -0
  40. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_path.scss +14 -0
  41. data/sass/piecss/settings/fonts/icon-fonts/fontawesome/_variables.scss +734 -0
  42. data/sass/piecss/settings/fonts/icon-fonts/foundation-accessability/_settings.scss +28 -0
  43. data/sass/piecss/settings/form.scss +664 -0
  44. data/sass/piecss/settings/grid.scss +157 -0
  45. data/sass/piecss/settings/list.scss +216 -0
  46. data/sass/piecss/utilities.scss +16 -0
  47. data/sass/piecss/utilities/README.md +105 -0
  48. data/sass/piecss/utilities/breakpoint.scss +46 -0
  49. data/sass/piecss/utilities/cache.scss +74 -0
  50. data/sass/piecss/utilities/elements.scss +182 -0
  51. data/sass/piecss/utilities/image.scss +58 -0
  52. data/sass/piecss/utilities/layout.scss +367 -0
  53. data/sass/piecss/utilities/list.scss +26 -0
  54. data/sass/piecss/utilities/miscellaneous.scss +260 -0
  55. data/sass/piecss/utilities/rhythm.scss +173 -0
  56. data/sass/piecss/utilities/sides.scss +376 -0
  57. data/sass/piecss/utilities/typography.scss +295 -0
  58. data/sass/piecss/utilities/units.scss +166 -0
  59. data/templates/project/_settings.scss +24 -0
  60. data/templates/project/examples.html +224 -0
  61. data/templates/project/manifest.rb +13 -0
  62. data/templates/project/screen.scss +96 -0
  63. metadata +133 -0
@@ -0,0 +1,26 @@
1
+ // Copyright (C) 2014 Babs Gösgens. Licensed under MIT; see LICENSE.txt
2
+
3
+
4
+ // Content:
5
+ // 1. Mixins
6
+ // list-style-type
7
+
8
+
9
+ // 1. Mixins
10
+
11
+
12
+ /**
13
+ * Mixin a list-style-type
14
+ * @example scss
15
+ * @include list-style-type(bullet);
16
+ *
17
+ * @since 0.1
18
+ *
19
+ * @param {String} $type
20
+ */
21
+
22
+ @mixin list-style-type($type) {
23
+ %#{$list-selector}--#{$type} {
24
+ list-style-type: $type;
25
+ }
26
+ }
@@ -0,0 +1,260 @@
1
+ // Copyright (C) 2014 Babs Gösgens. Licensed under MIT; see LICENSE.txt
2
+
3
+
4
+ // Content:
5
+ // 1. Functions
6
+ // to-bool
7
+ // 2. Mixins
8
+ // property
9
+ // border
10
+ // outline
11
+ // old-ie
12
+ // old-mozilla
13
+ // inline-block
14
+
15
+
16
+ // 1. Functions
17
+
18
+
19
+ /**
20
+ * Converts a value to a proper boolean value
21
+ *
22
+ * @since 0.1
23
+ *
24
+ * @param {*} $value
25
+ *
26
+ * @return {Bool}
27
+ */
28
+
29
+ @function to-bool($value) {
30
+ @if not $value or $value == "" or $value == 0 {
31
+ @return false;
32
+ }
33
+ @return true;
34
+ }
35
+
36
+ /**
37
+ * Converts a list of property values to a property map. Use to convert 'old-style' associative arrays to SASS's new Map type.
38
+ *
39
+ * @example
40
+ * @include list-to-map(color #FFF, text-align left)
41
+ * // Output:
42
+ * (color: #FFF, text-align: left)
43
+ *
44
+ * @since 0.1
45
+ *
46
+ * @param {List} $properties
47
+ *
48
+ * @return {Map}
49
+ */
50
+
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
+ }
57
+
58
+ @return $map;
59
+ }
60
+
61
+
62
+ // 2. Mixins
63
+
64
+
65
+ /**
66
+ * Conditional mixin of property
67
+ *
68
+ * @since 0.1
69
+ * @deprecated
70
+ *
71
+ * @param {String} $property - A CSS property
72
+ * @param {Bool | *} $value - A value for the property, or false if the property should not be rendered.
73
+ */
74
+
75
+ @mixin property($property, $value)
76
+ {
77
+ @if to-bool($value) {
78
+ #{$property}: $value;
79
+ }
80
+ }
81
+
82
+ /**
83
+ *
84
+ * @alias border
85
+ * Mixin for outline properties.
86
+ */
87
+
88
+ @mixin outline($attributes)
89
+ {
90
+ @include border($attributes, true);
91
+ }
92
+
93
+ /**
94
+ * Mixin for border properties
95
+ *
96
+ * @since 0.1
97
+ *
98
+ * @todo Provide examples
99
+ *
100
+ * @param {String | Map | List | Numner} $values - The border (or outline) properties
101
+ * @param {Bool} $outline - If true, will render the values as outline properties
102
+ */
103
+
104
+ @mixin border($values, $outline: false)
105
+ {
106
+ $property: if($outline, outline, border);
107
+
108
+ @if type-of($values)=="list" {
109
+ $map: ();
110
+ @each $value in $values {
111
+ @if type-of($value)==number {
112
+ $map: append($map, width, space);
113
+ }
114
+ @else if type-of($value)==color {
115
+ $map: append($map, color, space);
116
+ }
117
+ @elseif type-of($value)==string {
118
+ $map: append($map, style, space);
119
+ }
120
+ }
121
+ @include border( list-to-map( zip($map, $values) ), $outline);
122
+ }
123
+ @elseif type-of($values)=="string" {
124
+ #{$property}: $values;
125
+ }
126
+ @elseif type-of($values)=="map" {
127
+
128
+ @if map-has-key($values, width) and map-has-key($values, style) and map-has-key($values, color) {
129
+ #{$property}: map-get($values, width) map-get($values, style) map-get($values, color);
130
+ }
131
+ @else {
132
+ $keys: map-keys($values);
133
+ @each $key in $keys {
134
+ #{$property}-#{$key}: map-get($values, $key);
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+
141
+ /**
142
+ * Support for old-mozilla, cuse it to separate old-ie declarations from your other declarations with either a separate stylesheet or added specificity (Modernizr).
143
+ *
144
+ * @since 0.1
145
+ *
146
+ * @example
147
+ * @include old-ie() { // properties }
148
+ */
149
+
150
+ @mixin old-ie() {
151
+ @if $legacy-support-for-ie {
152
+ @content;
153
+ }
154
+ }
155
+
156
+
157
+ /**
158
+ * Support for old-mozilla, cuse it to separate old-mozilla declarations from your other declarations with either a separate stylesheet or added specificity (Modernizr).
159
+ *
160
+ * @since 0.1
161
+ *
162
+ * @example
163
+ * @include old-mozilla() { // properties }
164
+ */
165
+
166
+ @mixin old-mozilla() {
167
+ @if $legacy-support-for-mozilla {
168
+ @content;
169
+ }
170
+ }
171
+
172
+
173
+ /**
174
+ * 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.
175
+ * 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)
176
+ *
177
+ * @since 0.1
178
+ *
179
+ * @example
180
+ * @include inline-block(baseline);
181
+ *
182
+ * @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.
183
+ */
184
+
185
+ @mixin inline-block($vertical-alignment: baseline) {
186
+ $vertical-alignment: unquote($vertical-alignment);
187
+
188
+ @include old-mozilla() {
189
+ display: -moz-inline-stack;
190
+ }
191
+
192
+ display: inline-block;
193
+ @if to-bool($vertical-alignment) {
194
+ vertical-align: #{$vertical-alignment};
195
+ }
196
+
197
+ @include old-ie() {
198
+ zoom: 1;
199
+ display: inline;
200
+ vertical-align: #{$vertical-alignment};
201
+ }
202
+ }
203
+ /**
204
+ * 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.
205
+ *
206
+ * @since 0.1
207
+ *
208
+ * @param {Number} $opacity - A number between 0 and 1, where 0 is transparent and 1 is opaque.
209
+ */
210
+
211
+ @mixin opacity($opacity) {
212
+ @include old-ie() {
213
+ filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})");
214
+ }
215
+ opacity: $opacity;
216
+ }
217
+
218
+ /**
219
+ * Accepts a string which a valid appearance
220
+ *
221
+ * @since 0.1
222
+ *
223
+ * @param {String} $appearance
224
+ */
225
+
226
+ @mixin reset-appearance($appearance)
227
+ {
228
+ @include reset-webkit-appearance($appearance);
229
+ @include reset-mozilla-appearance($appearance);
230
+ }
231
+
232
+
233
+
234
+
235
+ /**
236
+ * Accepts a string which a valid appearance
237
+ *
238
+ * @since 0.1
239
+ *
240
+ * @param {String} $appearance
241
+ */
242
+
243
+ @mixin reset-webkit-appearance($appearance)
244
+ {
245
+ -webkit-appearance: $appearance; /* mobile firefox too! */
246
+ }
247
+
248
+
249
+ /**
250
+ * Accepts a string which a valid appearance
251
+ *
252
+ * @since 0.1
253
+ *
254
+ * @param {String} $appearance
255
+ */
256
+
257
+ @mixin reset-mozilla-appearance($appearance)
258
+ {
259
+ -moz-appearance: $appearance; /* mobile firefox too! */
260
+ }
@@ -0,0 +1,173 @@
1
+ // Copyright (C) 2014 Babs Gösgens. Licensed under MIT; see LICENSE.txt
2
+
3
+
4
+ // Content:
5
+ // 1. Functions
6
+ // 1a. Vertical Rhythm:
7
+ // vrhythm
8
+ // vrhythm-units
9
+ // 1b. Horizontal Rhythm
10
+ // hrhythm
11
+ // vrhythm-units
12
+ // 2. Mixins
13
+ // 2a. Vertical Rhythm:
14
+ // vrhythm
15
+ // 2b. Horizontal Rhythm:
16
+ // hrhythm
17
+ // 2c. Miscellaneaous;
18
+ // debug-rhythm
19
+
20
+
21
+ // 1. Functions
22
+
23
+ /**
24
+ * Calculates a value based on the [$rhythm](./#variable-rhythm).
25
+ *
26
+ * @since 0.1
27
+ *
28
+ * @param {Int | Fraction} $span (1) - The number of rhythm-units (whole or fraction) to span
29
+ *
30
+ * @return {Number} - The calculated span in px
31
+ */
32
+
33
+ @function vrhythm($span: 1)
34
+ {
35
+ @return $rhythm * $span;
36
+ }
37
+
38
+
39
+ /**
40
+ * Find the optimal rhythm units for a given font-size.
41
+ * If the specified span is too small for the font-size, find the next best one
42
+ * based on a specified increment.
43
+ *
44
+ * @since 0.1
45
+ *
46
+ * @param {Number} $font-size (16px) - The font-size in px
47
+ * @param {Number} (1) $span - The number of rhythm units to span, 1 equals 1 $rhythm
48
+ * @param {Number} (1) $increment - The increment in rhythm-units
49
+ *
50
+ * @return {Number} - The calculated span in px
51
+ */
52
+
53
+ @function vrhythm-units($font-size: $default-font-size, $span: 1, $increment: 1)
54
+ {
55
+ $line-height: $span * $rhythm;
56
+
57
+ @if $font-size >= $line-height {
58
+ // call line-height again, but increase span with increment
59
+ @return vrhythm-units($font-size, $span + $increment, $increment);
60
+ }
61
+
62
+ @return $span;
63
+ }
64
+
65
+
66
+ /**
67
+ * Calculates a value based on the [$gutter-width](./#variable-gutter-width) as declared in the Layout settings
68
+ *
69
+ * @example
70
+ * padding: hrhythm(.5);
71
+ * padding: to-unit( hrhythm(.5) );
72
+ * // Output:
73
+ * padding: 8px;
74
+ * padding: .5em;
75
+ *
76
+ * @since 0.1
77
+ *
78
+ * @param {Number} $fraction (1/2) - A fraction, e.g. 1/2
79
+ * @param {Value} $context (16px) - The font-size context, defaults to [$default-font-size](./#variable-default-font-size).
80
+ *
81
+ * @return {Number} - The calculated span in px
82
+ */
83
+
84
+ @function hrhythm($fraction: 1/2, $context: $default-font-size)
85
+ {
86
+ // Cannot multiply with 0
87
+ @if $fraction == 0 {
88
+ @return $fraction;
89
+ }
90
+
91
+ @return $fraction * $gutter-width;
92
+ }
93
+
94
+
95
+ // 2. MIXINS
96
+
97
+
98
+ /**
99
+ * Use for top and bottom margins and paddings.
100
+ *
101
+ * @example
102
+ * @include vrhythm(1, padding-top);
103
+ *
104
+ * @since 0.1
105
+ *
106
+ * @param {Number} $span - The number of rhythm-units - whole or fraction - to span
107
+ * @param {String} $property - The property to be set, e.g. padding, margin-top
108
+ * @param {Value} $context (16px) - The font-size context
109
+ */
110
+
111
+ @mixin vrhythm($span, $property, $context: $default-font-size)
112
+ {
113
+ @if strip-unit($span)==0 {
114
+ #{$property}: 0;
115
+ }
116
+ @else {
117
+ @if unit($unit)==rem {
118
+ #{$property}: $span*$default-line-height;
119
+ }
120
+ #{$property}: vrhythm($span);
121
+ }
122
+
123
+ }
124
+
125
+
126
+ /**
127
+ * Use for left and right margins and paddings. Uses [$gutter-width](./#variable-gutter-width) declared in grid settings
128
+ *
129
+ * @example
130
+ * @include hrhythm(1, padding-left);
131
+ *
132
+ * @since 0.1
133
+ *
134
+ * @param {Number} $fraction - The fraction of the gutter measurement
135
+ * @param {String} $property - The property to be set, e.g. padding, margin-left
136
+ * @param {Number} $context (16px) - The font-size context
137
+ */
138
+
139
+ @mixin hrhythm($fraction, $property, $context: $default-font-size)
140
+ {
141
+ @if strip-unit($span)==0 {
142
+ #{$property}: 0;
143
+ }
144
+ @if unit($unit)==rem {
145
+ #{$property}: $fraction*$gutter-width;
146
+ }
147
+ #{$property}: hrhythm($fraction, $context);
148
+ }
149
+
150
+
151
+ /**
152
+ * Reveals the document's vertical rhythm. Will automatically be mixed in when [$debug-rhythm](./#variable-debug-rhythm) is set to true.
153
+ *
154
+ * @since 0.1
155
+ */
156
+
157
+ @mixin debug-rhythm()
158
+ {
159
+ $to: transparent;
160
+ $from: rgba(226, 255, 255, .5);
161
+
162
+ background-image: -webkit-linear-gradient($from 50%, $to 50%);
163
+ background-image: linear-gradient($from 50%, $to 50%);
164
+ background-size: 2*$default-line-height 2*$default-line-height;
165
+
166
+ * {
167
+ background-color: transparent !important;
168
+ background-image: none !important;
169
+ outline: rgba(255,0,255,.1) dotted 1px;
170
+ outline: #D6D6D6 dotted 1px;
171
+ outline: lighten(rgb(255,0,255),.1) dotted 1px \9;
172
+ }
173
+ }