base.sass 1.1.0 → 1.2.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.
- checksums.yaml +4 -4
- data/Changelog.md +5 -1
- data/Readme.md +5 -5
- data/lib/base.sass/env.rb +21 -6
- data/lib/base.sass/map.rb +2 -2
- data/stylesheets/base.sass/_*.scss +4 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f1d195e6a52cb50dbd31f9a401dfaf1e686d182
|
4
|
+
data.tar.gz: b4a174b36a7f61faa0d63b56a62193d85818562a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d8f72b9bba990f74cae21bd9cb7821a06e0ca73b84d4a51df5eaefb75aa440e24fef112dd04b71948ad02e7034ffda687baeb64463a5e7c8bf1bb6c1ca6191a
|
7
|
+
data.tar.gz: 24832fd86a78a1175f60d57cab1a2b180256ddce534859ecf3fd332045754066e159417e8fc45758bbcca459195ca10ff1c93ff51b148b76d60866557e4a0afd
|
data/Changelog.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## v1.2.0
|
4
|
+
|
5
|
+
### Upgrades `app-config()`
|
6
|
+
|
3
7
|
## v1.1.0
|
4
8
|
|
5
9
|
### Overrides official map functions to support nest keys
|
@@ -16,7 +20,7 @@
|
|
16
20
|
|
17
21
|
## v1.0.1
|
18
22
|
|
19
|
-
|
23
|
+
### Fix font url in `font-face()` for ie9
|
20
24
|
|
21
25
|
## v1.0.0
|
22
26
|
|
data/Readme.md
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
In your [`Gemfile`](http://bundler.io/v1.6/gemfile.html):
|
11
11
|
|
12
12
|
```ruby
|
13
|
-
gem 'base.sass', '~> 1.
|
13
|
+
gem 'base.sass', '~> 1.2'
|
14
14
|
```
|
15
15
|
|
16
16
|
Or in command line:
|
@@ -21,7 +21,7 @@ $ gem install base.sass
|
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
|
-
|
24
|
+
At top of your Sass file:
|
25
25
|
|
26
26
|
```scss
|
27
27
|
@import 'base.sass/*';
|
@@ -30,7 +30,7 @@ In your Sass file:
|
|
30
30
|
And then in command line:
|
31
31
|
|
32
32
|
```sh
|
33
|
-
$ sass -r base.sass
|
33
|
+
$ sass --watch -r base.sass src:dist
|
34
34
|
```
|
35
35
|
|
36
36
|
Or in `config.rb`:
|
@@ -41,12 +41,12 @@ require 'base.sass'
|
|
41
41
|
|
42
42
|
## Features
|
43
43
|
|
44
|
-
### Read environment
|
44
|
+
### Read environment variables (case insensitive)
|
45
45
|
|
46
46
|
When you run:
|
47
47
|
|
48
48
|
```sh
|
49
|
-
$ SASS_ENV=production sass -r base.sass
|
49
|
+
$ SASS_ENV=production sass --update -r base.sass src:dist
|
50
50
|
```
|
51
51
|
|
52
52
|
Then you can use `env()` in a Sass file to get the value:
|
data/lib/base.sass/env.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Sass::Script::Functions
|
2
2
|
|
3
|
-
# Returns the value
|
3
|
+
# Returns the value of environment variable associated with the given name.
|
4
4
|
# Returns null if the named variable does not exist.
|
5
5
|
#
|
6
6
|
# Examples:
|
@@ -12,16 +12,31 @@ module Sass::Script::Functions
|
|
12
12
|
ruby_to_sass(ENV[name.value.gsub('-', '_').upcase])
|
13
13
|
end
|
14
14
|
|
15
|
-
#
|
16
|
-
#
|
15
|
+
# Returns the config associated with the given name.
|
16
|
+
# Configs are be grouped by `SASS_ENV` environment.
|
17
17
|
#
|
18
18
|
# Examples:
|
19
|
-
# $app-config: (
|
20
|
-
#
|
19
|
+
# $app-config: (
|
20
|
+
# development: (
|
21
|
+
# foo: bar
|
22
|
+
# ),
|
23
|
+
# production: (
|
24
|
+
# foo: baz
|
25
|
+
# )
|
26
|
+
# );
|
27
|
+
#
|
28
|
+
# $ sass --watch -r base.sass src:dist
|
29
|
+
# app-config(foo) => bar
|
30
|
+
#
|
31
|
+
# $ SASS_ENV=production sass --watch -r base.sass src:dist
|
32
|
+
# app-config(foo) => baz
|
21
33
|
def app_config(name)
|
22
34
|
assert_type name, :String
|
35
|
+
|
23
36
|
config = environment.global_env.var('app-config')
|
24
|
-
config.is_a?
|
37
|
+
return null unless config.is_a? Sass::Script::Value::Map
|
38
|
+
|
39
|
+
map_get(config, *[env(identifier('sass-env')), name])
|
25
40
|
end
|
26
41
|
|
27
42
|
end
|
data/lib/base.sass/map.rb
CHANGED
@@ -96,7 +96,7 @@ module Sass::Script::Functions
|
|
96
96
|
|
97
97
|
map2.each do |k, v|
|
98
98
|
orig = map1[k]
|
99
|
-
map1[k] =
|
99
|
+
map1[k] = compare_value(orig, v)
|
100
100
|
end
|
101
101
|
|
102
102
|
map(map1)
|
@@ -113,7 +113,7 @@ module Sass::Script::Functions
|
|
113
113
|
(keys.empty? ? map : map_get(map, *keys)).to_h.dup
|
114
114
|
end
|
115
115
|
|
116
|
-
def
|
116
|
+
def compare_value(oldVal, newVal)
|
117
117
|
if oldVal.is_a?(Sass::Script::Value::Map) && newVal.is_a?(Sass::Script::Value::Map)
|
118
118
|
map_merge(oldVal, newVal, bool(true))
|
119
119
|
elsif oldVal.is_a?(Sass::Script::Value::List) && newVal.is_a?(Sass::Script::Value::List)
|
@@ -1,12 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
@import 'functions/support';
|
2
|
+
@import 'functions/list';
|
3
|
+
@import 'mixins/placeholder-wrapper';
|
4
4
|
@import 'mixins/clearfix';
|
5
5
|
@import 'mixins/ellipsis-overflow';
|
6
|
-
@import 'mixins/float';
|
7
6
|
@import 'mixins/font-face';
|
8
7
|
@import 'mixins/inline-block';
|
9
|
-
@import 'mixins/
|
10
|
-
|
11
|
-
@import 'functions/list';
|
12
|
-
@import 'functions/support';
|
8
|
+
@import 'mixins/float';
|