sass 3.4.22 → 3.4.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +23 -0
- data/README.md +8 -8
- data/Rakefile +2 -10
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/extra/sass-spec-ref.sh +32 -0
- data/lib/sass/cache_stores/filesystem.rb +1 -1
- data/lib/sass/exec/base.rb +1 -1
- data/lib/sass/logger.rb +8 -3
- data/lib/sass/logger/base.rb +8 -2
- data/lib/sass/logger/delayed.rb +50 -0
- data/lib/sass/script/functions.rb +6 -3
- data/lib/sass/script/parser.rb +13 -7
- data/lib/sass/script/value/number.rb +10 -8
- data/lib/sass/scss/parser.rb +23 -5
- data/lib/sass/source/map.rb +3 -1
- data/lib/sass/tree/visitors/convert.rb +3 -1
- data/test/sass/conversion_test.rb +17 -0
- data/test/sass/script_test.rb +3 -3
- data/test/sass/scss/scss_test.rb +33 -0
- metadata +24 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87969e0a80091cd78a2acae89e1fcb30abedcebf
|
4
|
+
data.tar.gz: d7297b39a2a1e46434b89fec0ba878b671a29e14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96e87063a0f068712aeb63593e7861f69db072d306b6005c8a49780bf9553bca1dc1bbfa7d4cef1a8a29d1f198aa636823260af4eaed0f75c0fb45a08c903526
|
7
|
+
data.tar.gz: 8bb8cef35fc3c2d5dd4be949d1a0ebd075f6468dc37d97c8d0af8252ab213788cc66350d636153877a4fa025bf42955ab7a209e8c3401d63b7e8fdea3ac5316e
|
data/CONTRIBUTING.md
CHANGED
@@ -37,6 +37,29 @@ branch, but don't worry about it too much; if you make a request against the
|
|
37
37
|
wrong branch, the maintainer will take responsibility for rebasing it before
|
38
38
|
merging.
|
39
39
|
|
40
|
+
### Testing
|
41
|
+
|
42
|
+
Tests for changes to the Sass language go in
|
43
|
+
[sass-spec](https://github.com/sass/sass-spec) so that other
|
44
|
+
implementations (E.g. libSass) can be tested against the same test
|
45
|
+
suite. The sass-spec repo follows a "trunk development" model in that
|
46
|
+
the tests there test against different version of the Sass language (as
|
47
|
+
opposed to having branches that track different Sass versions). When
|
48
|
+
contributing changes to Sass, update the Gemfile to use sass-spec from a
|
49
|
+
branch or fork that has the new tests. When the feature lands in Sass,
|
50
|
+
the committer will also merge the corresponding sass-spec changes.
|
51
|
+
|
52
|
+
The [documentation of
|
53
|
+
sass-spec](https://github.com/sass/sass-spec/blob/master/README.md)
|
54
|
+
explains how to run sass-spec and contribute changes. In development,
|
55
|
+
Change the Gemfile(s) to use the `:path` option against the sass-spec gem
|
56
|
+
to link your local checkout of sass and sass-spec together in one or
|
57
|
+
both directions.
|
58
|
+
|
59
|
+
Changes to Sass internals or Ruby Sass specific features (E.g.
|
60
|
+
the `sass-convert` tool) should always have tests in the Sass `test`
|
61
|
+
directory following the conventions you see there.
|
62
|
+
|
40
63
|
### Feature Branches
|
41
64
|
|
42
65
|
Sometimes it won't be possible to merge a new feature into `next` or `master`
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Sass [![Gem Version](https://badge.fury.io/rb/sass.
|
1
|
+
# Sass [![Gem Version](https://badge.fury.io/rb/sass.svg)](http://badge.fury.io/rb/sass) [![Inline docs](http://inch-ci.org/github/sass/sass.svg)](http://inch-ci.org/github/sass/sass)
|
2
2
|
|
3
3
|
**Sass makes CSS fun again**. Sass is an extension of CSS,
|
4
4
|
adding nested rules, variables, mixins, selector inheritance, and more.
|
@@ -184,7 +184,7 @@ See `sass-convert --help` for further information and options.
|
|
184
184
|
To run the Sass executables from a source checkout instead of from rubygems:
|
185
185
|
|
186
186
|
```
|
187
|
-
$ cd
|
187
|
+
$ cd sass
|
188
188
|
$ bundle
|
189
189
|
$ bundle exec sass ...
|
190
190
|
$ bundle exec scss ...
|
@@ -199,12 +199,12 @@ 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
|
-
[Natalie Weizenbaum](https://twitter.com/nex3) is the primary developer and
|
203
|
-
Sass. Her hard work has kept the project alive by endlessly
|
204
|
-
posts, fixing bugs, refactoring, finding speed improvements,
|
205
|
-
documentation, implementing new features, and
|
206
|
-
|
207
|
-
|
202
|
+
[Natalie Weizenbaum](https://twitter.com/nex3) is the primary developer and
|
203
|
+
architect of Sass. Her hard work has kept the project alive by endlessly
|
204
|
+
answering forum posts, fixing bugs, refactoring, finding speed improvements,
|
205
|
+
writing documentation, implementing new features, and designing the language.
|
206
|
+
Natalie lives in Seattle, Washington and works on [Dart](http://dartlang.org)
|
207
|
+
application libraries at Google.
|
208
208
|
|
209
209
|
[Chris Eppstein](http://twitter.com/chriseppstein) is a core contributor to
|
210
210
|
Sass and the creator of [Compass](http://compass-style.org/), the first Sass-based framework, and
|
data/Rakefile
CHANGED
@@ -48,8 +48,8 @@ namespace :test do
|
|
48
48
|
end
|
49
49
|
default_options = {
|
50
50
|
:spec_directory => SassSpec::SPEC_DIR,
|
51
|
-
:engine_adapter => SassEngineAdapter.new
|
52
|
-
:generate =>
|
51
|
+
:engine_adapter => SassEngineAdapter.new,
|
52
|
+
:generate => false,
|
53
53
|
:tap => false,
|
54
54
|
:skip => false,
|
55
55
|
:verbose => false,
|
@@ -57,14 +57,6 @@ namespace :test do
|
|
57
57
|
:limit => -1,
|
58
58
|
:unexpected_pass => false,
|
59
59
|
:nuke => false,
|
60
|
-
|
61
|
-
# Constants
|
62
|
-
:output_styles => ["nested"],
|
63
|
-
:input_files => ["input.scss", "input.sass"],
|
64
|
-
:nested_output_file => 'expected_output',
|
65
|
-
:compressed_output_file => 'expected.compressed',
|
66
|
-
:expanded_output_file => 'expected.expanded',
|
67
|
-
:compact_output_file => 'expected.compact'
|
68
60
|
}
|
69
61
|
SassSpec::Runner.new(default_options.merge(sass_spec_options)).run || exit(1)
|
70
62
|
ensure
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.4.
|
1
|
+
3.4.23
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
19 December 2016 23:15:42 UTC
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/bin/bash -e
|
2
|
+
# Copyright 2016 Google Inc. Use of this source code is governed by an MIT-style
|
3
|
+
# license that can be found in the LICENSE file or at
|
4
|
+
# https://opensource.org/licenses/MIT.
|
5
|
+
|
6
|
+
# Echoes the sass-spec Git ref that should be checked out for the current Travis
|
7
|
+
# run. If we're running specs for a pull request which refers to a sass-spec
|
8
|
+
# pull request, we'll run against the latter rather than sass-spec master.
|
9
|
+
|
10
|
+
default=master
|
11
|
+
|
12
|
+
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
|
13
|
+
>&2 echo "TRAVIS_PULL_REQUEST: $TRAVIS_PULL_REQUEST."
|
14
|
+
>&2 echo "Ref: $default."
|
15
|
+
echo "$default"
|
16
|
+
exit 0
|
17
|
+
fi
|
18
|
+
|
19
|
+
>&2 echo "Fetching pull request $TRAVIS_PULL_REQUEST..."
|
20
|
+
|
21
|
+
JSON=$(curl -L -sS https://api.github.com/repos/sass/sass/pulls/$TRAVIS_PULL_REQUEST)
|
22
|
+
|
23
|
+
RE_SPEC_PR="sass\/sass-spec(#|\/pull\/)([0-9]+)"
|
24
|
+
|
25
|
+
if [[ $JSON =~ $RE_SPEC_PR ]]; then
|
26
|
+
ref="pull/${BASH_REMATCH[2]}/head"
|
27
|
+
>&2 echo "Ref: $ref."
|
28
|
+
echo "$ref"
|
29
|
+
else
|
30
|
+
>&2 echo "Ref: $default."
|
31
|
+
echo "$default"
|
32
|
+
fi
|
@@ -36,7 +36,7 @@ module Sass
|
|
36
36
|
def _store(key, version, sha, contents)
|
37
37
|
compiled_filename = path_to(key)
|
38
38
|
FileUtils.mkdir_p(File.dirname(compiled_filename))
|
39
|
-
Sass::Util.atomic_create_and_write_file(compiled_filename
|
39
|
+
Sass::Util.atomic_create_and_write_file(compiled_filename) do |f|
|
40
40
|
f.puts(version)
|
41
41
|
f.puts(sha)
|
42
42
|
f.write(contents)
|
data/lib/sass/exec/base.rb
CHANGED
@@ -23,7 +23,7 @@ module Sass::Exec
|
|
23
23
|
# at_exit is a bit of a hack, but it allows us to rethrow when --trace
|
24
24
|
# is active and get both the built-in exception formatting and the
|
25
25
|
# correct exit code.
|
26
|
-
at_exit {exit 65} if e.is_a?(Sass::SyntaxError)
|
26
|
+
at_exit {exit Sass::Util.windows? ? 13 : 65} if e.is_a?(Sass::SyntaxError)
|
27
27
|
|
28
28
|
raise e if @options[:trace] || e.is_a?(SystemExit)
|
29
29
|
|
data/lib/sass/logger.rb
CHANGED
@@ -2,11 +2,16 @@ module Sass::Logger; end
|
|
2
2
|
|
3
3
|
require "sass/logger/log_level"
|
4
4
|
require "sass/logger/base"
|
5
|
+
require "sass/logger/delayed"
|
5
6
|
|
6
7
|
module Sass
|
7
8
|
class << self
|
8
|
-
|
9
|
-
|
9
|
+
def logger=(l)
|
10
|
+
Thread.current[:sass_logger] = l
|
11
|
+
end
|
10
12
|
|
11
|
-
|
13
|
+
def logger
|
14
|
+
Thread.current[:sass_logger] ||= Sass::Logger::Base.new
|
15
|
+
end
|
16
|
+
end
|
12
17
|
end
|
data/lib/sass/logger/base.rb
CHANGED
@@ -5,6 +5,7 @@ class Sass::Logger::Base
|
|
5
5
|
|
6
6
|
attr_accessor :log_level
|
7
7
|
attr_accessor :disabled
|
8
|
+
attr_accessor :io
|
8
9
|
|
9
10
|
log_level :trace
|
10
11
|
log_level :debug
|
@@ -12,8 +13,9 @@ class Sass::Logger::Base
|
|
12
13
|
log_level :warn
|
13
14
|
log_level :error
|
14
15
|
|
15
|
-
def initialize(log_level = :debug)
|
16
|
+
def initialize(log_level = :debug, io = nil)
|
16
17
|
self.log_level = log_level
|
18
|
+
self.io = io
|
17
19
|
end
|
18
20
|
|
19
21
|
def logging_level?(level)
|
@@ -25,6 +27,10 @@ class Sass::Logger::Base
|
|
25
27
|
end
|
26
28
|
|
27
29
|
def _log(level, message)
|
28
|
-
|
30
|
+
if io
|
31
|
+
io.puts(message)
|
32
|
+
else
|
33
|
+
Kernel.warn(message)
|
34
|
+
end
|
29
35
|
end
|
30
36
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require 'sass/logger/log_level'
|
2
|
+
|
3
|
+
# A logger that delays messages until they're explicitly flushed to an inner
|
4
|
+
# logger.
|
5
|
+
#
|
6
|
+
# This can be installed around the current logger by calling \{#install!}, and
|
7
|
+
# the original logger can be replaced by calling \{#uninstall!}. The log
|
8
|
+
# messages can be flushed by calling \{#flush}.
|
9
|
+
class Sass::Logger::Delayed < Sass::Logger::Base
|
10
|
+
# Installs a new delayed logger as the current Sass logger, wrapping the
|
11
|
+
# original logger.
|
12
|
+
#
|
13
|
+
# This can be undone by calling \{#uninstall!}.
|
14
|
+
#
|
15
|
+
# @return [Sass::Logger::Delayed] The newly-created logger.
|
16
|
+
def self.install!
|
17
|
+
logger = Sass::Logger::Delayed.new(Sass.logger)
|
18
|
+
Sass.logger = logger
|
19
|
+
logger
|
20
|
+
end
|
21
|
+
|
22
|
+
# Creates a delayed logger wrapping `inner`.
|
23
|
+
#
|
24
|
+
# @param inner [Sass::Logger::Base] The wrapped logger.
|
25
|
+
def initialize(inner)
|
26
|
+
self.log_level = inner.log_level
|
27
|
+
@inner = inner
|
28
|
+
@messages = []
|
29
|
+
end
|
30
|
+
|
31
|
+
# Flushes all queued logs to the wrapped logger.
|
32
|
+
def flush
|
33
|
+
@messages.each {|(l, m)| @inner.log(l, m)}
|
34
|
+
end
|
35
|
+
|
36
|
+
# Uninstalls this logger from \{Sass.logger\}. This should only be called if
|
37
|
+
# the logger was installed using \{#install!}
|
38
|
+
def uninstall!
|
39
|
+
if Sass.logger != self
|
40
|
+
throw Exception.new("Can't uninstall a logger that's not currently installed.")
|
41
|
+
end
|
42
|
+
|
43
|
+
@inner.log_level = log_level
|
44
|
+
Sass.logger = @inner
|
45
|
+
end
|
46
|
+
|
47
|
+
def _log(level, message)
|
48
|
+
@messages << [level, message]
|
49
|
+
end
|
50
|
+
end
|
@@ -1305,7 +1305,7 @@ module Sass::Script
|
|
1305
1305
|
# @param $color1 [Sass::Script::Value::Color]
|
1306
1306
|
# @param $color2 [Sass::Script::Value::Color]
|
1307
1307
|
# @param $weight [Sass::Script::Value::Number] The relative weight of each
|
1308
|
-
# color. Closer to `
|
1308
|
+
# color. Closer to `100%` gives more weight to `$color1`, closer to `0%`
|
1309
1309
|
# gives more weight to `$color2`
|
1310
1310
|
# @return [Sass::Script::Value::Color]
|
1311
1311
|
# @raise [ArgumentError] if `$weight` is out of bounds or any parameter is
|
@@ -1546,7 +1546,7 @@ MESSAGE
|
|
1546
1546
|
# @param $start-at [Sass::Script::Value::Number] The index of the first
|
1547
1547
|
# character of the substring. If this is negative, it counts from the end
|
1548
1548
|
# of `$string`
|
1549
|
-
# @param $end-
|
1549
|
+
# @param $end-at [Sass::Script::Value::Number] The index of the last
|
1550
1550
|
# character of the substring. If this is negative, it counts from the end
|
1551
1551
|
# of `$string`. Defaults to -1
|
1552
1552
|
# @return [Sass::Script::Value::String] The substring. This will be quoted
|
@@ -1565,7 +1565,7 @@ MESSAGE
|
|
1565
1565
|
s = string.value.length + s if s < 0
|
1566
1566
|
s = 0 if s < 0
|
1567
1567
|
e = string.value.length + e if e < 0
|
1568
|
-
|
1568
|
+
return Sass::Script::Value::String.new("", string.type) if e < 0
|
1569
1569
|
extracted = string.value.slice(s..e)
|
1570
1570
|
Sass::Script::Value::String.new(extracted || "", string.type)
|
1571
1571
|
end
|
@@ -1611,6 +1611,7 @@ MESSAGE
|
|
1611
1611
|
# type-of(true) => bool
|
1612
1612
|
# type-of(#fff) => color
|
1613
1613
|
# type-of(blue) => color
|
1614
|
+
# type-of(null) => null
|
1614
1615
|
# @overload type_of($value)
|
1615
1616
|
# @param $value [Sass::Script::Value::Base] The value to inspect
|
1616
1617
|
# @return [Sass::Script::Value::String] The unquoted string name of the
|
@@ -2263,6 +2264,7 @@ MESSAGE
|
|
2263
2264
|
# @example
|
2264
2265
|
# $a-false-value: false;
|
2265
2266
|
# variable-exists(a-false-value) => true
|
2267
|
+
# variable-exists(a-null-value) => true
|
2266
2268
|
#
|
2267
2269
|
# variable-exists(nonexistent) => false
|
2268
2270
|
#
|
@@ -2283,6 +2285,7 @@ MESSAGE
|
|
2283
2285
|
# @example
|
2284
2286
|
# $a-false-value: false;
|
2285
2287
|
# global-variable-exists(a-false-value) => true
|
2288
|
+
# global-variable-exists(a-null-value) => true
|
2286
2289
|
#
|
2287
2290
|
# .foo {
|
2288
2291
|
# $some-var: false;
|
data/lib/sass/script/parser.rb
CHANGED
@@ -471,18 +471,24 @@ RUBY
|
|
471
471
|
# `expr`).
|
472
472
|
# @return [Boolean]
|
473
473
|
def is_unsafe_before?(expr, char_before)
|
474
|
-
|
475
|
-
# unless it was wrapped in parentheses.
|
476
|
-
if expr.is_a?(Script::Tree::Literal) &&
|
477
|
-
(expr.value.is_a?(Script::Value::Number) ||
|
478
|
-
(expr.value.is_a?(Script::Value::String) && expr.value.type == :identifier))
|
479
|
-
return char_before == ')'
|
480
|
-
end
|
474
|
+
return char_before == ')' if is_safe_value?(expr)
|
481
475
|
|
482
476
|
# Otherwise, it's only safe if it was another interpolation.
|
483
477
|
!expr.is_a?(Script::Tree::Interpolation)
|
484
478
|
end
|
485
479
|
|
480
|
+
# Returns whether `expr` is safe as the value immediately before an
|
481
|
+
# interpolation.
|
482
|
+
#
|
483
|
+
# It's safe as long as the previous expression is an identifier or number,
|
484
|
+
# or a list whose last element is also safe.
|
485
|
+
def is_safe_value?(expr)
|
486
|
+
return is_safe_value?(expr.elements.last) if expr.is_a?(Script::Tree::ListLiteral)
|
487
|
+
return false unless expr.is_a?(Script::Tree::Literal)
|
488
|
+
expr.value.is_a?(Script::Value::Number) ||
|
489
|
+
(expr.value.is_a?(Script::Value::String) && expr.value.type == :identifier)
|
490
|
+
end
|
491
|
+
|
486
492
|
def space
|
487
493
|
start_pos = source_position
|
488
494
|
e = or_expr
|
@@ -34,29 +34,31 @@ module Sass::Script::Value
|
|
34
34
|
attr_accessor :original
|
35
35
|
|
36
36
|
def self.precision
|
37
|
-
|
37
|
+
Thread.current[:sass_numeric_precision] || Thread.main[:sass_numeric_precision] || 5
|
38
38
|
end
|
39
39
|
|
40
40
|
# Sets the number of digits of precision
|
41
41
|
# For example, if this is `3`,
|
42
42
|
# `3.1415926` will be printed as `3.142`.
|
43
|
+
# The numeric precision is stored as a thread local for thread safety reasons.
|
44
|
+
# To set for all threads, be sure to set the precision on the main thread.
|
43
45
|
def self.precision=(digits)
|
44
|
-
|
45
|
-
|
46
|
-
|
46
|
+
Thread.current[:sass_numeric_precision] = digits.round
|
47
|
+
Thread.current[:sass_numeric_precision_factor] = nil
|
48
|
+
Thread.current[:sass_numeric_epsilon] = nil
|
47
49
|
end
|
48
50
|
|
49
51
|
# the precision factor used in numeric output
|
50
52
|
# it is derived from the `precision` method.
|
51
53
|
def self.precision_factor
|
52
|
-
|
54
|
+
Thread.current[:sass_numeric_precision_factor] ||= 10.0**precision
|
53
55
|
end
|
54
56
|
|
55
57
|
# Used in checking equality of floating point numbers. Any
|
56
58
|
# numbers within an `epsilon` of each other are considered functionally equal.
|
57
59
|
# The value for epsilon is one tenth of the current numeric precision.
|
58
60
|
def self.epsilon
|
59
|
-
|
61
|
+
Thread.current[:sass_numeric_epsilon] ||= 1 / (precision_factor * 10)
|
60
62
|
end
|
61
63
|
|
62
64
|
# Used so we don't allocate two new arrays for each new number.
|
@@ -508,8 +510,8 @@ module Sass::Script::Value
|
|
508
510
|
},
|
509
511
|
{
|
510
512
|
'dpi' => Rational(1),
|
511
|
-
'dpcm' => Rational(
|
512
|
-
'dppx' => Rational(
|
513
|
+
'dpcm' => Rational(254, 100),
|
514
|
+
'dppx' => Rational(96)
|
513
515
|
}
|
514
516
|
]
|
515
517
|
|
data/lib/sass/scss/parser.rb
CHANGED
@@ -560,7 +560,7 @@ module Sass
|
|
560
560
|
def supports_clause
|
561
561
|
return unless tok(/supports\(/i)
|
562
562
|
ss
|
563
|
-
supports =
|
563
|
+
supports = import_supports_condition
|
564
564
|
ss
|
565
565
|
tok!(/\)/)
|
566
566
|
supports
|
@@ -570,6 +570,10 @@ module Sass
|
|
570
570
|
supports_negation || supports_operator || supports_interpolation
|
571
571
|
end
|
572
572
|
|
573
|
+
def import_supports_condition
|
574
|
+
supports_condition || supports_declaration
|
575
|
+
end
|
576
|
+
|
573
577
|
def supports_negation
|
574
578
|
return unless tok(/not/i)
|
575
579
|
ss
|
@@ -589,6 +593,13 @@ module Sass
|
|
589
593
|
cond
|
590
594
|
end
|
591
595
|
|
596
|
+
def supports_declaration
|
597
|
+
name = sass_script(:parse)
|
598
|
+
tok!(/:/); ss
|
599
|
+
value = sass_script(:parse)
|
600
|
+
Sass::Supports::Declaration.new(name, value)
|
601
|
+
end
|
602
|
+
|
592
603
|
def supports_condition_in_parens
|
593
604
|
interp = supports_interpolation
|
594
605
|
return interp if interp
|
@@ -597,11 +608,9 @@ module Sass
|
|
597
608
|
tok!(/\)/); ss
|
598
609
|
cond
|
599
610
|
else
|
600
|
-
|
601
|
-
tok!(/:/); ss
|
602
|
-
value = sass_script(:parse)
|
611
|
+
decl = supports_declaration
|
603
612
|
tok!(/\)/); ss
|
604
|
-
|
613
|
+
decl
|
605
614
|
end
|
606
615
|
end
|
607
616
|
|
@@ -828,6 +837,9 @@ module Sass
|
|
828
837
|
|
|
829
838
|
(?!url\()
|
830
839
|
[^"'/\#!;\{\}] # "
|
840
|
+
|
|
841
|
+
# interp_uri will handle most url() calls, but not ones that take strings
|
842
|
+
url\(#{W}(?=")
|
831
843
|
|
|
832
844
|
/(?![/*])
|
833
845
|
|
|
@@ -1143,14 +1155,20 @@ WARNING
|
|
1143
1155
|
line = @line
|
1144
1156
|
offset = @offset
|
1145
1157
|
expected = @expected
|
1158
|
+
|
1159
|
+
logger = Sass::Logger::Delayed.install!
|
1146
1160
|
if catch(:_sass_parser_error) {yield; false}
|
1147
1161
|
@scanner.pos = pos
|
1148
1162
|
@line = line
|
1149
1163
|
@offset = offset
|
1150
1164
|
@expected = expected
|
1151
1165
|
{:pos => pos, :line => line, :expected => @expected, :block => block}
|
1166
|
+
else
|
1167
|
+
logger.flush
|
1168
|
+
nil
|
1152
1169
|
end
|
1153
1170
|
ensure
|
1171
|
+
logger.uninstall! if logger
|
1154
1172
|
@throw_error = old_throw_error
|
1155
1173
|
end
|
1156
1174
|
|
data/lib/sass/source/map.rb
CHANGED
@@ -118,12 +118,14 @@ module Sass::Source
|
|
118
118
|
@data.each do |m|
|
119
119
|
file, importer = m.input.file, m.input.importer
|
120
120
|
|
121
|
+
next unless importer
|
122
|
+
|
121
123
|
if options[:type] == :inline
|
122
124
|
source_uri = file
|
123
125
|
else
|
124
126
|
sourcemap_dir = sourcemap_path && sourcemap_path.dirname.to_s
|
125
127
|
sourcemap_dir = nil if options[:type] == :file
|
126
|
-
source_uri = importer
|
128
|
+
source_uri = importer.public_url(file, sourcemap_dir)
|
127
129
|
next unless source_uri
|
128
130
|
end
|
129
131
|
|
@@ -289,7 +289,9 @@ class Sass::Tree::Visitors::Convert < Sass::Tree::Visitors::Base
|
|
289
289
|
child.line + 1 == nxt.line) ||
|
290
290
|
(child.is_a?(Sass::Tree::VariableNode) && nxt.is_a?(Sass::Tree::VariableNode) &&
|
291
291
|
child.line + 1 == nxt.line) ||
|
292
|
-
(child.is_a?(Sass::Tree::PropNode) && nxt.is_a?(Sass::Tree::PropNode))
|
292
|
+
(child.is_a?(Sass::Tree::PropNode) && nxt.is_a?(Sass::Tree::PropNode)) ||
|
293
|
+
(child.is_a?(Sass::Tree::MixinNode) && nxt.is_a?(Sass::Tree::MixinNode) &&
|
294
|
+
child.line + 1 == nxt.line)
|
293
295
|
""
|
294
296
|
else
|
295
297
|
"\n"
|
@@ -1126,6 +1126,23 @@ foo {
|
|
1126
1126
|
SCSS
|
1127
1127
|
end
|
1128
1128
|
|
1129
|
+
def test_consecutive_mixin_includes
|
1130
|
+
assert_renders <<SASS, <<SCSS
|
1131
|
+
foo
|
1132
|
+
+foo-bar
|
1133
|
+
+foo-bar
|
1134
|
+
|
1135
|
+
a: blip
|
1136
|
+
SASS
|
1137
|
+
foo {
|
1138
|
+
@include foo-bar;
|
1139
|
+
@include foo-bar;
|
1140
|
+
|
1141
|
+
a: blip;
|
1142
|
+
}
|
1143
|
+
SCSS
|
1144
|
+
end
|
1145
|
+
|
1129
1146
|
def test_mixin_include_with_hyphen_conversion_keyword_arg
|
1130
1147
|
assert_renders <<SASS, <<SCSS
|
1131
1148
|
foo
|
data/test/sass/script_test.rb
CHANGED
@@ -558,9 +558,9 @@ WARNING
|
|
558
558
|
end
|
559
559
|
|
560
560
|
def test_resolution_units
|
561
|
-
assert_equal "
|
562
|
-
assert_equal "
|
563
|
-
assert_equal "
|
561
|
+
assert_equal "0.3937", resolve("(1dpi/1dpcm)")
|
562
|
+
assert_equal "0.02646", resolve("(1dpcm/1dppx)")
|
563
|
+
assert_equal "96", resolve("(1dppx/1dpi)")
|
564
564
|
end
|
565
565
|
|
566
566
|
def test_operations_have_options
|
data/test/sass/scss/scss_test.rb
CHANGED
@@ -3649,6 +3649,39 @@ SCSS
|
|
3649
3649
|
|
3650
3650
|
# Regression
|
3651
3651
|
|
3652
|
+
# Regression test for #2031.
|
3653
|
+
def test_no_interpolation_warning_in_nested_selector
|
3654
|
+
assert_no_warning {assert_equal(<<CSS, render(<<SCSS))}
|
3655
|
+
z a:b(n+1) {
|
3656
|
+
x: y; }
|
3657
|
+
CSS
|
3658
|
+
z {
|
3659
|
+
a:b(n+\#{1}) {
|
3660
|
+
x: y;
|
3661
|
+
}
|
3662
|
+
}
|
3663
|
+
SCSS
|
3664
|
+
end
|
3665
|
+
|
3666
|
+
# Ensures that the fix for #2031 doesn't hide legitimate warnings.
|
3667
|
+
def test_interpolation_warning_in_selector_like_property
|
3668
|
+
assert_warning(<<WARNING) {assert_equal(<<CSS, render(<<SCSS))}
|
3669
|
+
DEPRECATION WARNING on line 2 of #{filename_for_test :scss}: \#{} interpolation near operators will be simplified
|
3670
|
+
in a future version of Sass. To preserve the current behavior, use quotes:
|
3671
|
+
|
3672
|
+
unquote("n+1")
|
3673
|
+
|
3674
|
+
You can use the sass-convert command to automatically fix most cases.
|
3675
|
+
WARNING
|
3676
|
+
z {
|
3677
|
+
a: b(n+1); }
|
3678
|
+
CSS
|
3679
|
+
z {
|
3680
|
+
a:b(n+\#{1});
|
3681
|
+
}
|
3682
|
+
SCSS
|
3683
|
+
end
|
3684
|
+
|
3652
3685
|
def test_escape_in_selector
|
3653
3686
|
assert_equal(<<CSS, render(".\\!foo {a: b}"))
|
3654
3687
|
.\\!foo {
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Natalie Weizenbaum
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-12-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: yard
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- bin/sass
|
81
81
|
- bin/sass-convert
|
82
82
|
- bin/scss
|
83
|
+
- extra/sass-spec-ref.sh
|
83
84
|
- extra/update_watch.rb
|
84
85
|
- init.rb
|
85
86
|
- lib/sass.rb
|
@@ -105,6 +106,7 @@ files:
|
|
105
106
|
- lib/sass/importers/filesystem.rb
|
106
107
|
- lib/sass/logger.rb
|
107
108
|
- lib/sass/logger/base.rb
|
109
|
+
- lib/sass/logger/delayed.rb
|
108
110
|
- lib/sass/logger/log_level.rb
|
109
111
|
- lib/sass/media.rb
|
110
112
|
- lib/sass/plugin.rb
|
@@ -394,34 +396,34 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
394
396
|
version: '0'
|
395
397
|
requirements: []
|
396
398
|
rubyforge_project: sass
|
397
|
-
rubygems_version: 2.
|
399
|
+
rubygems_version: 2.4.8
|
398
400
|
signing_key:
|
399
401
|
specification_version: 4
|
400
402
|
summary: A powerful but elegant CSS compiler that makes CSS fun again.
|
401
403
|
test_files:
|
402
|
-
- test/sass/cache_test.rb
|
403
|
-
- test/sass/callbacks_test.rb
|
404
|
-
- test/sass/compiler_test.rb
|
405
|
-
- test/sass/conversion_test.rb
|
406
|
-
- test/sass/css2sass_test.rb
|
407
|
-
- test/sass/css_variable_test.rb
|
408
|
-
- test/sass/encoding_test.rb
|
409
|
-
- test/sass/engine_test.rb
|
410
|
-
- test/sass/exec_test.rb
|
411
404
|
- test/sass/extend_test.rb
|
412
|
-
- test/sass/
|
413
|
-
- test/sass/
|
414
|
-
- test/sass/
|
405
|
+
- test/sass/css2sass_test.rb
|
406
|
+
- test/sass/util_test.rb
|
407
|
+
- test/sass/superselector_test.rb
|
408
|
+
- test/sass/value_helpers_test.rb
|
415
409
|
- test/sass/plugin_test.rb
|
416
|
-
- test/sass/
|
410
|
+
- test/sass/logger_test.rb
|
411
|
+
- test/sass/functions_test.rb
|
412
|
+
- test/sass/conversion_test.rb
|
413
|
+
- test/sass/source_map_test.rb
|
414
|
+
- test/sass/cache_test.rb
|
415
|
+
- test/sass/encoding_test.rb
|
417
416
|
- test/sass/script_test.rb
|
417
|
+
- test/sass/callbacks_test.rb
|
418
|
+
- test/sass/script_conversion_test.rb
|
418
419
|
- test/sass/scss/css_test.rb
|
419
420
|
- test/sass/scss/rx_test.rb
|
420
421
|
- test/sass/scss/scss_test.rb
|
421
|
-
- test/sass/
|
422
|
-
- test/sass/
|
423
|
-
- test/sass/
|
424
|
-
- test/sass/
|
422
|
+
- test/sass/exec_test.rb
|
423
|
+
- test/sass/importer_test.rb
|
424
|
+
- test/sass/engine_test.rb
|
425
|
+
- test/sass/css_variable_test.rb
|
426
|
+
- test/sass/compiler_test.rb
|
425
427
|
- test/sass/util/subset_map_test.rb
|
426
|
-
- test/sass/
|
427
|
-
- test/sass/
|
428
|
+
- test/sass/util/normalized_map_test.rb
|
429
|
+
- test/sass/util/multibyte_string_scanner_test.rb
|