SassyJSON 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/lib/SassyJSON.rb +2 -2
- data/stylesheets/decode/helpers/color/_get-color-value.scss +3 -3
- data/stylesheets/decode/helpers/color/_hex-to-dec.scss +5 -5
- data/stylesheets/decode/helpers/color/_hex.scss +3 -3
- data/stylesheets/decode/helpers/color/_hsl.scss +2 -2
- data/stylesheets/decode/helpers/color/_rgb.scss +2 -2
- data/stylesheets/decode/helpers/string/_find-ending-quote.scss +2 -2
- data/stylesheets/decode/helpers/string/_length.scss +3 -3
- data/stylesheets/encode/api/_json.scss +2 -2
- data/stylesheets/encode/mixins/_json.scss +5 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdbf1249ba45810c63b51f8b6fd740f0fcd4bc66
|
4
|
+
data.tar.gz: 991a05fc6d5ed57809347bdb1e553c6a791ceb65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e2bfacf5774a32283b7936fb234c2748b61d5da07e05855e50b2d6f6b7554417517069aa484141da00d91a31c7311ca3e44505ba90e3e5206be919bc92ae5c9
|
7
|
+
data.tar.gz: 204fb617d61b5ee9c0a1ec73750b08c81c86e2153bbaa6b1e9153c3b2edec51ee9992e17ef85a6bebe6ac4128a2f27bf936316888e51a66e3522ee5822576958
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Changelog
|
2
|
+
* `1.1.7`: Include cosmetic changes made after linting with [scss-lint](https://github.com/causes/scss-lint)
|
2
3
|
* `1.1.6`: JSON files that are loaded via `@import "data.json?varname` can be pretty printed now.
|
3
4
|
* `1.1.5`: Fixed `json-encode` mixin to keep `body::before` in the render tree. Making it possible to access via `getComputedStyle(document.body, ':before')`
|
4
5
|
* `1.1.4`: Small fix for the `npm` release
|
data/lib/SassyJSON.rb
CHANGED
@@ -7,6 +7,6 @@ Compass::Frameworks.register('SassyJSON', :path => extension_path)
|
|
7
7
|
# Version is a number. If a version contains alphas, it will be created as a prerelease version
|
8
8
|
# Date is in the form of YYYY-MM-DD
|
9
9
|
module SassyJSON
|
10
|
-
VERSION = "1.1.
|
11
|
-
DATE = "2014-
|
10
|
+
VERSION = "1.1.7"
|
11
|
+
DATE = "2014-04-08"
|
12
12
|
end
|
@@ -13,10 +13,10 @@
|
|
13
13
|
}
|
14
14
|
|
15
15
|
$last: str-slice($string, -1, -1);
|
16
|
-
|
16
|
+
|
17
17
|
@return if(
|
18
|
-
$last == '%',
|
19
|
-
nth(_json-decode--number(str-slice($string, 1, -2), 2), 2) * 1%,
|
18
|
+
$last == '%',
|
19
|
+
nth(_json-decode--number(str-slice($string, 1, -2), 2), 2) * 1%,
|
20
20
|
nth(_json-decode--number($string, 2), 2)
|
21
21
|
);
|
22
22
|
}
|
@@ -4,17 +4,17 @@
|
|
4
4
|
// --------------------------------------------------------------------------------
|
5
5
|
// @return [number] decimal number
|
6
6
|
|
7
|
-
@function _hex-to-dec($string){
|
7
|
+
@function _hex-to-dec($string) {
|
8
8
|
$hex: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f";
|
9
9
|
$string: to-lower-case($string);
|
10
10
|
$length: str-length($string);
|
11
|
-
|
11
|
+
|
12
12
|
$dec: 0;
|
13
13
|
@for $i from 1 through $length {
|
14
|
-
$factor: 1 + (
|
14
|
+
$factor: 1 + (15 * ($length - $i));
|
15
15
|
$index: index($hex, str-slice($string, $i, $i));
|
16
16
|
$dec: $dec + $factor * ($index - 1);
|
17
17
|
}
|
18
|
-
|
18
|
+
|
19
19
|
@return $dec;
|
20
|
-
}
|
20
|
+
}
|
@@ -29,12 +29,12 @@
|
|
29
29
|
@else if str-length($g) < $max { $g: $g + $c }
|
30
30
|
@else if str-length($b) < $max { $b: $b + $c }
|
31
31
|
}
|
32
|
-
|
32
|
+
|
33
33
|
@if $length == 4 {
|
34
34
|
$r: $r + $r;
|
35
35
|
$g: $g + $g;
|
36
36
|
$b: $b + $b;
|
37
37
|
}
|
38
|
-
|
38
|
+
|
39
39
|
@return rgb(_hex-to-dec($r), _hex-to-dec($g), _hex-to-dec($b));
|
40
|
-
}
|
40
|
+
}
|
@@ -4,7 +4,7 @@
|
|
4
4
|
// --------------------------------------------------------------------------------
|
5
5
|
// @return [number] position of the first non escaped quote
|
6
6
|
|
7
|
-
@function _find-ending-quote($string){
|
7
|
+
@function _find-ending-quote($string) {
|
8
8
|
$backslash: str-slice('\\', 1, 1); // Dirty hack to have a single backslash
|
9
9
|
$escaped-chars: '"\/bfnrtu'; // Characters that can be escaped in JSON
|
10
10
|
$hexadecimal-chars: '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' '0' 'a' 'b' 'c' 'd' 'e' 'f';
|
@@ -26,7 +26,7 @@
|
|
26
26
|
not index($hexadecimal-chars, str-slice($string, $pos + 2, $pos + 2)) or
|
27
27
|
not index($hexadecimal-chars, str-slice($string, $pos + 3, $pos + 3)) or
|
28
28
|
not index($hexadecimal-chars, str-slice($string, $pos + 4, $pos + 4)) {
|
29
|
-
|
29
|
+
@return 0;
|
30
30
|
}
|
31
31
|
|
32
32
|
$pos: $pos + 4;
|
@@ -13,7 +13,7 @@
|
|
13
13
|
$units: 1px 1cm 1mm 1% 1ch 1pica 1in 1em 1rem 1pt 1pc 1ex 1vw 1vh 1vmin 1vmax;
|
14
14
|
$number: "";
|
15
15
|
$unit: "";
|
16
|
-
|
16
|
+
|
17
17
|
@for $i from 1 through str-length($string) {
|
18
18
|
$c: str-slice($string, $i, $i);
|
19
19
|
@if $c == ' ' {
|
@@ -31,7 +31,7 @@
|
|
31
31
|
$unit: $unit + $c;
|
32
32
|
}
|
33
33
|
}
|
34
|
-
|
34
|
+
|
35
35
|
$number: nth(_json-decode--number($number, 2), 2);
|
36
36
|
$index: index($strings, to-lower-case($unit));
|
37
37
|
|
@@ -40,4 +40,4 @@
|
|
40
40
|
}
|
41
41
|
|
42
42
|
@return $string;
|
43
|
-
}
|
43
|
+
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
// --------------------------------------------------------------------------------
|
4
4
|
// @param $value: value to be stringified
|
5
5
|
// --------------------------------------------------------------------------------
|
6
|
-
// @throw "Unknown type for $value ({x})."
|
6
|
+
// @throw "Unknown type for $value ( {x} )."
|
7
7
|
// --------------------------------------------------------------------------------
|
8
8
|
// @return [string|false] JSON encoded string
|
9
9
|
|
@@ -11,7 +11,7 @@
|
|
11
11
|
$type: type-of($value);
|
12
12
|
@if function_exists('_json-encode--#{$type}') {
|
13
13
|
@return call('_json-encode--#{$type}', $value);
|
14
|
-
}
|
14
|
+
}
|
15
15
|
@warn "Unknown type for #{$value} (#{$type}).";
|
16
16
|
@return false;
|
17
17
|
}
|
@@ -16,10 +16,11 @@
|
|
16
16
|
// All browsers except IE8-
|
17
17
|
body::before {
|
18
18
|
// This element must be in the render tree to get it via getComputedStyle(document.body, ':before');
|
19
|
-
display:block;
|
20
|
-
width:0;height:0;
|
21
|
-
overflow:hidden;
|
22
19
|
content: json-encode($value);
|
20
|
+
display: block;
|
21
|
+
height: 0;
|
22
|
+
overflow: hidden;
|
23
|
+
width: 0;
|
23
24
|
}
|
24
25
|
|
25
26
|
// All browsers except Opera (Presto based)
|
@@ -36,4 +37,4 @@
|
|
36
37
|
}
|
37
38
|
}
|
38
39
|
}
|
39
|
-
}
|
40
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: SassyJSON
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hugo Giraudel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-04-08 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Sass API for JSON
|
15
15
|
email:
|