sass 3.2.0.alpha.56 → 3.2.0.alpha.57

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/REVISION CHANGED
@@ -1 +1 @@
1
- ade170e613352cd597338cf29e865d98e8316f9b
1
+ a9d57b52dc7bfa8a777cf22d6ca36645855757ce
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.0.alpha.56
1
+ 3.2.0.alpha.57
@@ -308,6 +308,13 @@ module Sass
308
308
  # @return [Symbol]
309
309
  attr_reader :type
310
310
 
311
+ # Some psuedo-class-syntax selectors (`:after` and `:before)
312
+ # are actually considered pseudo-elements
313
+ # and must be at the end of the selector to function properly.
314
+ #
315
+ # @return [Array<String>]
316
+ FINAL_SELECTORS = %w[after before]
317
+
311
318
  # The name of the selector.
312
319
  #
313
320
  # @return [Array<String, Sass::Script::Node>]
@@ -333,6 +340,10 @@ module Sass
333
340
  @arg = arg
334
341
  end
335
342
 
343
+ def final?
344
+ type == :class && FINAL_SELECTORS.include?(name.first)
345
+ end
346
+
336
347
  # @see Selector#to_a
337
348
  def to_a
338
349
  res = [@type == :class ? ":" : "::"] + @name
@@ -340,8 +351,8 @@ module Sass
340
351
  res
341
352
  end
342
353
 
343
- # Returns `nil` if this is a pseudoclass selector
344
- # and `sels` contains a pseudoclass selector different than this one.
354
+ # Returns `nil` if this is a pseudoelement selector
355
+ # and `sels` contains a pseudoelement selector different than this one.
345
356
  #
346
357
  # @see Selector#unify
347
358
  def unify(sels)
@@ -349,6 +360,7 @@ module Sass
349
360
  sel.is_a?(Pseudo) && sel.type == :element &&
350
361
  (sel.name != self.name || sel.arg != self.arg)
351
362
  end
363
+ return sels + [self] if final?
352
364
  super
353
365
  end
354
366
  end
@@ -79,7 +79,7 @@ module Sass
79
79
  sels_with_ix = Sass::Util.enum_with_index(sels)
80
80
  _, i =
81
81
  if self.is_a?(Pseudo) || self.is_a?(SelectorPseudoClass)
82
- sels_with_ix.find {|sel, _| sel.is_a?(Pseudo) && sels.last.type == :element}
82
+ sels_with_ix.find {|sel, _| sel.is_a?(Pseudo) && (sels.last.final? || sels.last.type == :element)}
83
83
  else
84
84
  sels_with_ix.find {|sel, _| sel.is_a?(Pseudo) || sel.is_a?(SelectorPseudoClass)}
85
85
  end
@@ -741,6 +741,22 @@ SCSS
741
741
  CSS
742
742
  :foo.baz {a: b}
743
743
  :bar {@extend .baz}
744
+ SCSS
745
+
746
+ assert_equal <<CSS, render(<<SCSS)
747
+ .baz:foo, :foo:after {
748
+ a: b; }
749
+ CSS
750
+ .baz:foo {a: b}
751
+ :after {@extend .baz}
752
+ SCSS
753
+
754
+ assert_equal <<CSS, render(<<SCSS)
755
+ .baz:after, :foo:after {
756
+ a: b; }
757
+ CSS
758
+ .baz:after {a: b}
759
+ :foo {@extend .baz}
744
760
  SCSS
745
761
 
746
762
  assert_equal <<CSS, render(<<SCSS)
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sass
3
3
  version: !ruby/object:Gem::Version
4
- hash: 592302957
4
+ hash: 592302959
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 3
8
8
  - 2
9
9
  - 0
10
10
  - alpha
11
- - 56
12
- version: 3.2.0.alpha.56
11
+ - 57
12
+ version: 3.2.0.alpha.57
13
13
  platform: ruby
14
14
  authors:
15
15
  - Nathan Weizenbaum
@@ -19,7 +19,7 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2012-01-13 00:00:00 -05:00
22
+ date: 2012-01-18 00:00:00 -05:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
@@ -150,7 +150,6 @@ files:
150
150
  - lib/sass/tree/root_node.rb
151
151
  - lib/sass/tree/rule_node.rb
152
152
  - lib/sass/tree/content_node.rb
153
- - lib/sass/tree/trace_node.rb
154
153
  - lib/sass/tree/variable_node.rb
155
154
  - lib/sass/tree/visitors/base.rb
156
155
  - lib/sass/tree/visitors/check_nesting.rb
@@ -162,6 +161,7 @@ files:
162
161
  - lib/sass/tree/visitors/to_css.rb
163
162
  - lib/sass/tree/warn_node.rb
164
163
  - lib/sass/tree/while_node.rb
164
+ - lib/sass/tree/trace_node.rb
165
165
  - lib/sass/util.rb
166
166
  - lib/sass/util/multibyte_string_scanner.rb
167
167
  - lib/sass/util/subset_map.rb