is_superselector

is_superselector($super, $sub)

Returns whether $super is a superselector of $sub. This means that $super matches all the elements that $sub matches, as well as possibly additional elements. In general, simpler selectors tend to be superselectors of more complex oned.

Examples:

is-superselector(".foo", ".foo.bar") => true
is-superselector(".foo.bar", ".foo") => false
is-superselector(".bar", ".foo .bar") => true
is-superselector(".foo .bar", ".bar") => false

Returns Whether $selector1 is a superselector of $selector2.

Parameters:

  • $super (String, List) The potential superselector. This can be either a string, a list of strings, or a list of lists of strings as returned by &.
  • $sub (String, List) The potential subselector. This can be either a string, a list of strings, or a list of lists of strings as returned by &.

Returns:

  • (Bool) Whether $selector1 is a superselector of $selector2.
doc_Sass
2016-11-11 13:09:11
Comments
Leave a Comment

Please login to continue.