sugarcss 1.0.1 → 1.0.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2a0d9bafb647b37300914c53cd6b1c818cadab8c
4
- data.tar.gz: fe240a9dbce7dc1c99eac6275edcce94ae7d148d
3
+ metadata.gz: ccbb127713e013d6edcbe95d066b3b979b75ea24
4
+ data.tar.gz: e9153fd1d97e3a2c36cd725b4c4cfcee738cdbbb
5
5
  SHA512:
6
- metadata.gz: 114ce415ff8142dc36d4623b240964031eb3597d5dce6a17aa85f75630ddbd0457b2a3e1a599a557b26aeea6295eacc961f14d53ce95b62921ce902ac56e7a58
7
- data.tar.gz: 5539d4ec728cd50cdd568b39fa657650f3fc7e174141b42af650734480e715db7ea6cb60d1ec1c9728279f153fc75a5f1fb4290f4ceb53b8a31ec40682aa6eed
6
+ metadata.gz: 00d993652cb4dda3d82448a50b9d325e850b39be7e901a9a808ed4618e311c31e6a8c8d40be0d319d8c29436444bd69c30b2a7002504577deea3d879de7aa063
7
+ data.tar.gz: b8fd8afee7c0cc82b07814941a1b3bca144943e2695b42522f7522ffa2ec19b58d65e67aa4263e8c1f53ecfc3ee9fb2af6d2dd27b15ac663f7af743c40ad62da
data/lib/sugarcss.rb CHANGED
@@ -17,8 +17,8 @@ Compass::Frameworks.register('sugarcss', :path => extension_path)
17
17
  # a prerelease version
18
18
  # Date is in the form of YYYY-MM-DD
19
19
  module Extension
20
- VERSION = "1.0.1"
21
- DATE = "2015-11-23"
20
+ VERSION = "1.0.2"
21
+ DATE = "2016-01-13"
22
22
  end
23
23
 
24
24
  # This is where any custom SassScript should be placed. The functions will be
@@ -10,17 +10,17 @@
10
10
  ) {
11
11
  // loop on animations
12
12
  $anims : ();
13
- $current_delay : 0;
14
- $current_duration : 0;
15
- $previous_duration : 0;
13
+ $current_delay : 0s;
14
+ $current_duration : 0s;
15
+ $previous_duration : 0s;
16
16
  @each $animation in $animations {
17
17
  $animation : _sugar-parse-properties($animation, (
18
18
  iteration : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 infinite initial inherit,
19
19
  direction : normal reverse alternate alternate-reverse initial inherit,
20
20
  fill-mode : none forwards backwards both initial inherit,
21
21
  name : string,
22
- duration : number,
23
- delay : number,
22
+ duration : second,
23
+ delay : second,
24
24
  ease : string,
25
25
  parallel : true
26
26
  ), (
@@ -33,6 +33,7 @@
33
33
  fill-mode : fm,
34
34
  parallel : p
35
35
  ));
36
+
36
37
  $name : map-get-or($animation, name);
37
38
  $duration : map-get-or($animation, duration, 1s);
38
39
  $delay : map-get-or($animation, delay, 0s);
@@ -99,7 +99,12 @@ $_s_nested_properties_depth : ();
99
99
  @if $in_keywords {
100
100
 
101
101
  // check explicit values
102
- @if type-of($in_keywords) == list {
102
+ @if type-of($in_keywords) == string {
103
+ // check the type
104
+ @if s-is($value, $in_keywords) {
105
+ $new-map : map-set($new-map, $prop, $value);
106
+ }
107
+ } @else if type-of($in_keywords) == list {
103
108
  // check if the passed value exist in possible values
104
109
  @if type-of($value) == list and index($in_keywords, length) {
105
110
  $new-map : map-set($new-map, $prop, $value);
@@ -108,11 +113,6 @@ $_s_nested_properties_depth : ();
108
113
  } @else if index($in_keywords, $value) {
109
114
  $new-map : map-set($new-map, $prop, $value);
110
115
  }
111
- } @else if type-of($in_keywords) == string {
112
- // check the type
113
- @if s-is($value, $in_keywords) {
114
- $new-map : map-set($new-map, $prop, $value);
115
- }
116
116
  } @else {
117
117
  // we do nothing but adding the value like this
118
118
  $new-map : map-set($new-map, $prop, $value);
@@ -202,44 +202,28 @@ $_s_nested_properties_depth : ();
202
202
  $found : false;
203
203
  @each $name, $type in $keywords {
204
204
  @if $found == false {
205
- @if $type == url {
206
- @if s-is($prop, url) {
207
- $map : map-set($map, $name, $prop);
208
- // remove the item from keywords
209
- $keywords : map-remove($keywords, $name);
210
- // stop searching
211
- $found : true;
205
+ @if s-is($type, list) and index($type, $prop) {
206
+ $keywords-v : nth($type, index($type, $prop));
207
+ $ok : true;
208
+ @if s-is($prop, number) and index($type, length) {
209
+ $ok : true;
210
+ } @else if s-is($prop, number) and unit($prop) != unit($keywords-v) {
211
+ $ok : false;
212
212
  }
213
- } @else if $type == number or $type == color or $type == string or $type == list or $type == map {
214
- @if type-of($prop) == $type {
215
- $map : map-set($map, $name, $prop);
216
- // remove the item from keywords
217
- $keywords : map-remove($keywords, $name);
218
- // stop searching
219
- $found : true;
220
- }
221
- } @else if $type == degree {
222
- @if s-is($prop, degree) {
223
- $map : map-set($map, $name, $prop);
224
- // remove the item from keywords
225
- $keywords : map-remove($keywords, $name);
226
- // stop searching
227
- $found : true;
228
- }
229
- } @else {
230
- @if type-of($prop) == list and index($type, length) {
231
- $map : map-set($map, $name, $prop);
232
- // remove the item from keywords
233
- $keywords : map-remove($keywords, $name);
234
- // stop searching
235
- $found : true;
236
- } @else if index($type, $prop) {
213
+
214
+ @if $ok {
237
215
  $map : map-set($map, $name, $prop);
238
216
  // remove the item from keywords
239
217
  $keywords : map-remove($keywords, $name);
240
218
  // stop searching
241
219
  $found : true;
242
220
  }
221
+ } @else if s-is($type, string) and s-is($prop, $type) {
222
+ $map : map-set($map, $name, $prop);
223
+ // remove the item from keywords
224
+ $keywords : map-remove($keywords, $name);
225
+ // stop searching
226
+ $found : true;
243
227
  }
244
228
  }
245
229
  }
@@ -304,6 +288,8 @@ $_s_nested_properties_depth : ();
304
288
  @return type-of($value) == number and not unitless($value) and unit($value) == in;
305
289
  } @else if $type == pc {
306
290
  @return type-of($value) == number and not unitless($value) and unit($value) == pc;
291
+ } @else if $type == s or $type == second {
292
+ @return type-of($value) == number and not unitless($value) and unit($value) == s;
307
293
  } @else if $type == boolean or $type == bool {
308
294
  @return _is-boolean($value);
309
295
  } @else if $type == function {