sass 3.4.0.rc.1 → 3.4.0.rc.2
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/MIT-LICENSE +1 -1
- data/README.md +5 -5
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/lib/sass/exec/sass_scss.rb +6 -1
- data/lib/sass/features.rb +1 -0
- data/lib/sass/script/functions.rb +7 -4
- data/lib/sass/script/lexer.rb +2 -1
- data/lib/sass/script/tree/interpolation.rb +1 -1
- data/lib/sass/script/tree/string_interpolation.rb +1 -1
- data/lib/sass/script/value/base.rb +5 -4
- data/lib/sass/script/value/color.rb +1 -1
- data/lib/sass/script/value/string.rb +7 -3
- data/lib/sass/selector/comma_sequence.rb +2 -1
- data/lib/sass/supports.rb +1 -2
- data/lib/sass/tree/visitors/perform.rb +1 -4
- data/test/sass/engine_test.rb +2 -2
- data/test/sass/functions_test.rb +1 -0
- data/test/sass/script_test.rb +37 -0
- data/test/sass/scss/scss_test.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1afd394b8f5238ff1c9946a07f19a8931388586a
|
4
|
+
data.tar.gz: 4832e49d858cfd6602d9b1bd53b5e834c48ba86e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cfae679887b0e482a3a5f95bf20aab324acfade3778e8d3b8bd4ae6cec41a71b9e38618cbed02443226af2ed5815e0486de24384ff1e54f004e19c966022604
|
7
|
+
data.tar.gz: cd272dda7c81e9a33885884080f462964db6312f36626df4f61867a4b939f5958d12562b6115438cd8bb15c6fcf5d8378b01952da0773366dbff9f3b1577ae22
|
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2006-2013 Hampton Catlin,
|
1
|
+
Copyright (c) 2006-2013 Hampton Catlin, Natalie Weizenbaum, and Chris Eppstein
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -199,11 +199,11 @@ and now occasionally consults on the language issues. Hampton lives in San
|
|
199
199
|
Francisco, California and works as VP of Technology
|
200
200
|
at [Moovweb](http://www.moovweb.com/).
|
201
201
|
|
202
|
-
[
|
203
|
-
Sass.
|
202
|
+
[Natalie Weizenbaum](http://nex-3.com) is the primary developer and architect of
|
203
|
+
Sass. Her hard work has kept the project alive by endlessly answering forum
|
204
204
|
posts, fixing bugs, refactoring, finding speed improvements, writing
|
205
205
|
documentation, implementing new features, and getting Hampton coffee (a fitting
|
206
|
-
task for a
|
206
|
+
task for a girl genius). Natalie lives in Seattle, Washington and works on
|
207
207
|
[Dart](http://dartlang.org) application libraries at Google.
|
208
208
|
|
209
209
|
[Chris Eppstein](http://acts-as-architect.blogspot.com) is a core contributor to
|
@@ -214,8 +214,8 @@ his wife and daughter. He is an Engineer for
|
|
214
214
|
[LinkedIn.com](http://linkedin.com), where one of his responsibilities is to
|
215
215
|
maintain Sass & Compass.
|
216
216
|
|
217
|
-
If you use this software, you must pay Hampton a compliment. And
|
218
|
-
|
217
|
+
If you use this software, you must pay Hampton a compliment. And buy Natalie
|
218
|
+
some candy. Maybe pet a kitten. Yeah. Pet that kitty.
|
219
219
|
|
220
220
|
Beyond that, the implementation is licensed under the MIT License.
|
221
221
|
Okay, fine, I guess that means compliments aren't __required__.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.4.0.rc.
|
1
|
+
3.4.0.rc.2
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
26 July 2014 00:40:24 UTC
|
data/lib/sass/exec/sass_scss.rb
CHANGED
@@ -69,7 +69,7 @@ END
|
|
69
69
|
opts.separator 'Common Options:'
|
70
70
|
|
71
71
|
opts.on('-I', '--load-path PATH', 'Specify a Sass import path.') do |path|
|
72
|
-
@options[:for_engine][:load_paths] << path
|
72
|
+
(@options[:for_engine][:load_paths] ||= []) << path
|
73
73
|
end
|
74
74
|
|
75
75
|
opts.on('-r', '--require LIB', 'Require a Ruby library before running Sass.') do |lib|
|
@@ -159,6 +159,11 @@ END
|
|
159
159
|
$stderr.puts "Unknown sourcemap type #{type}.\n\n"
|
160
160
|
$stderr.puts opts
|
161
161
|
exit
|
162
|
+
elsif type.nil?
|
163
|
+
Sass::Util.sass_warn <<MESSAGE.rstrip
|
164
|
+
DEPRECATION WARNING: Passing --sourcemap without a value is deprecated.
|
165
|
+
Sourcemaps are now generated by default, so this flag has no effect.
|
166
|
+
MESSAGE
|
162
167
|
end
|
163
168
|
|
164
169
|
@options[:sourcemap] = (type || :auto).to_sym
|
data/lib/sass/features.rb
CHANGED
@@ -1514,6 +1514,7 @@ module Sass::Script
|
|
1514
1514
|
end_at = number(-1) if end_at.nil?
|
1515
1515
|
assert_unit end_at, nil, "end-at"
|
1516
1516
|
|
1517
|
+
return Sass::Script::Value::String.new("", string.type) if end_at.value == 0
|
1517
1518
|
s = start_at.value > 0 ? start_at.value - 1 : start_at.value
|
1518
1519
|
e = end_at.value > 0 ? end_at.value - 1 : end_at.value
|
1519
1520
|
s = string.value.length + s if s < 0
|
@@ -1578,8 +1579,8 @@ module Sass::Script
|
|
1578
1579
|
#
|
1579
1580
|
# The following features are supported:
|
1580
1581
|
#
|
1581
|
-
# * `global-variable-
|
1582
|
-
# global variable unless `!global` is used.
|
1582
|
+
# * `global-variable-shadowing` indicates that a local variable will shadow
|
1583
|
+
# a global variable unless `!global` is used.
|
1583
1584
|
#
|
1584
1585
|
# * `extend-selector-pseudoclass` indicates that `@extend` will reach into
|
1585
1586
|
# selector pseudoclasses like `:not`.
|
@@ -1589,6 +1590,8 @@ module Sass::Script
|
|
1589
1590
|
#
|
1590
1591
|
# [Values and Units Level 3]: http://www.w3.org/TR/css3-values/
|
1591
1592
|
#
|
1593
|
+
# * `at-error` indicates that the Sass `@error` directive is supported.
|
1594
|
+
#
|
1592
1595
|
# @example
|
1593
1596
|
# feature-exists(some-feature-that-exists) => true
|
1594
1597
|
# feature-exists(what-is-this-i-dont-know) => false
|
@@ -2461,7 +2464,7 @@ module Sass::Script
|
|
2461
2464
|
#
|
2462
2465
|
# @example
|
2463
2466
|
# selector-replace(".foo .bar", ".bar", ".baz") => ".foo .baz"
|
2464
|
-
# selector-replace(".foo.bar.baz", ".foo.baz", ".qux") => ".
|
2467
|
+
# selector-replace(".foo.bar.baz", ".foo.baz", ".qux") => ".bar.qux"
|
2465
2468
|
#
|
2466
2469
|
# @overload selector_replace($selector, $original, $replacement)
|
2467
2470
|
# @param $selector [Sass::Script::Value::String, Sass::Script::Value::List]
|
@@ -2569,7 +2572,7 @@ module Sass::Script
|
|
2569
2572
|
# is-superselector(".foo", ".foo.bar") => true
|
2570
2573
|
# is-superselector(".foo.bar", ".foo") => false
|
2571
2574
|
# is-superselector(".bar", ".foo .bar") => true
|
2572
|
-
# is-superselector(".foo .bar", ".bar") =>
|
2575
|
+
# is-superselector(".foo .bar", ".bar") => false
|
2573
2576
|
#
|
2574
2577
|
# @overload is_superselector($super, $sub)
|
2575
2578
|
# @param $super [Sass::Script::Value::String, Sass::Script::Value::List]
|
data/lib/sass/script/lexer.rb
CHANGED
@@ -278,8 +278,9 @@ module Sass
|
|
278
278
|
line, offset = @line, @offset
|
279
279
|
return unless scan(STRING_REGULAR_EXPRESSIONS[re][open])
|
280
280
|
if @scanner[0] =~ /([^\\]|^)\n/
|
281
|
+
filename = @options[:filename]
|
281
282
|
Sass::Util.sass_warn <<MESSAGE
|
282
|
-
DEPRECATION WARNING on line #{line}, column #{offset}#{" of #{
|
283
|
+
DEPRECATION WARNING on line #{line}, column #{offset}#{" of #{filename}" if filename}:
|
283
284
|
Unescaped multiline strings are deprecated and will be removed in a future version of Sass.
|
284
285
|
To include a newline in a string, use "\\a" or "\\a " as in CSS.
|
285
286
|
MESSAGE
|
@@ -109,7 +109,7 @@ If you really want to use the color value here, use `#{alternative.to_sass}'.
|
|
109
109
|
MESSAGE
|
110
110
|
end
|
111
111
|
|
112
|
-
res <<
|
112
|
+
res << val.to_s(:quote => :none)
|
113
113
|
res << " " if @after && @whitespace_after
|
114
114
|
res << @after.perform(environment).to_s if @after
|
115
115
|
opts(Sass::Script::Value::String.new(res))
|
@@ -81,7 +81,7 @@ module Sass::Script::Tree
|
|
81
81
|
before = @before.perform(environment)
|
82
82
|
res << before.value
|
83
83
|
mid = @mid.perform(environment)
|
84
|
-
res << (mid.is_a?(Sass::Script::Value::String) ? mid.value : mid.to_s)
|
84
|
+
res << (mid.is_a?(Sass::Script::Value::String) ? mid.value : mid.to_s(:quote => :none))
|
85
85
|
res << @after.perform(environment).value
|
86
86
|
opts(Sass::Script::Value::String.new(res, before.type))
|
87
87
|
end
|
@@ -96,10 +96,8 @@ MSG
|
|
96
96
|
# @return [Script::Value::String] A string containing both values
|
97
97
|
# without any separation
|
98
98
|
def plus(other)
|
99
|
-
|
100
|
-
|
101
|
-
end
|
102
|
-
Sass::Script::Value::String.new(to_s + other.to_s)
|
99
|
+
type = other.is_a?(Sass::Script::Value::String) ? other.type : :identifier
|
100
|
+
Sass::Script::Value::String.new(to_s(:quote => :none) + other.to_s(:quote => :none), type)
|
103
101
|
end
|
104
102
|
|
105
103
|
# The SassScript `-` operation.
|
@@ -213,6 +211,9 @@ MSG
|
|
213
211
|
# Returns the string representation of this value
|
214
212
|
# as it would be output to the CSS document.
|
215
213
|
#
|
214
|
+
# @options opts :quote [String]
|
215
|
+
# The preferred quote style for quoted strings. If `:none`, strings are
|
216
|
+
# always emitted unquoted.
|
216
217
|
# @return [String]
|
217
218
|
def to_s(opts = {})
|
218
219
|
Sass::Util.abstract(self)
|
@@ -71,13 +71,17 @@ module Sass::Script::Value
|
|
71
71
|
|
72
72
|
# @see Value#plus
|
73
73
|
def plus(other)
|
74
|
-
|
75
|
-
|
74
|
+
other_value = if other.is_a?(Sass::Script::Value::String)
|
75
|
+
other.value
|
76
|
+
else
|
77
|
+
other.to_s(:quote => :none)
|
78
|
+
end
|
79
|
+
Sass::Script::Value::String.new(value + other_value, type)
|
76
80
|
end
|
77
81
|
|
78
82
|
# @see Value#to_s
|
79
83
|
def to_s(opts = {})
|
80
|
-
return @value.gsub(/\n\s*/, ' ') if @type == :identifier
|
84
|
+
return @value.gsub(/\n\s*/, ' ') if opts[:quote] == :none || @type == :identifier
|
81
85
|
Sass::Script::Value::String.quote(value, opts[:quote])
|
82
86
|
end
|
83
87
|
|
@@ -142,8 +142,9 @@ module Sass
|
|
142
142
|
def to_sass_script
|
143
143
|
Sass::Script::Value::List.new(members.map do |seq|
|
144
144
|
Sass::Script::Value::List.new(seq.members.map do |component|
|
145
|
+
next if component == "\n"
|
145
146
|
Sass::Script::Value::String.new(component.to_s)
|
146
|
-
end, :space)
|
147
|
+
end.compact, :space)
|
147
148
|
end, :comma)
|
148
149
|
end
|
149
150
|
|
data/lib/sass/supports.rb
CHANGED
@@ -203,8 +203,7 @@ module Sass::Supports
|
|
203
203
|
end
|
204
204
|
|
205
205
|
def perform(env)
|
206
|
-
|
207
|
-
@resolved_value = val.is_a?(Sass::Script::Value::String) ? val.value : val.to_s
|
206
|
+
@resolved_value = value.perform(env).to_s(:quote => :none)
|
208
207
|
end
|
209
208
|
|
210
209
|
def to_css
|
@@ -515,10 +515,7 @@ class Sass::Tree::Visitors::Perform < Sass::Tree::Visitors::Base
|
|
515
515
|
def run_interp_no_strip(text)
|
516
516
|
text.map do |r|
|
517
517
|
next r if r.is_a?(String)
|
518
|
-
|
519
|
-
# Interpolated strings should never render with quotes
|
520
|
-
next val.value if val.is_a?(Sass::Script::Value::String)
|
521
|
-
val.to_s
|
518
|
+
r.perform(@environment).to_s(:quote => :none)
|
522
519
|
end.join
|
523
520
|
end
|
524
521
|
|
data/test/sass/engine_test.rb
CHANGED
@@ -2014,10 +2014,10 @@ $var: "bar"
|
|
2014
2014
|
SASS
|
2015
2015
|
end
|
2016
2016
|
|
2017
|
-
def
|
2017
|
+
def test_interpolation_deep_unquotes_strings
|
2018
2018
|
assert_equal(<<CSS, render(<<SASS))
|
2019
2019
|
.foo {
|
2020
|
-
a:
|
2020
|
+
a: bar baz; }
|
2021
2021
|
CSS
|
2022
2022
|
.foo
|
2023
2023
|
a: \#{"bar" "baz"}
|
data/test/sass/functions_test.rb
CHANGED
@@ -945,6 +945,7 @@ class SassFunctionTest < MiniTest::Test
|
|
945
945
|
assert_equal('ab', evaluate('str-slice(abcd,1,2)')) # for completeness
|
946
946
|
assert_equal('abcd', evaluate('str-slice(abcd,1,4)')) # at the end points
|
947
947
|
assert_equal('abcd', evaluate('str-slice(abcd,0,4)')) # when start is before the start of the string
|
948
|
+
assert_equal('', evaluate('str-slice(abcd,1,0)')) # when end is before the start of the string
|
948
949
|
assert_equal('abcd', evaluate('str-slice(abcd,1,100)')) # when end is past the end of the string
|
949
950
|
assert_equal('', evaluate('str-slice(abcd,2,1)')) # when end is before start
|
950
951
|
assert_equal('"bc"', evaluate('str-slice("abcd",2,3)')) # when used with a quoted string
|
data/test/sass/script_test.rb
CHANGED
@@ -206,6 +206,11 @@ class SassScriptTest < MiniTest::Test
|
|
206
206
|
assert_equal "foo1bar5baz4bang", resolve('\'foo#{1 + "bar#{2 + 3}baz" + 4}bang\'')
|
207
207
|
end
|
208
208
|
|
209
|
+
def test_interpolation_with_newline
|
210
|
+
assert_equal "\nbang", resolve('"#{"\a "}bang"')
|
211
|
+
assert_equal "\n\nbang", resolve('"#{"\a "}\a bang"')
|
212
|
+
end
|
213
|
+
|
209
214
|
def test_rule_interpolation
|
210
215
|
assert_equal(<<CSS, render(<<SASS))
|
211
216
|
foo bar baz bang {
|
@@ -342,6 +347,7 @@ SASS
|
|
342
347
|
assert_equal '"foo", "bar"', resolve("'foo' , 'bar'")
|
343
348
|
assert_equal "true, 1", resolve('true , 1')
|
344
349
|
assert_equal "foobar", resolve('"foo" + "bar"')
|
350
|
+
assert_equal "\nfoo\nxyz", resolve('"\a foo" + "\axyz"')
|
345
351
|
assert_equal "true1", resolve('true + 1')
|
346
352
|
assert_equal '"foo"-"bar"', resolve("'foo' - 'bar'")
|
347
353
|
assert_equal "true-1", resolve('true - 1')
|
@@ -647,6 +653,18 @@ SASS
|
|
647
653
|
assert_equal ".bar", resolve("nth(nth(&, 1), 3)", {}, env)
|
648
654
|
end
|
649
655
|
|
656
|
+
def test_selector_with_newlines
|
657
|
+
env = Sass::Environment.new
|
658
|
+
env.selector = selector(".foo.bar\n.baz.bang,\n\n.bip.bop")
|
659
|
+
assert_equal ".foo.bar .baz.bang, .bip.bop", resolve("&", {}, env)
|
660
|
+
assert_equal ".foo.bar .baz.bang", resolve("nth(&, 1)", {}, env)
|
661
|
+
assert_equal ".bip.bop", resolve("nth(&, 2)", {}, env)
|
662
|
+
assert_equal ".foo.bar", resolve("nth(nth(&, 1), 1)", {}, env)
|
663
|
+
assert_equal ".baz.bang", resolve("nth(nth(&, 1), 2)", {}, env)
|
664
|
+
assert_equal ".bip.bop", resolve("nth(nth(&, 2), 1)", {}, env)
|
665
|
+
assert_equal "string", resolve("type-of(nth(nth(&, 1), 1))", {}, env)
|
666
|
+
end
|
667
|
+
|
650
668
|
def test_setting_global_variable_globally
|
651
669
|
assert_no_warning {assert_equal(<<CSS, render(<<SCSS, :syntax => :scss))}
|
652
670
|
.foo {
|
@@ -822,6 +840,25 @@ SCSS
|
|
822
840
|
|
823
841
|
# Regression Tests
|
824
842
|
|
843
|
+
def test_repeatedly_modified_color
|
844
|
+
assert_equal(<<CSS, render(<<SASS))
|
845
|
+
a {
|
846
|
+
link-color: #161C14;
|
847
|
+
link-color-hover: black;
|
848
|
+
link-color-tap: rgba(22, 28, 20, 0.3); }
|
849
|
+
CSS
|
850
|
+
$green: #161C14
|
851
|
+
$link-color: $green
|
852
|
+
$link-color-hover: darken($link-color, 10%)
|
853
|
+
$link-color-tap: rgba($green, 0.3)
|
854
|
+
|
855
|
+
a
|
856
|
+
link-color: $link-color
|
857
|
+
link-color-hover: $link-color-hover
|
858
|
+
link-color-tap: $link-color-tap
|
859
|
+
SASS
|
860
|
+
end
|
861
|
+
|
825
862
|
def test_inspect_divided_numbers
|
826
863
|
assert_equal "1px/2px", resolve("inspect(1px/2px)")
|
827
864
|
assert_equal "0.5", resolve("inspect((1px/2px))")
|
data/test/sass/scss/scss_test.rb
CHANGED
@@ -3511,7 +3511,7 @@ SCSS
|
|
3511
3511
|
|
3512
3512
|
def test_raw_newline_warning
|
3513
3513
|
assert_warning(<<MESSAGE.rstrip) {assert_equal(<<CSS, render(<<SCSS))}
|
3514
|
-
DEPRECATION WARNING on line 2, column 9:
|
3514
|
+
DEPRECATION WARNING on line 2, column 9 of #{filename_for_test :scss}:
|
3515
3515
|
Unescaped multiline strings are deprecated and will be removed in a future version of Sass.
|
3516
3516
|
To include a newline in a string, use "\\a" or "\\a " as in CSS.
|
3517
3517
|
MESSAGE
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.0.rc.
|
4
|
+
version: 3.4.0.rc.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Natalie Weizenbaum
|
8
8
|
- Chris Eppstein
|
9
9
|
- Hampton Catlin
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-07-
|
13
|
+
date: 2014-07-26 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: yard
|