sassy-maps 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffd41893e69bee011b345abd23bf5c1c8d011383
|
4
|
+
data.tar.gz: b927e743e20c5204f449d5c1715a046bbb9adb83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a89bacc8de898cc114af9fb44486baf5d845579475fc8e1a0865f92731530bf66941cd7740625c4b05328db206a3529c3cee5abbb750d1a9a71e7195b572acdd
|
7
|
+
data.tar.gz: 7690b6860024fd07b7afa472b5d160f59ea6005b764f1ecf4f6e78e3f4a7db5f15092af24a5e5427e682f16fd61a06ab87306e3acc2be4a6d20209f61166ae45
|
data/lib/sassy-maps.rb
CHANGED
@@ -20,8 +20,8 @@ Compass::Frameworks.register('sassy-maps', :stylesheets_directory => stylesheets
|
|
20
20
|
# a prerelease version
|
21
21
|
# Date is in the form of YYYY-MM-DD
|
22
22
|
module SassyMaps
|
23
|
-
VERSION = "0.
|
24
|
-
DATE = "2013-
|
23
|
+
VERSION = "0.2.0"
|
24
|
+
DATE = "2013-12-02"
|
25
25
|
end
|
26
26
|
|
27
27
|
# This is where any custom SassScript should be placed. The functions will be
|
@@ -0,0 +1,29 @@
|
|
1
|
+
$private-sassy-maps-supress-warnings: false !default;
|
2
|
+
|
3
|
+
@function map-get-deep($map, $keys...) {
|
4
|
+
@if length($keys) == 1 {
|
5
|
+
$keys: nth($keys, 1);
|
6
|
+
}
|
7
|
+
$warn: "#{nth($keys, 1)}";
|
8
|
+
$length: length($keys);
|
9
|
+
$get: map-get($map, nth($keys, 1));
|
10
|
+
|
11
|
+
@for $i from 2 through $length {
|
12
|
+
@if $get != null and type-of($get) == 'map' {
|
13
|
+
$warn: $warn + "->#{nth($keys, $i)}";
|
14
|
+
$get: map-get($get, nth($keys, $i));
|
15
|
+
}
|
16
|
+
@else {
|
17
|
+
@if not $private-sassy-maps-supress-warnings {
|
18
|
+
@if $get == null {
|
19
|
+
@warn "Map has no value for key search `#{$warn}`";
|
20
|
+
}
|
21
|
+
@else if type-of($get) != 'map' {
|
22
|
+
@warn "Non-map value found for key search `#{$warn}`, cannot search for key `#{nth($keys, $i)}`";
|
23
|
+
}
|
24
|
+
}
|
25
|
+
@return null;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
@return $get;
|
29
|
+
}
|
@@ -1,3 +1,51 @@
|
|
1
|
+
@function get-keys($keys, $counter) {
|
2
|
+
$return: ();
|
3
|
+
@for $i from 1 to $counter {
|
4
|
+
$return: append($return, nth($keys, $i));
|
5
|
+
}
|
6
|
+
@return $return;
|
7
|
+
}
|
8
|
+
|
1
9
|
@function map-set($map, $key, $value) {
|
2
10
|
@return map-merge($map, ($key: $value));
|
11
|
+
}
|
12
|
+
|
13
|
+
@function map-set-deep($map, $keys, $value) {
|
14
|
+
$private-sassy-maps-supress-warnings: true !global;
|
15
|
+
$length: length($keys);
|
16
|
+
$get-keys: ();
|
17
|
+
$map-level: ();
|
18
|
+
|
19
|
+
|
20
|
+
@if $length > 1 {
|
21
|
+
$get-keys: get-keys($keys, $length);
|
22
|
+
$map-level: map-get-deep($map, $get-keys);
|
23
|
+
}
|
24
|
+
$merge: (nth($keys, $length): $value);
|
25
|
+
@if $map-level {
|
26
|
+
$merge: map-merge($map-level, $merge);
|
27
|
+
}
|
28
|
+
@for $i from ($length * -1 + 1) through -1 {
|
29
|
+
$j: abs($i);
|
30
|
+
$key: nth($keys, $j);
|
31
|
+
//
|
32
|
+
// @debug $get-keys;
|
33
|
+
@if $j > 1 {
|
34
|
+
$get-keys: get-keys($keys, $j);
|
35
|
+
$map-level: map-get-deep($map, $get-keys);
|
36
|
+
@if $map-level {
|
37
|
+
$merge: map-merge($map-level, ($key: $merge));
|
38
|
+
}
|
39
|
+
@else {
|
40
|
+
$merge: ($key: $merge);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
@else {
|
44
|
+
$merge: ($key: $merge);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
$map: map-merge($map, $merge);
|
48
|
+
|
49
|
+
$private-sassy-maps-supress-warnings: false !global;
|
50
|
+
@return $map;
|
3
51
|
}
|
metadata
CHANGED
@@ -1,44 +1,44 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sassy-maps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Richard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.3.0.rc.
|
19
|
+
version: 3.3.0.rc.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.3.0.rc.
|
26
|
+
version: 3.3.0.rc.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: compass
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 1.0.0.alpha.13
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
41
|
-
description:
|
40
|
+
version: 1.0.0.alpha.13
|
41
|
+
description: Map helper functions for Sass 3.3 Maps including get-deep and set/set-deep
|
42
42
|
email:
|
43
43
|
- sam@snug.ug
|
44
44
|
executables: []
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- stylesheets/_sassy-maps.scss
|
50
50
|
- stylesheets/sassy-maps/_map-get.scss
|
51
51
|
- stylesheets/sassy-maps/_map-set.scss
|
52
|
+
- stylesheets/sassy-maps/_map-to-string.scss
|
52
53
|
- templates/project/Gemfile.txt
|
53
54
|
- templates/project/manifest.rb
|
54
55
|
homepage: https://github.com/Snugug/Sassy-Maps
|
@@ -74,5 +75,5 @@ rubyforge_project: sassy-maps
|
|
74
75
|
rubygems_version: 2.0.3
|
75
76
|
signing_key:
|
76
77
|
specification_version: 4
|
77
|
-
summary:
|
78
|
+
summary: Map helper functions for Sass 3.3 Maps
|
78
79
|
test_files: []
|