class Sass::Selector::Pseudo
It can have arguments (e.g. ‘:nth-child(2n+1)`).
A pseudoclass (e.g. `:visited`) or pseudoelement (e.g. `::first-line`) selector.
def initialize(type, name, arg)
-
arg
(nil, Array
) -- The argument to the selector, -
name
(Array
) -- The name of the selector -
type
(Symbol
) -- See \{#type}
def initialize(type, name, arg) @syntactic_type = type @name = name @arg = arg end
def specificity
- See: AbstractSequence#specificity -
def specificity type == :class ? SPECIFICITY_BASE : 1 end
def to_a
- See: Selector#to_a -
def to_a res = [syntactic_type == :class ? ":" : "::"] + @name (res << "(").concat(Sass::Util.strip_string_array(@arg)) << ")" if @arg res end
def type
-
(Symbol)
-
def type ACTUALLY_ELEMENTS.include?(name.first) ? :element : syntactic_type end
def unify(sels)
- See: Selector#unify -
def unify(sels) return if type == :element && sels.any? do |sel| sel.is_a?(Pseudo) && sel.type == :element && (sel.name != name || sel.arg != arg) end super end