sass 3.1.0 → 3.1.1
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/VERSION +1 -1
- data/lib/sass/engine.rb +1 -7
- data/lib/sass/less.rb +1 -1
- data/lib/sass/railtie.rb +1 -1
- data/lib/sass/script/lexer.rb +6 -1
- data/lib/sass/scss/parser.rb +1 -3
- data/lib/sass/scss/rx.rb +1 -1
- data/lib/sass/tree/prop_node.rb +2 -9
- data/lib/sass/tree/visitors/to_css.rb +3 -3
- data/test/sass/engine_test.rb +10 -0
- metadata +5 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1.
|
1
|
+
3.1.1
|
data/lib/sass/engine.rb
CHANGED
@@ -581,15 +581,9 @@ WARNING
|
|
581
581
|
if value.strip.empty?
|
582
582
|
expr = Sass::Script::String.new("")
|
583
583
|
else
|
584
|
-
important = false
|
585
|
-
if value =~ Sass::SCSS::RX::IMPORTANT
|
586
|
-
important = true
|
587
|
-
value = value.gsub(Sass::SCSS::RX::IMPORTANT,"")
|
588
|
-
end
|
589
584
|
expr = parse_script(value, :offset => line.offset + line.text.index(value))
|
590
|
-
|
591
585
|
end
|
592
|
-
Tree::PropNode.new(parse_interp(name), expr,
|
586
|
+
Tree::PropNode.new(parse_interp(name), expr, prop)
|
593
587
|
end
|
594
588
|
|
595
589
|
def parse_variable(line)
|
data/lib/sass/less.rb
CHANGED
data/lib/sass/railtie.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
if defined?(ActiveSupport) && Sass::Util.has?(:public_method, ActiveSupport, :on_load) &&
|
3
3
|
!Sass::Util.ap_geq?('3.1.0.beta')
|
4
4
|
require 'sass/plugin/configuration'
|
5
|
-
ActiveSupport.on_load(:
|
5
|
+
ActiveSupport.on_load(:before_configuration) do
|
6
6
|
require 'sass'
|
7
7
|
require 'sass/plugin'
|
8
8
|
end
|
data/lib/sass/script/lexer.rb
CHANGED
@@ -231,7 +231,7 @@ module Sass
|
|
231
231
|
|
232
232
|
variable || string(:double, false) || string(:single, false) || number ||
|
233
233
|
color || bool || string(:uri, false) || raw(UNICODERANGE) ||
|
234
|
-
special_fun || ident_op || ident || op
|
234
|
+
special_fun || special_val || ident_op || ident || op
|
235
235
|
end
|
236
236
|
|
237
237
|
def variable
|
@@ -302,6 +302,11 @@ MESSAGE
|
|
302
302
|
str1.size + str2.size]
|
303
303
|
end
|
304
304
|
|
305
|
+
def special_val
|
306
|
+
return unless scan(/!important/i)
|
307
|
+
[:string, Script::String.new("!important")]
|
308
|
+
end
|
309
|
+
|
305
310
|
def ident_op
|
306
311
|
return unless op = scan(REGULAR_EXPRESSIONS[:ident_op])
|
307
312
|
[OPERATORS[op]]
|
data/lib/sass/scss/parser.rb
CHANGED
@@ -638,11 +638,9 @@ MESSAGE
|
|
638
638
|
tok!(/:/)
|
639
639
|
space, value = value!
|
640
640
|
ss
|
641
|
-
important = tok(IMPORTANT)
|
642
|
-
ss
|
643
641
|
require_block = tok?(/\{/)
|
644
642
|
|
645
|
-
node = node(Sass::Tree::PropNode.new(name.flatten.compact, value,
|
643
|
+
node = node(Sass::Tree::PropNode.new(name.flatten.compact, value, :new))
|
646
644
|
|
647
645
|
return node unless require_block
|
648
646
|
nested_properties! node, space
|
data/lib/sass/scss/rx.rb
CHANGED
@@ -119,7 +119,7 @@ module Sass
|
|
119
119
|
# We could use it for 1.9 only, but I don't want to introduce a cross-version
|
120
120
|
# behavior difference.
|
121
121
|
# In any case, almost all CSS idents will be matched by this.
|
122
|
-
STATIC_VALUE = /(-?#{NMSTART}|#{STRING_NOINTERP}|\s(?!%)|#[a-f0-9]|[,%]|#{NUM})+(?=[;}])/i
|
122
|
+
STATIC_VALUE = /(-?#{NMSTART}|#{STRING_NOINTERP}|\s(?!%)|#[a-f0-9]|[,%]|#{NUM}|\!important)+(?=[;}])/i
|
123
123
|
|
124
124
|
STATIC_SELECTOR = /(#{NMCHAR}|\s|[,>+*]|[:#.]#{NMSTART})+(?=[{])/i
|
125
125
|
end
|
data/lib/sass/tree/prop_node.rb
CHANGED
@@ -23,11 +23,6 @@ module Sass::Tree
|
|
23
23
|
# @return [Sass::Script::Node]
|
24
24
|
attr_accessor :value
|
25
25
|
|
26
|
-
# Whether the property was marked as !important.
|
27
|
-
#
|
28
|
-
# @return [Boolean]
|
29
|
-
attr_accessor :important
|
30
|
-
|
31
26
|
# The value of the property
|
32
27
|
# after any interpolated SassScript has been resolved.
|
33
28
|
# Only set once \{Tree::Visitors::Perform} has been run.
|
@@ -49,16 +44,14 @@ module Sass::Tree
|
|
49
44
|
|
50
45
|
# @param name [Array<String, Sass::Script::Node>] See \{#name}
|
51
46
|
# @param value [Sass::Script::Node] See \{#value}
|
52
|
-
# @param important [Boolean] whether this is an !important property
|
53
47
|
# @param prop_syntax [Symbol] `:new` if this property uses `a: b`-style syntax,
|
54
48
|
# `:old` if it uses `:a b`-style syntax
|
55
|
-
def initialize(name, value,
|
49
|
+
def initialize(name, value, prop_syntax)
|
56
50
|
@name = Sass::Util.strip_string_array(
|
57
51
|
Sass::Util.merge_adjacent_strings(name))
|
58
52
|
@value = value
|
59
53
|
@tabs = 0
|
60
54
|
@prop_syntax = prop_syntax
|
61
|
-
@important = important
|
62
55
|
super()
|
63
56
|
end
|
64
57
|
|
@@ -96,7 +89,7 @@ module Sass::Tree
|
|
96
89
|
old = opts[:old] && fmt == :sass
|
97
90
|
initial = old ? ':' : ''
|
98
91
|
mid = old ? '' : ':'
|
99
|
-
"#{initial}#{name}#{mid} #{self.class.val_to_sass(value, opts)}
|
92
|
+
"#{initial}#{name}#{mid} #{self.class.val_to_sass(value, opts)}".rstrip
|
100
93
|
end
|
101
94
|
|
102
95
|
private
|
@@ -122,9 +122,9 @@ MESSAGE
|
|
122
122
|
def visit_prop(node)
|
123
123
|
tab_str = ' ' * (@tabs + node.tabs)
|
124
124
|
if node.style == :compressed
|
125
|
-
"#{tab_str}#{node.resolved_name}:#{node.resolved_value}
|
125
|
+
"#{tab_str}#{node.resolved_name}:#{node.resolved_value}"
|
126
126
|
else
|
127
|
-
"#{tab_str}#{node.resolved_name}: #{node.resolved_value}
|
127
|
+
"#{tab_str}#{node.resolved_name}: #{node.resolved_value};"
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
@@ -204,7 +204,7 @@ MESSAGE
|
|
204
204
|
[Sass::Selector::Element.new(k.to_s.gsub(/[^\w-]/, "\\\\\\0"), nil)])
|
205
205
|
])
|
206
206
|
])
|
207
|
-
prop = Sass::Tree::PropNode.new([""], "",
|
207
|
+
prop = Sass::Tree::PropNode.new([""], "", :new)
|
208
208
|
prop.resolved_name = "font-family"
|
209
209
|
prop.resolved_value = Sass::SCSS::RX.escape_ident(v.to_s)
|
210
210
|
rule << prop
|
data/test/sass/engine_test.rb
CHANGED
@@ -2148,6 +2148,16 @@ CSS
|
|
2148
2148
|
SASS
|
2149
2149
|
end
|
2150
2150
|
|
2151
|
+
def test_silent_comment_in_prop_val_after_important
|
2152
|
+
assert_equal(<<CSS, render(<<SASS))
|
2153
|
+
.advanced {
|
2154
|
+
display: none !important; }
|
2155
|
+
CSS
|
2156
|
+
.advanced
|
2157
|
+
display: none !important // yeah, yeah. it's not really a style anyway.
|
2158
|
+
SASS
|
2159
|
+
end
|
2160
|
+
|
2151
2161
|
def test_mixin_with_keyword_args
|
2152
2162
|
assert_equal <<CSS, render(<<SASS)
|
2153
2163
|
.mixed {
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 1
|
10
|
+
version: 3.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nathan Weizenbaum
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-04-
|
20
|
+
date: 2011-04-25 00:00:00 -07:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -293,7 +293,7 @@ files:
|
|
293
293
|
- VERSION_NAME
|
294
294
|
- README.md
|
295
295
|
- CONTRIBUTING
|
296
|
-
has_rdoc:
|
296
|
+
has_rdoc: false
|
297
297
|
homepage: http://sass-lang.com/
|
298
298
|
licenses: []
|
299
299
|
|