sass 3.2.0.alpha.57 → 3.2.0.alpha.59
Sign up to get free protection for your applications and to get access to all the features.
- data/REVISION +1 -1
- data/VERSION +1 -1
- data/lib/sass/engine.rb +22 -13
- data/lib/sass/media.rb +300 -0
- data/lib/sass/script/funcall.rb +2 -2
- data/lib/sass/script/literal.rb +0 -20
- data/lib/sass/script/operation.rb +8 -0
- data/lib/sass/script/parser.rb +21 -0
- data/lib/sass/scss/css_parser.rb +0 -11
- data/lib/sass/scss/parser.rb +95 -61
- data/lib/sass/scss/static_parser.rb +1 -0
- data/lib/sass/selector.rb +1 -1
- data/lib/sass/tree/directive_node.rb +17 -3
- data/lib/sass/tree/media_node.rb +8 -5
- data/lib/sass/tree/visitors/convert.rb +15 -11
- data/lib/sass/tree/visitors/cssize.rb +1 -3
- data/lib/sass/tree/visitors/deep_copy.rb +10 -0
- data/lib/sass/tree/visitors/perform.rb +10 -5
- data/lib/sass/tree/visitors/set_options.rb +10 -0
- data/lib/sass/tree/visitors/to_css.rb +16 -8
- data/lib/sass/util.rb +14 -0
- data/test/sass/conversion_test.rb +60 -0
- data/test/sass/engine_test.rb +171 -16
- data/test/sass/script_test.rb +5 -0
- data/test/sass/scss/css_test.rb +1 -1
- data/test/sass/scss/scss_test.rb +46 -24
- metadata +9 -8
data/test/sass/script_test.rb
CHANGED
@@ -432,6 +432,11 @@ SASS
|
|
432
432
|
assert_raise_message(Sass::SyntaxError, "wrong number of arguments (1 for 0) for `arg-error'") {resolve("arg-error(1)")}
|
433
433
|
end
|
434
434
|
|
435
|
+
def test_boolean_ops_short_circuit
|
436
|
+
assert_equal "false", resolve("$ie and $ie <= 7", {}, env('ie' => Sass::Script::Bool.new(false)))
|
437
|
+
assert_equal "true", resolve("$ie or $undef", {}, env('ie' => Sass::Script::Bool.new(true)))
|
438
|
+
end
|
439
|
+
|
435
440
|
# Regression Tests
|
436
441
|
|
437
442
|
def test_funcall_has_higher_precedence_than_color_name
|
data/test/sass/scss/css_test.rb
CHANGED
data/test/sass/scss/scss_test.rb
CHANGED
@@ -266,7 +266,7 @@ SCSS
|
|
266
266
|
assert_equal "@import url(foo.css);\n", render('@import "foo.css";')
|
267
267
|
assert_equal "@import url(foo.css);\n", render("@import 'foo.css';")
|
268
268
|
assert_equal "@import url(\"foo.css\");\n", render('@import url("foo.css");')
|
269
|
-
assert_equal "@import url(
|
269
|
+
assert_equal "@import url(\"foo.css\");\n", render('@import url("foo.css");')
|
270
270
|
assert_equal "@import url(foo.css);\n", render('@import url(foo.css);')
|
271
271
|
end
|
272
272
|
|
@@ -279,6 +279,15 @@ SCSS
|
|
279
279
|
render("@import \"http://fonts.googleapis.com/css?family=Droid+Sans\";"))
|
280
280
|
end
|
281
281
|
|
282
|
+
def test_import_with_interpolation
|
283
|
+
assert_equal <<CSS, render(<<SCSS)
|
284
|
+
@import url("http://fonts.googleapis.com/css?family=Droid+Sans");
|
285
|
+
CSS
|
286
|
+
$family: unquote("Droid+Sans");
|
287
|
+
@import url("http://fonts.googleapis.com/css?family=\#{$family}");
|
288
|
+
SCSS
|
289
|
+
end
|
290
|
+
|
282
291
|
def test_url_import
|
283
292
|
assert_equal("@import url(fonts.sass);\n", render("@import url(fonts.sass);"))
|
284
293
|
end
|
@@ -865,6 +874,39 @@ foo {\#{"baz" + "bang"}: blip}
|
|
865
874
|
SCSS
|
866
875
|
end
|
867
876
|
|
877
|
+
def test_directive_interpolation
|
878
|
+
assert_equal <<CSS, render(<<SCSS)
|
879
|
+
@foo bar12 qux {
|
880
|
+
a: b; }
|
881
|
+
CSS
|
882
|
+
$baz: 12;
|
883
|
+
@foo bar\#{$baz} qux {a: b}
|
884
|
+
SCSS
|
885
|
+
end
|
886
|
+
|
887
|
+
def test_media_interpolation
|
888
|
+
assert_equal <<CSS, render(<<SCSS)
|
889
|
+
@media bar12 {
|
890
|
+
a: b; }
|
891
|
+
CSS
|
892
|
+
$baz: 12;
|
893
|
+
@media bar\#{$baz} {a: b}
|
894
|
+
SCSS
|
895
|
+
end
|
896
|
+
|
897
|
+
def test_variables_in_media
|
898
|
+
assert_equal <<CSS, render(<<SCSS)
|
899
|
+
@media screen and (-webkit-min-device-pixel-ratio: 20), only print {
|
900
|
+
a: b; }
|
901
|
+
CSS
|
902
|
+
$media1: screen;
|
903
|
+
$media2: print;
|
904
|
+
$var: -webkit-min-device-pixel-ratio;
|
905
|
+
$val: 20;
|
906
|
+
@media $media1 and ($var: $val), only $media2 {a: b}
|
907
|
+
SCSS
|
908
|
+
end
|
909
|
+
|
868
910
|
## Errors
|
869
911
|
|
870
912
|
def test_mixin_defs_only_at_toplevel
|
@@ -1064,26 +1106,6 @@ flim {
|
|
1064
1106
|
SCSS
|
1065
1107
|
end
|
1066
1108
|
|
1067
|
-
def test_no_interpolation_in_media_queries
|
1068
|
-
assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render <<SCSS}
|
1069
|
-
Invalid CSS after "...nd (min-width: ": expected expression (e.g. 1px, bold), was "\#{100}px) {"
|
1070
|
-
MESSAGE
|
1071
|
-
@media screen and (min-width: \#{100}px) {
|
1072
|
-
foo {bar: baz}
|
1073
|
-
}
|
1074
|
-
SCSS
|
1075
|
-
end
|
1076
|
-
|
1077
|
-
def test_no_interpolation_in_unrecognized_directives
|
1078
|
-
assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render <<SCSS}
|
1079
|
-
Invalid CSS after "@foo ": expected selector or at-rule, was "\#{100} {"
|
1080
|
-
MESSAGE
|
1081
|
-
@foo \#{100} {
|
1082
|
-
foo {bar: baz}
|
1083
|
-
}
|
1084
|
-
SCSS
|
1085
|
-
end
|
1086
|
-
|
1087
1109
|
def test_no_lonely_else
|
1088
1110
|
assert_raise_message(Sass::SyntaxError, <<MESSAGE.rstrip) {render <<SCSS}
|
1089
1111
|
Invalid CSS: @else must come after @if
|
@@ -1223,11 +1245,11 @@ SCSS
|
|
1223
1245
|
|
1224
1246
|
|
1225
1247
|
def test_newlines_removed_from_selectors_when_compressed
|
1226
|
-
assert_equal <<CSS, render(<<SCSS, :style
|
1248
|
+
assert_equal <<CSS, render(<<SCSS, :style => :compressed)
|
1227
1249
|
z a,z b{display:block}
|
1228
1250
|
CSS
|
1229
|
-
a
|
1230
|
-
b {
|
1251
|
+
a
|
1252
|
+
, b {
|
1231
1253
|
z & {
|
1232
1254
|
display: block;
|
1233
1255
|
}
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 592302955
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 2
|
9
9
|
- 0
|
10
10
|
- alpha
|
11
|
-
-
|
12
|
-
version: 3.2.0.alpha.
|
11
|
+
- 59
|
12
|
+
version: 3.2.0.alpha.59
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Nathan Weizenbaum
|
@@ -19,7 +19,7 @@ autorequire:
|
|
19
19
|
bindir: bin
|
20
20
|
cert_chain: []
|
21
21
|
|
22
|
-
date: 2012-01-
|
22
|
+
date: 2012-01-25 00:00:00 -05:00
|
23
23
|
default_executable:
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- lib/sass/logger.rb
|
87
87
|
- lib/sass/logger/base.rb
|
88
88
|
- lib/sass/logger/log_level.rb
|
89
|
+
- lib/sass/util.rb
|
89
90
|
- lib/sass/plugin.rb
|
90
91
|
- lib/sass/plugin/compiler.rb
|
91
92
|
- lib/sass/plugin/configuration.rb
|
@@ -133,7 +134,7 @@ files:
|
|
133
134
|
- lib/sass/shared.rb
|
134
135
|
- lib/sass/tree/charset_node.rb
|
135
136
|
- lib/sass/tree/comment_node.rb
|
136
|
-
- lib/sass/tree/
|
137
|
+
- lib/sass/tree/media_node.rb
|
137
138
|
- lib/sass/tree/debug_node.rb
|
138
139
|
- lib/sass/tree/directive_node.rb
|
139
140
|
- lib/sass/tree/each_node.rb
|
@@ -142,14 +143,15 @@ files:
|
|
142
143
|
- lib/sass/tree/function_node.rb
|
143
144
|
- lib/sass/tree/if_node.rb
|
144
145
|
- lib/sass/tree/import_node.rb
|
145
|
-
- lib/sass/tree/media_node.rb
|
146
146
|
- lib/sass/tree/mixin_def_node.rb
|
147
|
+
- lib/sass/tree/node.rb
|
147
148
|
- lib/sass/tree/mixin_node.rb
|
148
149
|
- lib/sass/tree/prop_node.rb
|
149
150
|
- lib/sass/tree/return_node.rb
|
150
151
|
- lib/sass/tree/root_node.rb
|
151
152
|
- lib/sass/tree/rule_node.rb
|
152
153
|
- lib/sass/tree/content_node.rb
|
154
|
+
- lib/sass/tree/trace_node.rb
|
153
155
|
- lib/sass/tree/variable_node.rb
|
154
156
|
- lib/sass/tree/visitors/base.rb
|
155
157
|
- lib/sass/tree/visitors/check_nesting.rb
|
@@ -161,8 +163,7 @@ files:
|
|
161
163
|
- lib/sass/tree/visitors/to_css.rb
|
162
164
|
- lib/sass/tree/warn_node.rb
|
163
165
|
- lib/sass/tree/while_node.rb
|
164
|
-
- lib/sass/
|
165
|
-
- lib/sass/util.rb
|
166
|
+
- lib/sass/media.rb
|
166
167
|
- lib/sass/util/multibyte_string_scanner.rb
|
167
168
|
- lib/sass/util/subset_map.rb
|
168
169
|
- lib/sass/version.rb
|