Sass 简介
Sass 安装
Sass 变量
Sass Nested Rules and Properties
Sass @import and Partials
Sass @mixin and @include
Sass @extend and Inheritance
Sass 函数
Sass String
Sass Numeric
Sass List
Sass Map
Sass Selector
Sass Introspection
Sass Color
Sass Selector - SASS基础教程 - 笔下光年
网站首页
Sass Selector
The selector functions are used to check and manipulate selectors. The following table lists all selector functions in Sass: | Function | Description & Example | |---------------------------|--------------------------------| | is-superselector(super, sub) | Checks whether the super selector matches all the elements that sub matches. <br/><br/>**Example:**<br/>`is-superselector("div", "div.myInput")`<br/>Result: `trueis-superselector("div.myInput", "div")`<br/>Result: `falseis-superselector("div", "div")`<br/>Result: `true` | | selector-append(selectors) | Appends the second (and third/fourth etc.) selector to the first selector. <br/><br/>**Example:**<br/>`selector-append("div", ".myInput")`<br/>Result: `div.myInputselector-append(".warning", "__a")`<br/>Result: `.warning__a` | | selector-extend(selector, extendee, extender) | | | selector-nest(selectors) | Returns a new selector containing a nested list of CSS selectors based on the list provided. <br/><br/>**Example:**<br/>`selector-nest("ul", "li")`<br/>Result: `ul liselector-nest(".warning", "alert", "div")`<br/>Result: `.warning div, alert div` | | selector-parse(selector) | Returns a list of strings contained in selector using the same format as the parent selector. <br/><br/>**Example:**<br/>`selector-parse("h1 .myInput .warning")`<br/>Result: `('h1' '.myInput' '.warning')` | | selector-replace(selector, original, replacement) | Returns a new selector with the selectors specified in replacement in place of selectors specified in original. <br/><br/>**Example:**<br/>`selector-replace("p.warning", "p", "div")`<br/>Result: `div.warning` | | selector-unify(selector1, selector2) | Returns a new selector that matches only elements matched by both selector1 and selector2. <br/><br/>**Example:**<br/>`selector-unify("myInput", ".disabled")`<br/>Result: `myInput.disabled`<br/>`selector-unify("p", "h1")`<br/>Result: `null` | | simple-selectors(selectors) | Returns a list of the individual selectors in selectors. <br/><br/>**Example:**<br/>`simple-selectors("div.myInput")`<br/>Result: `div, .myInput`<br/>`simple-selectors("div.myInput:before")`<br/>Result: `div, .myInput, :before` |
上一篇:
Sass Map
下一篇:
Sass Introspection