2008-10-15 20:00:28 -07:00
|
|
|
module Sass
|
|
|
|
module Tree
|
2009-04-25 02:36:00 -07:00
|
|
|
# A dynamic node representing a mixin definition.
|
|
|
|
#
|
|
|
|
# @see Sass::Tree
|
2008-10-15 20:00:28 -07:00
|
|
|
class MixinDefNode < Node
|
2009-04-25 02:36:00 -07:00
|
|
|
# @param name [String] The mixin name
|
2009-07-19 14:20:55 -07:00
|
|
|
# @param args [Array<(Script::Node, Script::Node)>] The arguments for the mixin.
|
|
|
|
# Each element is a tuple containing the variable for argument
|
2009-04-25 02:36:00 -07:00
|
|
|
# and the parse tree for the default value of the argument
|
2009-04-21 19:25:18 -07:00
|
|
|
def initialize(name, args)
|
2008-10-15 20:00:28 -07:00
|
|
|
@name = name
|
|
|
|
@args = args
|
2009-04-21 19:25:18 -07:00
|
|
|
super()
|
2008-10-15 20:00:28 -07:00
|
|
|
end
|
|
|
|
|
2009-04-25 02:36:00 -07:00
|
|
|
protected
|
2008-10-15 20:00:28 -07:00
|
|
|
|
2009-04-25 02:36:00 -07:00
|
|
|
# Loads the mixin into the environment.
|
|
|
|
#
|
|
|
|
# @param environment [Sass::Environment] The lexical environment containing
|
|
|
|
# variable and mixin values
|
2008-10-15 20:00:28 -07:00
|
|
|
def _perform(environment)
|
|
|
|
environment.set_mixin(@name, Sass::Mixin.new(@name, @args, environment, children))
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|