class Sass::Tree::MixinDefNode
@see Sass::Tree
A dynamic node representing a mixin definition.
def _perform(environment)
-
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)
-
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)
-
(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)
- 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