A pseudoclass (e.g. `:visited`) or pseudoelement (e.g. `::first-line`) selector. It can have arguments (e.g. `:nth-child(2n+1)`).
Some psuedo-class-syntax selectors are actually considered pseudo-elements and must be treated differently. This is a list of such selectors
@return [Array<String>]
@param type [Symbol] See {#type} @param name [Array<String, Sass::Script::Node>] The name of the selector @param arg [nil, Array<String, Sass::Script::Node>] The argument to the selector,
or nil if no argument was given
# File lib/sass/selector.rb, line 382 def initialize(type, name, arg) @syntactic_type = type @name = name @arg = arg end
@see AbstractSequence#specificity
# File lib/sass/selector.rb, line 416 def specificity type == :class ? SPECIFICITY_BASE : 1 end
@see Selector#to_a
# File lib/sass/selector.rb, line 397 def to_a res = [syntactic_type == :class ? ":" : "::"] + @name (res << "(").concat(Sass::Util.strip_string_array(@arg)) << ")" if @arg res end
The type of the selector. `:class` if this is a pseudoclass selector, `:element` if it's a pseudoelement.
@return [Symbol]
# File lib/sass/selector.rb, line 392 def type ACTUALLY_ELEMENTS.include?(name.first) ? :element : syntactic_type end
Returns `nil` if this is a pseudoelement selector and `sels` contains a pseudoelement selector different than this one.
@see Selector#unify
# File lib/sass/selector.rb, line 407 def unify(sels) return if type == :element && sels.any? do |sel| sel.is_a?(Pseudo) && sel.type == :element && (sel.name != self.name || sel.arg != self.arg) end super end
Generated with the Darkfish Rdoc Generator 2.