Class Sass::Selector::Sequence
In: lib/sass/selector/sequence.rb
Parent: AbstractSequence

An operator-separated sequence of {SimpleSequence simple selector sequences}.

Methods

Attributes

members  [R]  The array of {SimpleSequence simple selector sequences}, operators, and newlines. The operators are strings such as `"+"` and `">"` representing the corresponding CSS operators. Newlines are also newline strings; these aren‘t semantically relevant, but they do affect formatting.

@return [Array<SimpleSequence, String>]

Public Class methods

@param seqs_and_ops [Array<SimpleSequence, String>] See \{members}

Public Instance methods

Non-destructively extends this selector with the extensions specified in a hash (which should be populated via {Sass::Tree::Node#cssize}).

@overload def do_extend(extends) @param extends [Haml::Util::SubsetMap{Selector::Simple => Selector::Sequence}]

  The extensions to perform on this selector

@return [Array<Sequence>] A list of selectors generated

  by extending this selector with `extends`.
  These correspond to a {CommaSequence}'s {CommaSequence#members members array}.

@see CommaSequence#do_extend

Sets the name of the file in which this selector was declared, or `nil` if it was not declared in a file (e.g. on stdin). This also sets the filename for all child selectors.

@param filename [String, nil] @return [String, nil]

Returns a string representation of the sequence. This is basically the selector string.

@return [String]

Sets the line of the Sass template on which this selector was declared. This also sets the line for all child selectors.

@param line [Fixnum] @return [Fixnum]

Resolves the {Parent} selectors within this selector by replacing them with the given parent selector, handling commas appropriately.

@param super_seq [Sequence] The parent selector sequence @return [Sequence] This selector, with parent references resolved @raise [Sass::SyntaxError] If a parent selector is invalid

Returns whether or not this selector matches all elements that the given selector matches (as well as possibly more).

@example (.foo).superselector?(.foo.bar) #=> true (.foo).superselector?(.bar) #=> false (.bar .foo).superselector?(.foo) #=> false

@param sseq [SimpleSequence] @return [Boolean]

[Validate]