sass 3.2.12 → 3.2.13
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.
- data/CONTRIBUTING +1 -1
- data/README.md +7 -7
- data/VERSION +1 -1
- data/VERSION_DATE +1 -1
- data/bin/sass +5 -1
- data/bin/sass-convert +5 -1
- data/bin/scss +5 -1
- data/lib/sass/css.rb +1 -1
- data/lib/sass/importers/filesystem.rb +1 -1
- data/lib/sass/plugin.rb +2 -1
- data/lib/sass/railtie.rb +1 -0
- data/lib/sass/script/funcall.rb +11 -3
- data/lib/sass/scss/parser.rb +1 -0
- data/test/sass/css2sass_test.rb +19 -0
- data/test/sass/script_test.rb +24 -0
- data/test/sass/scss/css_test.rb +8 -1
- data/test/sass/scss/scss_test.rb +14 -0
- metadata +2 -2
data/CONTRIBUTING
CHANGED
data/README.md
CHANGED
@@ -57,7 +57,7 @@ Then any Sass files in `public/stylesheets/sass`
|
|
57
57
|
will be compiled into CSS files in `public/stylesheets` on every request.
|
58
58
|
|
59
59
|
To use Sass programmatically,
|
60
|
-
check out the [YARD documentation](http://sass-lang.com/
|
60
|
+
check out the [YARD documentation](http://sass-lang.com/documentation/file.SASS_REFERENCE.html#using_sass).
|
61
61
|
|
62
62
|
## Formatting
|
63
63
|
|
@@ -71,10 +71,10 @@ and get small stylesheets up and running quickly,
|
|
71
71
|
particularly with the help of
|
72
72
|
[the Compass style library](http://compass-style.org).
|
73
73
|
|
74
|
-
[vars]: http://
|
75
|
-
[nested]: http://
|
76
|
-
[mixins]: http://
|
77
|
-
[imports]: http://
|
74
|
+
[vars]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#variables_
|
75
|
+
[nested]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#nested_rules
|
76
|
+
[mixins]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#mixins
|
77
|
+
[imports]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#import
|
78
78
|
|
79
79
|
Sass has two syntaxes.
|
80
80
|
The one presented here, known as "SCSS" (for "Sassy CSS"),
|
@@ -83,7 +83,7 @@ The other (older) syntax, known as the indented syntax or just "Sass",
|
|
83
83
|
is whitespace-sensitive and indentation-based.
|
84
84
|
For more information, see the [reference documentation][syntax].
|
85
85
|
|
86
|
-
[syntax]: http://
|
86
|
+
[syntax]: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax
|
87
87
|
|
88
88
|
To run the following examples and see the CSS they produce,
|
89
89
|
put them in a file called `test.scss` and run `sass test.scss`.
|
@@ -152,7 +152,7 @@ You can even give them arguments.
|
|
152
152
|
}
|
153
153
|
|
154
154
|
A comprehensive list of features is available
|
155
|
-
in the [Sass reference](http://
|
155
|
+
in the [Sass reference](http://sass-lang.com/documentation/file.SASS_REFERENCE.html).
|
156
156
|
|
157
157
|
## Executables
|
158
158
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.13
|
data/VERSION_DATE
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
20 December 2013 04:00:49 UTC
|
data/bin/sass
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
# The command line Sass parser.
|
3
3
|
|
4
4
|
THIS_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
|
5
|
-
|
5
|
+
begin
|
6
|
+
require File.dirname(THIS_FILE) + '/../lib/sass'
|
7
|
+
rescue LoadError
|
8
|
+
require 'sass'
|
9
|
+
end
|
6
10
|
require 'sass/exec'
|
7
11
|
|
8
12
|
opts = Sass::Exec::Sass.new(ARGV)
|
data/bin/sass-convert
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
THIS_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
|
4
|
-
|
4
|
+
begin
|
5
|
+
require File.dirname(THIS_FILE) + '/../lib/sass'
|
6
|
+
rescue LoadError
|
7
|
+
require 'sass'
|
8
|
+
end
|
5
9
|
require 'sass/exec'
|
6
10
|
|
7
11
|
opts = Sass::Exec::SassConvert.new(ARGV)
|
data/bin/scss
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
# The command line Sass parser.
|
3
3
|
|
4
4
|
THIS_FILE = File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__
|
5
|
-
|
5
|
+
begin
|
6
|
+
require File.dirname(THIS_FILE) + '/../lib/sass'
|
7
|
+
rescue LoadError
|
8
|
+
require 'sass'
|
9
|
+
end
|
6
10
|
require 'sass/exec'
|
7
11
|
|
8
12
|
opts = Sass::Exec::Scss.new(ARGV)
|
data/lib/sass/css.rb
CHANGED
@@ -293,7 +293,7 @@ module Sass
|
|
293
293
|
def bubble_subject(root)
|
294
294
|
root.children.each do |child|
|
295
295
|
bubble_subject(child) if child.is_a?(Tree::RuleNode) || child.is_a?(Tree::DirectiveNode)
|
296
|
-
next unless child.is_a?(Tree::RuleNode)
|
296
|
+
next unless child.is_a?(Tree::RuleNode) && !child.children.empty?
|
297
297
|
next unless child.children.all? do |c|
|
298
298
|
next unless c.is_a?(Tree::RuleNode)
|
299
299
|
first_simple_sel(c).is_a?(Sass::Selector::Parent) && first_sseq(c).subject?
|
@@ -119,7 +119,7 @@ module Sass
|
|
119
119
|
dir = dir.gsub(File::ALT_SEPARATOR, File::SEPARATOR) unless File::ALT_SEPARATOR.nil?
|
120
120
|
|
121
121
|
found = possible_files(remove_root(name)).map do |f, s|
|
122
|
-
path = (dir == "." || Pathname.new(f).absolute?) ? f : "#{dir}/#{f}"
|
122
|
+
path = (dir == "." || Pathname.new(f).absolute?) ? f : "#{escape_glob_characters(dir)}/#{f}"
|
123
123
|
Dir[path].map do |full_path|
|
124
124
|
full_path.gsub!(REDUNDANT_DIRECTORY, File::SEPARATOR)
|
125
125
|
[full_path, s]
|
data/lib/sass/plugin.rb
CHANGED
@@ -123,7 +123,8 @@ module Sass
|
|
123
123
|
end
|
124
124
|
end
|
125
125
|
|
126
|
-
|
126
|
+
# On Rails 3+ the rails plugin is loaded at the right time in railtie.rb
|
127
|
+
if defined?(ActionController) && !Sass::Util.ap_geq_3?
|
127
128
|
require 'sass/plugin/rails'
|
128
129
|
elsif defined?(Merb::Plugins)
|
129
130
|
require 'sass/plugin/merb'
|
data/lib/sass/railtie.rb
CHANGED
data/lib/sass/script/funcall.rb
CHANGED
@@ -100,16 +100,17 @@ module Sass
|
|
100
100
|
splat = @splat.perform(environment) if @splat
|
101
101
|
if fn = environment.function(@name)
|
102
102
|
keywords = Sass::Util.map_hash(@keywords) {|k, v| [k, v.perform(environment)]}
|
103
|
-
return perform_sass_fn(fn, args, keywords, splat)
|
103
|
+
return without_original(perform_sass_fn(fn, args, keywords, splat))
|
104
104
|
end
|
105
105
|
|
106
106
|
ruby_name = @name.tr('-', '_')
|
107
107
|
args = construct_ruby_args(ruby_name, args, splat, environment)
|
108
108
|
|
109
109
|
unless Functions.callable?(ruby_name)
|
110
|
-
opts(to_literal(args))
|
110
|
+
without_original(opts(to_literal(args)))
|
111
111
|
else
|
112
|
-
opts(Functions::EvaluationContext.new(environment.options).
|
112
|
+
without_original(opts(Functions::EvaluationContext.new(environment.options).
|
113
|
+
send(ruby_name, *args)))
|
113
114
|
end
|
114
115
|
rescue ArgumentError => e
|
115
116
|
message = e.message
|
@@ -170,6 +171,13 @@ module Sass
|
|
170
171
|
|
171
172
|
private
|
172
173
|
|
174
|
+
def without_original(value)
|
175
|
+
return value unless value.is_a?(Number)
|
176
|
+
value = value.dup
|
177
|
+
value.original = nil
|
178
|
+
return value
|
179
|
+
end
|
180
|
+
|
173
181
|
def construct_ruby_args(name, args, splat, environment)
|
174
182
|
args += splat.to_a if splat
|
175
183
|
|
data/lib/sass/scss/parser.rb
CHANGED
data/test/sass/css2sass_test.rb
CHANGED
@@ -265,6 +265,25 @@ CSS
|
|
265
265
|
|
266
266
|
# Regressions
|
267
267
|
|
268
|
+
def test_empty_rule
|
269
|
+
assert_equal(<<SASS, css2sass(<<CSS))
|
270
|
+
a
|
271
|
+
SASS
|
272
|
+
a {}
|
273
|
+
CSS
|
274
|
+
end
|
275
|
+
|
276
|
+
def test_empty_rule_with_selector_combinator
|
277
|
+
assert_equal(<<SASS, css2sass(<<CSS))
|
278
|
+
a
|
279
|
+
color: red
|
280
|
+
> b
|
281
|
+
SASS
|
282
|
+
a {color: red}
|
283
|
+
a > b {}
|
284
|
+
CSS
|
285
|
+
end
|
286
|
+
|
268
287
|
def test_nesting_within_media
|
269
288
|
assert_equal(<<SASS, css2sass(<<CSS))
|
270
289
|
@media all
|
data/test/sass/script_test.rb
CHANGED
@@ -510,6 +510,30 @@ SASS
|
|
510
510
|
|
511
511
|
# Regression Tests
|
512
512
|
|
513
|
+
def test_user_defined_function_forces_division
|
514
|
+
assert_equal(<<CSS, render(<<SASS))
|
515
|
+
a {
|
516
|
+
b: 10px; }
|
517
|
+
CSS
|
518
|
+
@function foo()
|
519
|
+
@return 20px
|
520
|
+
|
521
|
+
a
|
522
|
+
b: (foo() / 2)
|
523
|
+
SASS
|
524
|
+
|
525
|
+
assert_equal(<<CSS, render(<<SASS))
|
526
|
+
a {
|
527
|
+
b: 10px; }
|
528
|
+
CSS
|
529
|
+
@function foo()
|
530
|
+
@return 20px
|
531
|
+
|
532
|
+
a
|
533
|
+
b: foo() / 2
|
534
|
+
SASS
|
535
|
+
end
|
536
|
+
|
513
537
|
def test_funcall_has_higher_precedence_than_color_name
|
514
538
|
assert_equal "teal(12)", resolve("teal(12)")
|
515
539
|
assert_equal "tealbang(12)", resolve("tealbang(12)")
|
data/test/sass/scss/css_test.rb
CHANGED
@@ -505,13 +505,20 @@ SCSS
|
|
505
505
|
assert_parses '@import url(foo.css);'
|
506
506
|
end
|
507
507
|
|
508
|
-
def
|
508
|
+
def test_string_import_directive_with_media
|
509
509
|
assert_parses '@import "foo.css" screen;'
|
510
510
|
assert_parses '@import "foo.css" screen, print;'
|
511
511
|
assert_parses '@import "foo.css" screen, print and (foo: 0);'
|
512
512
|
assert_parses '@import "foo.css" screen, only print, screen and (foo: 0);'
|
513
513
|
end
|
514
514
|
|
515
|
+
def test_url_import_directive_with_media
|
516
|
+
assert_parses '@import url("foo.css") screen;'
|
517
|
+
assert_parses '@import url("foo.css") screen, print;'
|
518
|
+
assert_parses '@import url("foo.css") screen, print and (foo: 0);'
|
519
|
+
assert_parses '@import url("foo.css") screen, only print, screen and (foo: 0);'
|
520
|
+
end
|
521
|
+
|
515
522
|
def test_page_directive
|
516
523
|
assert_parses <<SCSS
|
517
524
|
@page {
|
data/test/sass/scss/scss_test.rb
CHANGED
@@ -270,6 +270,20 @@ SCSS
|
|
270
270
|
assert_equal "@import url(foo.css);\n", render('@import url(foo.css);')
|
271
271
|
end
|
272
272
|
|
273
|
+
def test_css_string_import_directive_with_media
|
274
|
+
assert_parses '@import "foo.css" screen;'
|
275
|
+
assert_parses '@import "foo.css" screen, print;'
|
276
|
+
assert_parses '@import "foo.css" screen, print and (foo: 0);'
|
277
|
+
assert_parses '@import "foo.css" screen, only print, screen and (foo: 0);'
|
278
|
+
end
|
279
|
+
|
280
|
+
def test_css_url_import_directive_with_media
|
281
|
+
assert_parses '@import url("foo.css") screen;'
|
282
|
+
assert_parses '@import url("foo.css") screen, print;'
|
283
|
+
assert_parses '@import url("foo.css") screen, print and (foo: 0);'
|
284
|
+
assert_parses '@import url("foo.css") screen, only print, screen and (foo: 0);'
|
285
|
+
end
|
286
|
+
|
273
287
|
def test_media_import
|
274
288
|
assert_equal("@import \"./fonts.sass\" all;\n", render("@import \"./fonts.sass\" all;"))
|
275
289
|
end
|
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.2.
|
4
|
+
version: 3.2.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: yard
|