class Sass::Selector::Universal

A universal selector (‘*` in CSS).

def initialize(namespace)

Parameters:
  • namespace (Array, nil) -- See \{#namespace}
def initialize(namespace)
  @namespace = namespace
end

def to_a

Other tags:
    See: Selector#to_a -
def to_a
  @namespace ? @namespace + ["|*"] : ["*"]
end

def unify(sels)

Other tags:
    See: Selector#unify -

Other tags:
    Todo: - If any branch of a CommaSequence ends up being just `"*"`,
    Todo: - Keep track of whether a default namespace has been declared
    Todo: - There are lots of cases that this documentation specifies;
def unify(sels)
  name =
    case sels.first
    when Universal; :universal
    when Element; sels.first.name
    else
      return [self] + sels unless namespace.nil? || namespace == ['*']
      return sels unless sels.empty?
      return [self]
    end
  ns, accept = unify_namespaces(namespace, sels.first.namespace)
  return unless accept
  [name == :universal ? Universal.new(ns) : Element.new(name, ns)] + sels[1..-1]
end