sass 3.4.24 → 3.4.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +39 -10
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass.rb +3 -3
- data/lib/sass/css.rb +1 -1
- data/lib/sass/deprecation.rb +55 -0
- data/lib/sass/engine.rb +13 -5
- data/lib/sass/environment.rb +1 -1
- data/lib/sass/plugin.rb +1 -1
- data/lib/sass/plugin/compiler.rb +1 -1
- data/lib/sass/plugin/configuration.rb +1 -1
- data/lib/sass/plugin/rack.rb +2 -2
- data/lib/sass/plugin/staleness_checker.rb +1 -1
- data/lib/sass/script.rb +1 -1
- data/lib/sass/script/functions.rb +2 -2
- data/lib/sass/script/lexer.rb +1 -1
- data/lib/sass/script/parser.rb +4 -3
- data/lib/sass/script/tree/node.rb +1 -1
- data/lib/sass/script/tree/operation.rb +43 -16
- data/lib/sass/script/value/base.rb +1 -1
- data/lib/sass/script/value/string.rb +5 -12
- data/lib/sass/scss/static_parser.rb +7 -0
- data/lib/sass/selector/comma_sequence.rb +13 -1
- data/lib/sass/selector/simple.rb +1 -0
- data/lib/sass/tree/node.rb +2 -2
- data/lib/sass/tree/rule_node.rb +13 -4
- data/lib/sass/tree/visitors/deep_copy.rb +1 -1
- data/lib/sass/tree/visitors/perform.rb +3 -2
- data/test/sass/conversion_test.rb +3 -3
- data/test/sass/css2sass_test.rb +1 -1
- data/test/sass/engine_test.rb +56 -50
- data/test/sass/extend_test.rb +14 -8
- data/test/sass/functions_test.rb +5 -2
- data/test/sass/more_templates/more1.sass +10 -10
- data/test/sass/more_templates/more_import.sass +2 -2
- data/test/sass/plugin_test.rb +3 -3
- data/test/sass/script_test.rb +38 -29
- data/test/sass/scss/css_test.rb +2 -2
- data/test/sass/scss/scss_test.rb +25 -10
- data/test/sass/source_map_test.rb +13 -13
- data/test/sass/templates/_partial.sass +1 -1
- data/test/sass/templates/basic.sass +10 -10
- data/test/sass/templates/bork1.sass +1 -1
- data/test/sass/templates/bork5.sass +1 -1
- data/test/sass/templates/compact.sass +10 -10
- data/test/sass/templates/complex.sass +187 -187
- data/test/sass/templates/compressed.sass +10 -10
- data/test/sass/templates/expanded.sass +10 -10
- data/test/sass/templates/import.sass +2 -2
- data/test/sass/templates/importee.sass +3 -3
- data/test/sass/templates/mixins.sass +22 -22
- data/test/sass/templates/multiline.sass +4 -4
- data/test/sass/templates/nested.sass +13 -13
- data/test/sass/templates/parent_ref.sass +12 -12
- data/test/sass/templates/script.sass +70 -70
- data/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +1 -1
- data/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +2 -2
- data/test/sass/templates/subdir/subdir.sass +3 -3
- data/test/sass/templates/units.sass +10 -10
- data/test/sass/util/multibyte_string_scanner_test.rb +10 -2
- metadata +25 -24
@@ -27,7 +27,7 @@ module Sass::Script::Value
|
|
27
27
|
|
28
28
|
# Sets the options hash for this node,
|
29
29
|
# as well as for all child nodes.
|
30
|
-
# See {file:SASS_REFERENCE.md#
|
30
|
+
# See {file:SASS_REFERENCE.md#Options the Sass options documentation}.
|
31
31
|
#
|
32
32
|
# @param options [{Symbol => Object}] The options
|
33
33
|
attr_writer :options
|
@@ -2,6 +2,8 @@
|
|
2
2
|
module Sass::Script::Value
|
3
3
|
# A SassScript object representing a CSS string *or* a CSS identifier.
|
4
4
|
class String < Base
|
5
|
+
@@interpolation_deprecation = Sass::Deprecation.new
|
6
|
+
|
5
7
|
# The Ruby value of the string.
|
6
8
|
#
|
7
9
|
# @return [String]
|
@@ -121,18 +123,9 @@ module Sass::Script::Value
|
|
121
123
|
def check_deprecated_interp
|
122
124
|
return unless @deprecated_interp_equivalent
|
123
125
|
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
return if $_sass_deprecated_interp_warnings.include?(key)
|
128
|
-
$_sass_deprecated_interp_warnings << key
|
129
|
-
# rubocop:enable GlobalVars
|
130
|
-
|
131
|
-
location = "on line #{source_range.start_pos.line}"
|
132
|
-
location << " of #{source_range.file}" if source_range.file
|
133
|
-
Sass::Util.sass_warn <<WARNING
|
134
|
-
DEPRECATION WARNING #{location}: \#{} interpolation near operators will be simplified
|
135
|
-
in a future version of Sass. To preserve the current behavior, use quotes:
|
126
|
+
@@interpolation_deprecation.warn(source_range.file, source_range.start_pos.line, <<WARNING)
|
127
|
+
\#{} interpolation near operators will be simplified in a future version of Sass.
|
128
|
+
To preserve the current behavior, use quotes:
|
136
129
|
|
137
130
|
#{@deprecated_interp_equivalent}
|
138
131
|
WARNING
|
@@ -144,6 +144,13 @@ MESSAGE
|
|
144
144
|
ns, name = expr!(:qualified_name)
|
145
145
|
res << ns << '|' if ns
|
146
146
|
res << name << tok!(%r{/})
|
147
|
+
|
148
|
+
location = " of #{@filename}" if @filename
|
149
|
+
Sass::Util.sass_warn <<MESSAGE
|
150
|
+
DEPRECATION WARNING on line #{@line}, column #{@offset}#{location}:
|
151
|
+
The reference combinator #{res} is deprecated and will be removed in a future release.
|
152
|
+
MESSAGE
|
153
|
+
|
147
154
|
res
|
148
155
|
end
|
149
156
|
|
@@ -2,6 +2,8 @@ module Sass
|
|
2
2
|
module Selector
|
3
3
|
# A comma-separated sequence of selectors.
|
4
4
|
class CommaSequence < AbstractSequence
|
5
|
+
@@compound_extend_deprecation = Sass::Deprecation.new
|
6
|
+
|
5
7
|
# The comma-separated selector sequences
|
6
8
|
# represented by this class.
|
7
9
|
#
|
@@ -96,8 +98,11 @@ module Sass
|
|
96
98
|
# The node that caused this extension.
|
97
99
|
# @param parent_directives [Array<Sass::Tree::DirectiveNode>]
|
98
100
|
# The parent directives containing `extend_node`.
|
101
|
+
# @param allow_compound_target [Boolean]
|
102
|
+
# Whether `extendee` is allowed to contain compound selectors.
|
99
103
|
# @raise [Sass::SyntaxError] if this extension is invalid.
|
100
|
-
def populate_extends(extends, extendee, extend_node = nil, parent_directives = []
|
104
|
+
def populate_extends(extends, extendee, extend_node = nil, parent_directives = [],
|
105
|
+
allow_compound_target = false)
|
101
106
|
extendee.members.each do |seq|
|
102
107
|
if seq.members.size > 1
|
103
108
|
raise Sass::SyntaxError.new("Can't extend #{seq}: can't extend nested selectors")
|
@@ -111,6 +116,13 @@ module Sass
|
|
111
116
|
end
|
112
117
|
|
113
118
|
sel = sseq.members
|
119
|
+
if !allow_compound_target && sel.length > 1
|
120
|
+
@@compound_extend_deprecation.warn(sseq.filename, sseq.line, <<WARNING)
|
121
|
+
Extending a compound selector, #{sseq}, is deprecated and will not be supported in a future release.
|
122
|
+
See https://github.com/sass/sass/issues/1599 for details.
|
123
|
+
WARNING
|
124
|
+
end
|
125
|
+
|
114
126
|
members.each do |member|
|
115
127
|
unless member.members.last.is_a?(Sass::Selector::SimpleSequence)
|
116
128
|
raise Sass::SyntaxError.new("#{member} can't extend: invalid selector")
|
data/lib/sass/selector/simple.rb
CHANGED
@@ -72,6 +72,7 @@ module Sass
|
|
72
72
|
# by the time extension and unification happen,
|
73
73
|
# this exception will only ever be raised as a result of programmer error
|
74
74
|
def unify(sels)
|
75
|
+
return sels.first.unify([self]) if sels.length == 1 && sels.first.is_a?(Universal)
|
75
76
|
return sels if sels.any? {|sel2| eql?(sel2)}
|
76
77
|
sels_with_ix = Sass::Util.enum_with_index(sels)
|
77
78
|
if !is_a?(Pseudo) || (sels.last.is_a?(Pseudo) && sels.last.type == :element)
|
data/lib/sass/tree/node.rb
CHANGED
@@ -83,7 +83,7 @@ module Sass
|
|
83
83
|
attr_writer :filename
|
84
84
|
|
85
85
|
# The options hash for the node.
|
86
|
-
# See {file:SASS_REFERENCE.md#
|
86
|
+
# See {file:SASS_REFERENCE.md#Options the Sass options documentation}.
|
87
87
|
#
|
88
88
|
# @return [{Symbol => Object}]
|
89
89
|
attr_reader :options
|
@@ -151,7 +151,7 @@ module Sass
|
|
151
151
|
# @return [Boolean]
|
152
152
|
def invisible?; false; end
|
153
153
|
|
154
|
-
# The output style. See {file:SASS_REFERENCE.md#
|
154
|
+
# The output style. See {file:SASS_REFERENCE.md#Options the Sass options documentation}.
|
155
155
|
#
|
156
156
|
# @return [Symbol]
|
157
157
|
def style
|
data/lib/sass/tree/rule_node.rb
CHANGED
@@ -137,10 +137,19 @@ module Sass::Tree
|
|
137
137
|
|
138
138
|
# We don't use real filename/line info because we don't have it yet.
|
139
139
|
# When we get it, we'll set it on the parsed rules if possible.
|
140
|
-
parser =
|
141
|
-
|
142
|
-
|
143
|
-
|
140
|
+
parser = nil
|
141
|
+
warnings = Sass::Util.silence_warnings do
|
142
|
+
parser = Sass::SCSS::StaticParser.new(@rule.join.strip, nil, nil, 1)
|
143
|
+
# rubocop:disable RescueModifier
|
144
|
+
@parsed_rules = parser.parse_selector rescue nil
|
145
|
+
# rubocop:enable RescueModifier
|
146
|
+
|
147
|
+
$stderr.string
|
148
|
+
end
|
149
|
+
|
150
|
+
# If parsing produces a warning, throw away the result so we can parse
|
151
|
+
# later with the real filename info.
|
152
|
+
@parsed_rules = nil unless warnings.empty?
|
144
153
|
end
|
145
154
|
end
|
146
155
|
end
|
@@ -55,7 +55,7 @@ class Sass::Tree::Visitors::DeepCopy < Sass::Tree::Visitors::Base
|
|
55
55
|
|
56
56
|
def visit_mixin(node)
|
57
57
|
node.args = node.args.map {|a| a.deep_copy}
|
58
|
-
node.keywords = Hash[node.keywords.map {|k, v| [k, v.deep_copy]}]
|
58
|
+
node.keywords = Sass::Util::NormalizedMap.new(Hash[node.keywords.map {|k, v| [k, v.deep_copy]}])
|
59
59
|
yield
|
60
60
|
end
|
61
61
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# A visitor for converting a dynamic Sass tree into a static Sass tree.
|
2
2
|
class Sass::Tree::Visitors::Perform < Sass::Tree::Visitors::Base
|
3
|
+
@@function_name_deprecation = Sass::Deprecation.new
|
4
|
+
|
3
5
|
class << self
|
4
6
|
# @param root [Tree::Node] The root node of the tree to visit.
|
5
7
|
# @param environment [Sass::Environment] The lexical environment.
|
@@ -280,8 +282,7 @@ class Sass::Tree::Visitors::Perform < Sass::Tree::Visitors::Base
|
|
280
282
|
|
281
283
|
if node.normalized_name == 'calc' || node.normalized_name == 'element' ||
|
282
284
|
node.name == 'expression' || node.name == 'url'
|
283
|
-
|
284
|
-
DEPRECATION WARNING on line #{node.line}#{" of #{node.filename}" if node.filename}:
|
285
|
+
@@function_name_deprecation.warn(node.filename, node.line, <<WARNING)
|
285
286
|
Naming a function "#{node.name}" is disallowed and will be an error in future versions of Sass.
|
286
287
|
This name conflicts with an existing CSS function with special parse rules.
|
287
288
|
WARNING
|
@@ -13,7 +13,7 @@ foo bar {
|
|
13
13
|
bip: bop;
|
14
14
|
}
|
15
15
|
SCSS
|
16
|
-
assert_renders <<SASS, <<SCSS, :old => true
|
16
|
+
silence_warnings {assert_renders <<SASS, <<SCSS, :old => true}
|
17
17
|
foo bar
|
18
18
|
:baz bang
|
19
19
|
:bip bop
|
@@ -183,7 +183,7 @@ SCSS
|
|
183
183
|
end
|
184
184
|
|
185
185
|
def test_dynamic_properties_with_old
|
186
|
-
assert_renders <<SASS, <<SCSS, :old => true
|
186
|
+
silence_warnings {assert_renders <<SASS, <<SCSS, :old => true}
|
187
187
|
foo bar
|
188
188
|
:baz 12 $bang "bip"
|
189
189
|
SASS
|
@@ -1436,7 +1436,7 @@ SCSS
|
|
1436
1436
|
end
|
1437
1437
|
|
1438
1438
|
def test_old_declaration_hacks
|
1439
|
-
assert_renders <<SASS, <<SCSS, :old => true
|
1439
|
+
silence_warnings {assert_renders <<SASS, <<SCSS, :old => true}
|
1440
1440
|
foo
|
1441
1441
|
:_name val
|
1442
1442
|
:*name val
|
data/test/sass/css2sass_test.rb
CHANGED
data/test/sass/engine_test.rb
CHANGED
@@ -288,10 +288,10 @@ ERROR
|
|
288
288
|
def test_exception_line
|
289
289
|
to_render = <<SASS
|
290
290
|
rule
|
291
|
-
:
|
291
|
+
prop: val
|
292
292
|
// comment!
|
293
293
|
|
294
|
-
:
|
294
|
+
broken:
|
295
295
|
SASS
|
296
296
|
begin
|
297
297
|
Sass::Engine.new(to_render).render
|
@@ -305,10 +305,10 @@ SASS
|
|
305
305
|
def test_exception_location
|
306
306
|
to_render = <<SASS
|
307
307
|
rule
|
308
|
-
:
|
308
|
+
prop: val
|
309
309
|
// comment!
|
310
310
|
|
311
|
-
:
|
311
|
+
broken:
|
312
312
|
SASS
|
313
313
|
begin
|
314
314
|
Sass::Engine.new(to_render, :filename => FAKE_FILE_NAME, :line => (__LINE__-7)).render
|
@@ -749,22 +749,22 @@ SASS
|
|
749
749
|
|
750
750
|
def test_basic_multiline_selector
|
751
751
|
assert_equal("#foo #bar,\n#baz #boom {\n foo: bar; }\n",
|
752
|
-
render("#foo #bar,\n#baz #boom\n :
|
752
|
+
render("#foo #bar,\n#baz #boom\n foo: bar"))
|
753
753
|
assert_equal("#foo #bar,\n#foo #baz {\n foo: bar; }\n",
|
754
|
-
render("#foo\n #bar,\n #baz\n :
|
754
|
+
render("#foo\n #bar,\n #baz\n foo: bar"))
|
755
755
|
assert_equal("#foo,\n#bar {\n foo: bar; }\n #foo #baz,\n #bar #baz {\n foo: bar; }\n",
|
756
|
-
render("#foo,\n#bar\n :
|
756
|
+
render("#foo,\n#bar\n foo: bar\n #baz\n foo: bar"))
|
757
757
|
assert_equal("#foo #bar, #baz #boom { foo: bar; }\n",
|
758
|
-
render("#foo #bar,\n#baz #boom\n :
|
758
|
+
render("#foo #bar,\n#baz #boom\n foo: bar", :style => :compact))
|
759
759
|
|
760
760
|
assert_equal("#foo #bar,#baz #boom{foo:bar}\n",
|
761
|
-
render("#foo #bar,\n#baz #boom\n :
|
761
|
+
render("#foo #bar,\n#baz #boom\n foo: bar", :style => :compressed))
|
762
762
|
|
763
763
|
assert_equal("#foo #bar,\n#baz #boom {\n foo: bar; }\n",
|
764
|
-
render("#foo #bar,,\n,#baz #boom,\n :
|
764
|
+
render("#foo #bar,,\n,#baz #boom,\n foo: bar"))
|
765
765
|
|
766
766
|
assert_equal("#bip #bop {\n foo: bar; }\n",
|
767
|
-
render("#bip #bop,, ,\n :
|
767
|
+
render("#bip #bop,, ,\n foo: bar"))
|
768
768
|
end
|
769
769
|
|
770
770
|
def test_complex_multiline_selector
|
@@ -783,7 +783,7 @@ SASS
|
|
783
783
|
end
|
784
784
|
|
785
785
|
begin
|
786
|
-
render("a\n :b c", :property_syntax => :new)
|
786
|
+
silence_warnings {render("a\n :b c", :property_syntax => :new)}
|
787
787
|
assert_equal(2, e.sass_line)
|
788
788
|
rescue Sass::SyntaxError => e
|
789
789
|
assert_equal("Illegal property syntax: can't use old syntax when :property_syntax => :new is set.",
|
@@ -806,53 +806,53 @@ SASS
|
|
806
806
|
def test_directive
|
807
807
|
assert_equal("@a b;\n", render("@a b"))
|
808
808
|
|
809
|
-
assert_equal("@a {\n b: c; }\n", render("@a\n :
|
810
|
-
assert_equal("@a { b: c; }\n", render("@a\n :
|
811
|
-
assert_equal("@a {\n b: c;\n}\n", render("@a\n :
|
812
|
-
assert_equal("@a{b:c}\n", render("@a\n :
|
809
|
+
assert_equal("@a {\n b: c; }\n", render("@a\n b: c"))
|
810
|
+
assert_equal("@a { b: c; }\n", render("@a\n b: c", :style => :compact))
|
811
|
+
assert_equal("@a {\n b: c;\n}\n", render("@a\n b: c", :style => :expanded))
|
812
|
+
assert_equal("@a{b:c}\n", render("@a\n b: c", :style => :compressed))
|
813
813
|
|
814
814
|
assert_equal("@a {\n b: c;\n d: e; }\n",
|
815
|
-
render("@a\n :
|
815
|
+
render("@a\n b: c\n d: e"))
|
816
816
|
assert_equal("@a { b: c; d: e; }\n",
|
817
|
-
render("@a\n :
|
817
|
+
render("@a\n b: c\n d: e", :style => :compact))
|
818
818
|
assert_equal("@a {\n b: c;\n d: e;\n}\n",
|
819
|
-
render("@a\n :
|
819
|
+
render("@a\n b: c\n d: e", :style => :expanded))
|
820
820
|
assert_equal("@a{b:c;d:e}\n",
|
821
|
-
render("@a\n :
|
821
|
+
render("@a\n b: c\n d: e", :style => :compressed))
|
822
822
|
|
823
823
|
assert_equal("@a {\n #b {\n c: d; } }\n",
|
824
|
-
render("@a\n #b\n :
|
824
|
+
render("@a\n #b\n c: d"))
|
825
825
|
assert_equal("@a { #b { c: d; } }\n",
|
826
|
-
render("@a\n #b\n :
|
826
|
+
render("@a\n #b\n c: d", :style => :compact))
|
827
827
|
assert_equal("@a {\n #b {\n c: d;\n }\n}\n",
|
828
|
-
render("@a\n #b\n :
|
828
|
+
render("@a\n #b\n c: d", :style => :expanded))
|
829
829
|
assert_equal("@a{#b{c:d}}\n",
|
830
|
-
render("@a\n #b\n :
|
830
|
+
render("@a\n #b\n c: d", :style => :compressed))
|
831
831
|
|
832
832
|
assert_equal("@a {\n #b {\n a: b; }\n #b #c {\n d: e; } }\n",
|
833
|
-
render("@a\n #b\n :
|
833
|
+
render("@a\n #b\n a: b\n #c\n d: e"))
|
834
834
|
assert_equal("@a { #b { a: b; }\n #b #c { d: e; } }\n",
|
835
|
-
render("@a\n #b\n :
|
835
|
+
render("@a\n #b\n a: b\n #c\n d: e", :style => :compact))
|
836
836
|
assert_equal("@a {\n #b {\n a: b;\n }\n #b #c {\n d: e;\n }\n}\n",
|
837
|
-
render("@a\n #b\n :
|
837
|
+
render("@a\n #b\n a: b\n #c\n d: e", :style => :expanded))
|
838
838
|
assert_equal("@a{#b{a:b}#b #c{d:e}}\n",
|
839
|
-
render("@a\n #b\n :
|
839
|
+
render("@a\n #b\n a: b\n #c\n d: e", :style => :compressed))
|
840
840
|
|
841
841
|
assert_equal("@a {\n #foo,\n #bar {\n b: c; } }\n",
|
842
|
-
render("@a\n #foo, \n #bar\n :
|
842
|
+
render("@a\n #foo, \n #bar\n b: c"))
|
843
843
|
assert_equal("@a { #foo, #bar { b: c; } }\n",
|
844
|
-
render("@a\n #foo, \n #bar\n :
|
844
|
+
render("@a\n #foo, \n #bar\n b: c", :style => :compact))
|
845
845
|
assert_equal("@a {\n #foo,\n #bar {\n b: c;\n }\n}\n",
|
846
|
-
render("@a\n #foo, \n #bar\n :
|
846
|
+
render("@a\n #foo, \n #bar\n b: c", :style => :expanded))
|
847
847
|
assert_equal("@a{#foo,#bar{b:c}}\n",
|
848
|
-
render("@a\n #foo, \n #bar\n :
|
848
|
+
render("@a\n #foo, \n #bar\n b: c", :style => :compressed))
|
849
849
|
|
850
850
|
to_render = <<END
|
851
851
|
@a
|
852
|
-
:
|
852
|
+
b: c
|
853
853
|
#d
|
854
|
-
:
|
855
|
-
:
|
854
|
+
e: f
|
855
|
+
g: h
|
856
856
|
END
|
857
857
|
rendered = <<END
|
858
858
|
@a { b: c;
|
@@ -1141,7 +1141,7 @@ black {
|
|
1141
1141
|
color: #000; }
|
1142
1142
|
CSS
|
1143
1143
|
=foo($a: #FFF)
|
1144
|
-
:
|
1144
|
+
color: $a
|
1145
1145
|
white
|
1146
1146
|
+foo
|
1147
1147
|
black
|
@@ -1165,9 +1165,9 @@ three {
|
|
1165
1165
|
CSS
|
1166
1166
|
$a: 5px
|
1167
1167
|
=foo($a, $b: 1px, $c: 3px + $b)
|
1168
|
-
:
|
1169
|
-
:
|
1170
|
-
:
|
1168
|
+
color: $a
|
1169
|
+
padding: $b
|
1170
|
+
margin: $c
|
1171
1171
|
one
|
1172
1172
|
+foo(#fff)
|
1173
1173
|
two
|
@@ -2598,29 +2598,29 @@ SASS
|
|
2598
2598
|
border-style: solid; }
|
2599
2599
|
RESULT
|
2600
2600
|
.box
|
2601
|
-
:
|
2602
|
-
|
2603
|
-
:
|
2601
|
+
border:
|
2602
|
+
//color: black
|
2603
|
+
style: solid
|
2604
2604
|
SOURCE
|
2605
2605
|
|
2606
2606
|
assert_equal(<<RESULT, render(<<SOURCE))
|
2607
2607
|
.box {
|
2608
|
-
/* :
|
2608
|
+
/* color: black */
|
2609
2609
|
border-style: solid; }
|
2610
2610
|
RESULT
|
2611
2611
|
.box
|
2612
|
-
:
|
2613
|
-
/* :
|
2614
|
-
:
|
2612
|
+
border:
|
2613
|
+
/* color: black
|
2614
|
+
style: solid
|
2615
2615
|
SOURCE
|
2616
2616
|
|
2617
2617
|
assert_equal(<<RESULT, render(<<SOURCE, :style => :compressed))
|
2618
2618
|
.box{border-style:solid}
|
2619
2619
|
RESULT
|
2620
2620
|
.box
|
2621
|
-
:
|
2622
|
-
|
2623
|
-
:
|
2621
|
+
border:
|
2622
|
+
/*color: black
|
2623
|
+
style: solid
|
2624
2624
|
SOURCE
|
2625
2625
|
end
|
2626
2626
|
|
@@ -3394,7 +3394,13 @@ SASS
|
|
3394
3394
|
private
|
3395
3395
|
|
3396
3396
|
def assert_hash_has(hash, expected)
|
3397
|
-
expected.each
|
3397
|
+
expected.each do |k, v|
|
3398
|
+
if v.nil?
|
3399
|
+
assert_nil(hash[k])
|
3400
|
+
else
|
3401
|
+
assert_equal(v, hash[k])
|
3402
|
+
end
|
3403
|
+
end
|
3398
3404
|
end
|
3399
3405
|
|
3400
3406
|
def assert_renders_encoded(css, sass)
|
data/test/sass/extend_test.rb
CHANGED
@@ -573,21 +573,27 @@ SCSS
|
|
573
573
|
## Long Extendees
|
574
574
|
|
575
575
|
def test_long_extendee
|
576
|
-
assert_extends '.foo.bar', '.baz {@extend .foo.bar}', '.foo.bar, .baz'
|
576
|
+
assert_warning(<<WARNING) {assert_extends '.foo.bar', '.baz {@extend .foo.bar}', '.foo.bar, .baz'}
|
577
|
+
DEPRECATION WARNING on line 2 of test_long_extendee_inline.scss:
|
578
|
+
Extending a compound selector, .foo.bar, is deprecated and will not be supported in a future release.
|
579
|
+
See https://github.com/sass/sass/issues/1599 for details.
|
580
|
+
WARNING
|
577
581
|
end
|
578
582
|
|
579
583
|
def test_long_extendee_requires_all_selectors
|
580
|
-
|
581
|
-
|
584
|
+
silence_warnings do
|
585
|
+
assert_extend_doesnt_match('.baz', '.foo.bar', :not_found, 2) do
|
586
|
+
render_extends '.foo', '.baz {@extend .foo.bar}'
|
587
|
+
end
|
582
588
|
end
|
583
589
|
end
|
584
590
|
|
585
591
|
def test_long_extendee_matches_supersets
|
586
|
-
assert_extends '.foo.bar.bap', '.baz {@extend .foo.bar}', '.foo.bar.bap, .bap.baz'
|
592
|
+
silence_warnings {assert_extends '.foo.bar.bap', '.baz {@extend .foo.bar}', '.foo.bar.bap, .bap.baz'}
|
587
593
|
end
|
588
594
|
|
589
595
|
def test_long_extendee_runs_unification
|
590
|
-
assert_extends 'ns|*.foo.bar', '*|a.baz {@extend .foo.bar}', 'ns|*.foo.bar, ns|a.baz'
|
596
|
+
silence_warnings {assert_extends 'ns|*.foo.bar', '*|a.baz {@extend .foo.bar}', 'ns|*.foo.bar, ns|a.baz'}
|
591
597
|
end
|
592
598
|
|
593
599
|
## Long Extenders
|
@@ -683,9 +689,9 @@ SCSS
|
|
683
689
|
end
|
684
690
|
|
685
691
|
def test_nested_extender_doesnt_find_common_selectors_around_reference_selector
|
686
|
-
assert_extends 'a /for/ b c .c1', 'a c .c2 {@extend .c1}', 'a /for/ b c .c1, a /for/ b a c .c2, a a /for/ b c .c2'
|
687
|
-
assert_extends 'a /for/ b c .c1', 'a b .c2 {@extend .c1}', 'a /for/ b c .c1, a a /for/ b c .c2'
|
688
|
-
assert_extends 'a /for/ b c .c1', 'b c .c2 {@extend .c1}', 'a /for/ b c .c1, a /for/ b c .c2'
|
692
|
+
silence_warnings {assert_extends 'a /for/ b c .c1', 'a c .c2 {@extend .c1}', 'a /for/ b c .c1, a /for/ b a c .c2, a a /for/ b c .c2'}
|
693
|
+
silence_warnings {assert_extends 'a /for/ b c .c1', 'a b .c2 {@extend .c1}', 'a /for/ b c .c1, a a /for/ b c .c2'}
|
694
|
+
silence_warnings {assert_extends 'a /for/ b c .c1', 'b c .c2 {@extend .c1}', 'a /for/ b c .c1, a /for/ b c .c2'}
|
689
695
|
end
|
690
696
|
|
691
697
|
def test_nested_extender_with_early_child_selectors_doesnt_subseq_them
|