sass-embedded 0.6.7 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/sass/embedded.rb +8 -3
- data/lib/sass/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af257f49189b3ea9e19c67fd67dba0cbf35d010c7a222e36fd820afee7eb3e10
|
4
|
+
data.tar.gz: a63caa77fc2a9793f5138896df09722aae680b85a11db50512da3281fba8fae7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b5e7ea087a76653e6e45ee2338eeb31224a85388b9ece793d90652176f50d77affb4816acccfa6c1dbe5ffb5221bebc3bd1d0a00dcade850e6413125c4d1fc6
|
7
|
+
data.tar.gz: 7de00d938497c9d447c396d69eb4d6907683097c3b897c77ead784a17f3fcc691f8a67ca99bc5fbf9e7ce268db5f443e31d65903e81c8acb966238760db1a35a
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Sass.render(file: "style.scss")
|
|
22
22
|
|
23
23
|
## Options
|
24
24
|
|
25
|
-
`Sass.render()`
|
25
|
+
`Sass.render(**kwargs)` supports the following options:
|
26
26
|
|
27
27
|
- [`data`](https://sass-lang.com/documentation/js-api#data)
|
28
28
|
- [`file`](https://sass-lang.com/documentation/js-api#file)
|
@@ -35,6 +35,7 @@ Sass.render(file: "style.scss")
|
|
35
35
|
- [`source_map`](https://sass-lang.com/documentation/js-api#sourcemap)
|
36
36
|
- [`out_file`](https://sass-lang.com/documentation/js-api#outfile)
|
37
37
|
- [`omit_source_map_url`](https://sass-lang.com/documentation/js-api#omitsourcemapurl)
|
38
|
+
- [`source_map_contents`](https://sass-lang.com/documentation/js-api#sourcemapcontents)
|
38
39
|
- [`source_map_embed`](https://sass-lang.com/documentation/js-api#sourcemapembed)
|
39
40
|
- [`source_map_root`](https://sass-lang.com/documentation/js-api#sourcemaproot)
|
40
41
|
- [`functions`](https://sass-lang.com/documentation/js-api#functions)
|
data/lib/sass/embedded.rb
CHANGED
@@ -49,8 +49,6 @@ module Sass
|
|
49
49
|
source_map_root: '',
|
50
50
|
functions: {},
|
51
51
|
importer: [])
|
52
|
-
raise NotImplementedError, 'source_map_contents is not implemented' unless source_map_contents == false
|
53
|
-
|
54
52
|
start = Util.now
|
55
53
|
|
56
54
|
indent_type = parse_indent_type(indent_type)
|
@@ -89,6 +87,7 @@ module Sass
|
|
89
87
|
file: file,
|
90
88
|
out_file: out_file,
|
91
89
|
source_map: source_map,
|
90
|
+
source_map_contents: source_map_contents,
|
92
91
|
source_map_root: source_map_root)
|
93
92
|
|
94
93
|
css = post_process_css(css: message.success.css,
|
@@ -122,6 +121,7 @@ module Sass
|
|
122
121
|
file:,
|
123
122
|
out_file:,
|
124
123
|
source_map:,
|
124
|
+
source_map_contents:,
|
125
125
|
source_map_root:)
|
126
126
|
return if map.nil? || map.empty?
|
127
127
|
|
@@ -146,10 +146,15 @@ module Sass
|
|
146
146
|
map_data['file'] = 'stdin.css'
|
147
147
|
end
|
148
148
|
|
149
|
+
map_data['sourcesContent'] = [] if source_map_contents
|
150
|
+
|
149
151
|
map_data['sources'].map! do |source|
|
150
152
|
if source.start_with? Util::FILE_PROTOCOL
|
151
|
-
|
153
|
+
path = Util.path(source)
|
154
|
+
map_data['sourcesContent'].push(File.read(path)) if source_map_contents
|
155
|
+
Util.relative(source_map_dir, path)
|
152
156
|
else
|
157
|
+
map_data['sourcesContent'].push(nil) if source_map_contents
|
153
158
|
source
|
154
159
|
end
|
155
160
|
end
|
data/lib/sass/version.rb
CHANGED