Class Index [+]

Quicksearch

Sass::Tree::ExtendNode

A static node reprenting an `@extend` directive.

@see Sass::Tree

Public Class Methods

new(selector) click to toggle source

@param selector [Array]

  The CSS selector to extend,
  interspersed with {Sass::Script::Node}s
  representing `#{}`-interpolation.
    # File lib/sass/tree/extend_node.rb, line 12
12:     def initialize(selector)
13:       @selector = selector
14:       super()
15:     end

Public Instance Methods

cssize(extends, parent) click to toggle source

Registers this extension in the `extends` subset map.

@param extends [Haml::Util::SubsetMap{Selector::Simple => Selector::Sequence}]

  The extensions defined for this tree

@param parent [RuleNode] The parent node of this node @see Node#cssize

    # File lib/sass/tree/extend_node.rb, line 23
23:     def cssize(extends, parent)
24:       @resolved_selector.members.each do |seq|
25:         if seq.members.size > 1
26:           raise Sass::SyntaxError.new("Can't extend #{seq.to_a.join}: can't extend nested selectors")
27:         end
28: 
29:         sseq = seq.members.first
30:         if !sseq.is_a?(Sass::Selector::SimpleSequence)
31:           raise Sass::SyntaxError.new("Can't extend #{seq.to_a.join}: invalid selector")
32:         end
33: 
34:         sel = sseq.members
35:         parent.resolved_rules.members.each do |seq|
36:           if !seq.members.last.is_a?(Sass::Selector::SimpleSequence)
37:             raise Sass::SyntaxError.new("#{seq} can't extend: invalid selector")
38:           end
39: 
40:           extends[sel] = seq
41:         end
42:       end
43: 
44:       []
45:     end

Protected Instance Methods

perform!(environment) click to toggle source

Runs SassScript interpolation in the selector, and then parses the result into a {Sass::Selector::CommaSequence}.

@param environment [Sass::Environment] The lexical environment containing

  variable and mixin values
    # File lib/sass/tree/extend_node.rb, line 59
59:     def perform!(environment)
60:       @resolved_selector = Sass::SCSS::CssParser.new(run_interp(@selector, environment), self.line).
61:         parse_selector(self.filename)
62:       super
63:     end
to_src(tabs, opts, fmt) click to toggle source

@see Node#to_src

    # File lib/sass/tree/extend_node.rb, line 50
50:     def to_src(tabs, opts, fmt)
51:       "#{'  ' * tabs}@extend #{selector_to_src(@selector, tabs, opts, fmt).lstrip}#{semi fmt}\n"
52:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.