Sass selector function
The Sass selector function is used to view and process selectors.
The following table lists the selector functions for Sass:
Function |
Description & example |
---|---|
|
Compare the matching range of the two selectors, that is, determine whether the super selector contains the range matched by the sub selector, and return true if yes, false otherwise. Example: is-superselector (“div”, “div.myInput”) result: true is-superselector (“div.myInput”, “div”) result: false is-superselector (“div”, “div”) result: true |
|
Add a second (or multiple) to the end of the first selector. Selector. Example: selector-append (“div”, “.myInput”) result: div.myInput selector-append (“.resume”, “_ _ a”) result: .resume _ a |
|
|
|
Returns a new selector that generates a nested list through the list selector provided. Example: selector-nest (“ul”, “li”) result: ul li selector-nest (“.birthday”, “alert”, “div”) result: .resume div, alert div |
|
Converts the selector selector of a string to a selector queue. Example: selector-parse (“H1 .myInput. Yield”) result: (‘H1 ‘.myInput’ ‘.upload’) |
|
Given a selector, replace original with replacement and return a new selector queue. Example: selector-replace (“p.warning”, “p”, “div”) result: div.warning |
|
Synthesize two sets of selectors into a composite selector. If the two selectors cannot be combined, the null value is returned. Example: selector-unify (“myInput”, “.blank”) result: myInput.disabled selector-unify (“p”, “H1”) result: null |
|
Split the composite selector into a single selector. Example: simple-selectors (“div.myInput”) result: div, .myInput simple-selectors (“div.myInput:before”) result: div, .myInput,: before |