piecss 0.5.0 → 0.6.0

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/sass/piecss/_behavior.css +432 -1
  3. data/sass/piecss/_behavior.css.map +2 -2
  4. data/sass/piecss/_behavior.scss +10 -0
  5. data/sass/piecss/_utilities.scss +1 -1
  6. data/sass/piecss/behavior/base/_base.scss +3 -568
  7. data/sass/piecss/behavior/base/_collection.scss +861 -0
  8. data/sass/piecss/behavior/base/_settings.scss +38 -367
  9. data/sass/piecss/behavior/button/_button.scss +1 -1
  10. data/sass/piecss/behavior/form/_form.scss +1 -1
  11. data/sass/piecss/settings/_breakpoint.css +70 -0
  12. data/sass/piecss/settings/_colour.css +2 -0
  13. data/sass/piecss/settings/_colour.css.map +7 -0
  14. data/sass/piecss/settings/_colour.scss +2 -4
  15. data/sass/piecss/settings/_constants.css +2 -0
  16. data/sass/piecss/settings/_constants.css.map +7 -0
  17. data/sass/piecss/settings/_fallback.css +2 -0
  18. data/sass/piecss/settings/_fallback.css.map +7 -0
  19. data/sass/piecss/settings/_font.css +2 -0
  20. data/sass/piecss/settings/_font.css.map +7 -0
  21. data/sass/piecss/settings/_layout.css +60 -0
  22. data/sass/piecss/settings/_miscellaneous.css +2 -0
  23. data/sass/piecss/settings/_miscellaneous.css.map +7 -0
  24. data/sass/piecss/settings/_rhythm.css +2 -0
  25. data/sass/piecss/settings/_rhythm.css.map +7 -0
  26. data/sass/piecss/settings/_typography.css +2 -0
  27. data/sass/piecss/settings/_typography.css.map +7 -0
  28. data/sass/piecss/settings/_unit.css +2 -0
  29. data/sass/piecss/settings/_unit.css.map +7 -0
  30. data/sass/piecss/settings/_unit.scss +1 -1
  31. data/sass/piecss/utilities/_breakpoint.css +2 -0
  32. data/sass/piecss/utilities/_breakpoint.css.map +7 -0
  33. data/sass/piecss/utilities/_cache.css +2 -0
  34. data/sass/piecss/utilities/_cache.css.map +7 -0
  35. data/sass/piecss/utilities/_collection.scss +192 -0
  36. data/sass/piecss/utilities/_colour.css +2 -0
  37. data/sass/piecss/utilities/_colour.css.map +7 -0
  38. data/sass/piecss/utilities/_element.css +2 -0
  39. data/sass/piecss/utilities/_element.css.map +7 -0
  40. data/sass/piecss/utilities/_image.css +2 -0
  41. data/sass/piecss/utilities/_image.css.map +7 -0
  42. data/sass/piecss/utilities/_layout.css +2 -0
  43. data/sass/piecss/utilities/_layout.css.map +7 -0
  44. data/sass/piecss/utilities/_list.css +2 -0
  45. data/sass/piecss/utilities/_list.css.map +7 -0
  46. data/sass/piecss/utilities/_miscellaneous.css +2 -0
  47. data/sass/piecss/utilities/_miscellaneous.css.map +7 -0
  48. data/sass/piecss/utilities/_rhythm.css +2 -0
  49. data/sass/piecss/utilities/_rhythm.css.map +7 -0
  50. data/sass/piecss/utilities/_side.css +2 -0
  51. data/sass/piecss/utilities/_side.css.map +7 -0
  52. data/sass/piecss/utilities/_string.css +2 -0
  53. data/sass/piecss/utilities/_string.css.map +7 -0
  54. data/sass/piecss/utilities/_svg.css +2 -0
  55. data/sass/piecss/utilities/_svg.css.map +7 -0
  56. data/sass/piecss/utilities/_typography.css +2 -0
  57. data/sass/piecss/utilities/_typography.css.map +7 -0
  58. data/sass/piecss/utilities/_typography.scss +16 -16
  59. data/sass/piecss/utilities/_unit.css +2 -0
  60. data/sass/piecss/utilities/_unit.css.map +7 -0
  61. data/sass/piecss/utilities/_unit.scss +10 -7
  62. data/templates/project/examples.html +370 -218
  63. metadata +49 -3
  64. data/sass/piecss/behavior/base/_normalize.scss +0 -463
  65. data/sass/piecss/utilities/_element.scss +0 -180
@@ -0,0 +1,60 @@
1
+ /*
2
+ Error: Undefined variable: "$default-line-height".
3
+ on line 57 of sass/piecss/settings/_layout.scss
4
+
5
+ 52: // /// @since 0.1
6
+ 53: // ///
7
+ 54: // /// @type {Number}
8
+ 55: // ///
9
+ 56:
10
+ 57: $gutter-width: $default-line-height !default;
11
+ 58:
12
+ 59: ///
13
+ 60: /// The final unit of output in which gutter widths are rendered
14
+ 61: ///
15
+ 62: /// @since 0.1
16
+
17
+ Backtrace:
18
+ sass/piecss/settings/_layout.scss:57
19
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/script/tree/variable.rb:49:in `_perform'
20
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/script/tree/node.rb:58:in `perform'
21
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/perform.rb:471:in `visit_variable'
22
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/base.rb:36:in `visit'
23
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/perform.rb:160:in `block in visit'
24
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/stack.rb:79:in `block in with_base'
25
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/stack.rb:115:in `with_frame'
26
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/stack.rb:79:in `with_base'
27
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/perform.rb:160:in `visit'
28
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
29
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/base.rb:52:in `map'
30
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/base.rb:52:in `visit_children'
31
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/perform.rb:169:in `block in visit_children'
32
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/perform.rb:181:in `with_environment'
33
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/perform.rb:168:in `visit_children'
34
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/base.rb:36:in `block in visit'
35
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/perform.rb:188:in `visit_root'
36
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/base.rb:36:in `visit'
37
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/perform.rb:159:in `visit'
38
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/visitors/perform.rb:8:in `visit'
39
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/root_node.rb:36:in `css_tree'
40
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/tree/root_node.rb:29:in `render_with_sourcemap'
41
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/engine.rb:381:in `_render_with_sourcemap'
42
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/engine.rb:298:in `render_with_sourcemap'
43
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:492:in `update_stylesheet'
44
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:215:in `block in update_stylesheets'
45
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:209:in `each'
46
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:209:in `update_stylesheets'
47
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin/compiler.rb:294:in `watch'
48
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/plugin.rb:109:in `method_missing'
49
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/exec/sass_scss.rb:360:in `watch_or_update'
50
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/exec/sass_scss.rb:51:in `process_result'
51
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/exec/base.rb:52:in `parse'
52
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/lib/sass/exec/base.rb:19:in `parse!'
53
+ /Library/Ruby/Gems/2.0.0/gems/sass-3.4.23/bin/sass:13:in `<top (required)>'
54
+ /usr/local/bin/sass:23:in `load'
55
+ /usr/local/bin/sass:23:in `<main>'
56
+ */
57
+ body:before {
58
+ white-space: pre;
59
+ font-family: monospace;
60
+ content: "Error: Undefined variable: \"$default-line-height\".\A on line 57 of sass/piecss/settings/_layout.scss\A \A 52: // /// @since 0.1\A 53: // ///\A 54: // /// @type {Number}\A 55: // ///\A 56: \A 57: $gutter-width: $default-line-height !default;\A 58: \A 59: ///\A 60: /// The final unit of output in which gutter widths are rendered\A 61: ///\A 62: /// @since 0.1"; }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_miscellaneous.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_miscellaneous.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_rhythm.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_rhythm.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_typography.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_typography.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_unit.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_unit.css"
7
+ }
@@ -29,4 +29,4 @@ $rem-fallback-unit: 1px !default;
29
29
  /// @type {Number}
30
30
  ///
31
31
 
32
- $line-height-unit: 1% !default;
32
+ $line-height-unit: 1 !default;
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_breakpoint.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_breakpoint.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_cache.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_cache.css"
7
+ }
@@ -0,0 +1,192 @@
1
+ // Copyright (C) 2014 Babs Gösgens. Licensed under MIT; see LICENSE.txt
2
+
3
+
4
+ // Content:
5
+ // 1. Functions
6
+ // add-selector
7
+ // add-properties
8
+ // remove-selector
9
+ // remove-properties
10
+ // 2. Mixins
11
+ // get-properties
12
+ // get-selectors
13
+
14
+
15
+ // 1. FUNCTIONS
16
+
17
+
18
+ ///
19
+ /// Mixes in a new namespace (selector) and css properties into a collection.
20
+ ///
21
+ /// @access public
22
+ /// @since 0.1
23
+ ///
24
+ /// @param {Map} $collection - Map, a collection of $selector: $property pairs
25
+ /// @param {Map} $selector - The selector under which the properties will be rendered, for example: %placeholder
26
+ /// @param {Map} $properties (()) - Map of CSS properties
27
+ ///
28
+ /// @return {Map}
29
+ ///
30
+
31
+ @function add-selector($collection, $selector) {
32
+ $_: (
33
+ #{$selector}: ()
34
+ );
35
+ $collection: map-merge($collection, $_);
36
+ @return $collection;
37
+ }
38
+
39
+ ///
40
+ /// Mixes in properties into a selector namespace
41
+ ///
42
+ /// @access public
43
+ /// @since 0.1
44
+ ///
45
+ /// @param {Map} $properties - Map of CSS properties
46
+ /// @param {Map} $selector - The selector under which the properties will be rendered, for example: %placeholder
47
+ /// @param {Map} $collection - Map, a collection of $selector: $property pairs
48
+ /// @param {Bool} $force (false) - When true, append properties instead of overwrite properties
49
+ ///
50
+ /// @return {Map}
51
+ ///
52
+
53
+ @function add-properties($collection, $selector, $new-properties, $force: false) {
54
+
55
+ @if not map-has-key($collection, $selector) {
56
+ $collection: add-selector($collection, $selector);
57
+ }
58
+
59
+ // Merge the nested property-map first
60
+ $properties: map-get($collection, $selector);
61
+
62
+ // Loop over existing properties
63
+ $_ps: ();
64
+ $_vs: ();
65
+ @each $property in $properties {
66
+ $_ps: append($_ps, nth($property, 1));
67
+ $_vs: append($_vs, nth($property, 2));
68
+ }
69
+
70
+ // Loop over new properties to find duplicates
71
+ @each $_p, $_v in $new-properties {
72
+
73
+ @if index($_ps, $_p) {
74
+ $_old_v: nth($_vs, index($_ps, $_p));
75
+ @if $_old_v == $_v {
76
+ // Skip, this property and that value exist already
77
+ }
78
+ @if $_old_v != $_v and $force {
79
+ // Add it, the author may do this purposefully (warn him just in case)
80
+ @warn "Are you sure you want to declare \"#{$_p}\" again (\"#{$_old_v}\", \"#{$_v}\")?";
81
+ $_ps: append($_ps, $_p);
82
+ $_vs: append($_vs, $_v);
83
+ }
84
+ } @else {
85
+ $_ps: append($_ps, $_p);
86
+ $_vs: append($_vs, $_v);
87
+ }
88
+ }
89
+
90
+ $collection: map-merge($collection, ($selector: zip($_ps, $_vs)));
91
+
92
+ @return $collection;
93
+ }
94
+
95
+ ///
96
+ /// Remove namespace (selector) and css properties from a collection.
97
+ ///
98
+ /// @access public
99
+ /// @since 0.6
100
+ ///
101
+ /// @param {Map} $collection - Map, a collection of $selector: $property pairs
102
+ /// @param {Map} $selector - The selector to be removed
103
+ ///
104
+ /// @return {Map}
105
+ ///
106
+
107
+ @function remove-selector($collection, $selector) {
108
+ @return map-remove($collection, $selector);
109
+ }
110
+
111
+ ///
112
+ /// Remove properties from a selector in a collection
113
+ ///
114
+ /// @access public
115
+ /// @since 0.6
116
+ ///
117
+ /// @param {Map} $collection - Map, a collection of $selector: $property pairs
118
+ /// @param {Map} $selector - The selector under which the properties will be rendered, for example: %placeholder
119
+ /// @param {List} $properties (()) - List of CSS properties, empty to remove all properties
120
+ ///
121
+ /// @return {Map}
122
+ ///
123
+
124
+ @function remove-properties($collection, $selector, $obsolete-properties: ()) {
125
+
126
+ // Loop over existing properties and convert into a map
127
+ $_properties: ();
128
+ @each $_p in map-get($collection, $selector) {
129
+ $_properties: map-merge($_properties, (nth($_p, 1): nth($_p, 2)));
130
+ }
131
+
132
+ // Remove properties
133
+ @if length($obsolete-properties) == 0 {
134
+ // Remove all properties
135
+ $_properties: ();
136
+ } @else {
137
+
138
+ }
139
+ @each $property in $obsolete-properties {
140
+ $_properties: map-remove($_properties, $property);
141
+ }
142
+
143
+ // Convert back into a properties list
144
+ $_ps: ();
145
+ $_vs: ();
146
+ @each $property in $_properties {
147
+ $_ps: append($_ps, nth($property, 1));
148
+ $_vs: append($_vs, nth($property, 2));
149
+ }
150
+
151
+ @return map-merge($collection, ($selector: zip($_ps, $_vs)));
152
+ }
153
+
154
+
155
+ // 2. MIXINS
156
+
157
+
158
+ ///
159
+ /// Mixes in properties
160
+ ///
161
+ /// @access public
162
+ /// @since 0.1
163
+ ///
164
+ /// @param {Map} $element - Map of CSS properties
165
+ ///
166
+
167
+ @mixin get-properties($selector) {
168
+ @each $property in $selector {
169
+ #{nth($property, 1)}: unquote(nth($property, 2));
170
+ }
171
+ }
172
+
173
+
174
+ ///
175
+ /// Mixes in all elements from an element collection
176
+ ///
177
+ /// @access public
178
+ /// @since 0.1
179
+ ///
180
+ /// @param {Map} $elements - Map, a collection of $selector: $property pairs
181
+ ///
182
+
183
+ @mixin get-selectors($collection) {
184
+ $selectors: map-keys($collection);
185
+
186
+ @each $selector in $selectors {
187
+ #{$selector} {
188
+ $element: map-get($collection, $selector);
189
+ @include get-properties($element);
190
+ }
191
+ }
192
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_colour.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_colour.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_element.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_element.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_image.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_image.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_layout.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_layout.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_list.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_list.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_miscellaneous.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_miscellaneous.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_rhythm.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_rhythm.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_side.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_side.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_string.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_string.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_svg.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_svg.css"
7
+ }
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_typography.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_typography.css"
7
+ }
@@ -3,10 +3,10 @@
3
3
 
4
4
  // Content
5
5
  // 1. functions:
6
- // extract-type-style
7
- // extract-type-variant
8
- // extract-type-weight
9
- // extract-type-family
6
+ // get-font-style
7
+ // get-font-variant
8
+ // get-font-weight
9
+ // get-font-family
10
10
  // font-size
11
11
  // line-height
12
12
  // weight-number-to-string
@@ -35,7 +35,7 @@
35
35
  /// @return {String} - font-type property
36
36
  ///
37
37
 
38
- @function extract-type-style($type) {
38
+ @function get-font-style($type) {
39
39
  @return nth($type, 1);
40
40
  }
41
41
 
@@ -52,7 +52,7 @@
52
52
  /// @return {String} - font-variant property
53
53
  ///
54
54
 
55
- @function extract-type-variant($type) {
55
+ @function get-font-variant($type) {
56
56
  @return nth($type, 2);
57
57
  }
58
58
 
@@ -69,7 +69,7 @@
69
69
  /// @return {String} - font-weight property
70
70
  ///
71
71
 
72
- @function extract-type-weight($type) {
72
+ @function get-font-weight($type) {
73
73
  @return nth($type, 3);
74
74
  }
75
75
 
@@ -86,7 +86,7 @@
86
86
  /// @return {String} - font-family property
87
87
  ///
88
88
 
89
- @function extract-type-family($type) {
89
+ @function get-font-family($type) {
90
90
  @return nth($type, 4);
91
91
  }
92
92
 
@@ -182,10 +182,10 @@
182
182
 
183
183
  @if not(not($type)) {
184
184
 
185
- $font-style: extract-type-style($type);
186
- $font-variant: extract-type-variant($type);
187
- $font-weight: extract-type-weight($type);
188
- $font-family: extract-type-family($type);
185
+ $font-style: get-font-style($type);
186
+ $font-variant: get-font-variant($type);
187
+ $font-weight: get-font-weight($type);
188
+ $font-family: get-font-family($type);
189
189
 
190
190
  @if $font-size and unit($unit) == rem {
191
191
  @include font-size($font-size, 1px);
@@ -215,7 +215,7 @@
215
215
  ///
216
216
 
217
217
  @mixin font-style($type) {
218
- font-style: extract-type-style($type);
218
+ font-style: get-font-style($type);
219
219
  }
220
220
 
221
221
 
@@ -228,7 +228,7 @@
228
228
  ///
229
229
 
230
230
  @mixin font-variant($type) {
231
- font-variant: extract-type-variant($type);
231
+ font-variant: get-font-variant($type);
232
232
  }
233
233
 
234
234
 
@@ -241,7 +241,7 @@
241
241
  ///
242
242
 
243
243
  @mixin font-weight($type) {
244
- font-weight: extract-type-weight($type);
244
+ font-weight: get-font-weight($type);
245
245
  }
246
246
 
247
247
 
@@ -254,7 +254,7 @@
254
254
  ///
255
255
 
256
256
  @mixin font-family($type) {
257
- font-family: extract-type-family($type);
257
+ font-family: get-font-family($type);
258
258
  }
259
259
 
260
260
 
@@ -0,0 +1,2 @@
1
+
2
+ /*# sourceMappingURL=_unit.css.map */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "mappings": "",
4
+ "sources": [],
5
+ "names": [],
6
+ "file": "_unit.css"
7
+ }
@@ -43,25 +43,23 @@
43
43
  ///
44
44
 
45
45
  @function to-unit($number, $unit: $unit, $context: $default-font-size) {
46
- @if not(type-of($number) == number) {
46
+
47
+ @if type-of($number) != number {
47
48
  @warn "Argument $number needs to be a number.";
48
49
  @return $number;
49
50
  }
50
51
 
51
- @if strip-unit($number) == 0 {
52
- @return strip-unit($number);
53
- }
54
-
52
+ // We're dealing with a rhythm number, convert to px
55
53
  @if unitless($number) and not($number == 0) {
56
- // We're dealing with a rhythm number, convert to px
57
54
  $number: -rhythm-units($number);
58
55
  }
59
56
 
57
+ // Convert value to px
60
58
  @if unit($number) != px {
61
- // Convert the value to px first
62
59
  $number: to-px($number);
63
60
  }
64
61
 
62
+ // Now, calculate the correct contextual value in requested unit
65
63
  @if unit($unit) == "px" {
66
64
  }
67
65
  @elseif unit($unit) == "%" {
@@ -74,6 +72,11 @@
74
72
  $number: $number / $context * $unit;
75
73
  }
76
74
 
75
+ // If the value is 0, just return 0 for good form
76
+ @if strip-unit($number) == 0 {
77
+ $number: 0;
78
+ }
79
+
77
80
  @return $number;
78
81
  }
79
82