class Sass::Tree::MixinDefNode

@see Sass::Tree
A dynamic node representing a mixin definition.

def _perform(environment)

Parameters:
  • environment (Sass::Environment) -- The lexical environment containing
def _perform(environment)
  environment.set_mixin(@name, Sass::Mixin.new(@name, @args, environment, children))
  []
end

def initialize(name, args)

Parameters:
  • args (Array<(Script::Node, Script::Node)>) -- The arguments for the mixin.
  • name (String) -- The mixin name
def initialize(name, args)
  @name = name
  @args = args
  super()
end

def invalid_child?(child)

Returns:
  • (Boolean, String) - Whether or not the child node is valid,

Parameters:
  • child (Tree::Node) -- A potential child node.
def invalid_child?(child)
  super unless child.is_a?(ExtendNode)
end

def to_src(tabs, opts, fmt)

Other tags:
    See: Node#to_src -
def to_src(tabs, opts, fmt)
  args =
    if @args.empty?
      ""
    else
      '(' + @args.map do |v, d|
        if d
          "#{v.to_sass(opts)}: #{d.to_sass(opts)}"
        else
          v.to_sass(opts)
        end
      end.join(", ") + ')'
    end
        
  "#{'  ' * tabs}#{fmt == :sass ? '=' : '@mixin '}#{dasherize(@name, opts)}#{args}" +
    children_to_src(tabs, opts, fmt)
end