class Sass::Selector::Element

An element selector (e.g. ‘h1`).

def initialize(name, namespace)

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

def to_a

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

def unify(sels)

Other tags:
    See: Selector#unify -

Other tags:
    Todo: - Keep track of whether a default namespace has been declared
    Todo: - There are lots of cases that this documentation specifies;
def unify(sels)
  case sels.first
  when Universal;
  when Element; return unless name == sels.first.name
  else return [self] + sels
  end
  ns, accept = unify_namespaces(namespace, sels.first.namespace)
  return unless accept
  [Element.new(name, ns)] + sels[1..-1]
end