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 Introspection - SASS基础教程 - 笔下光年
网站首页
Sass Introspection
The introspection functions are rarely used when building a stylesheet. However, they are valuable if something does not work properly - to figure out what's going on: like debugging functions. The following table lists all introspection functions in Sass: | Function | Description & Example | |-------------------|---------------------| | call(function, arguments...) | Calls a function with arguments, and returns the result. | | content-exists() | Checks whether the current mixin was passed a @content block. | | feature-exists(feature) | Checks whether feature is supported by the current Sass implementation. <br/><br/>**Example:**<br/>`feature-exists("at-error");`<br/>Result: `true` | | function-exists(functionname) | Checks whether the specified function exists. <br/><br/>**Example:**<br/>`function-exists("nonsense")`<br/>Result: `false` | | get-function(functionname, css: false) | Returns the specified function. If css is true, it returns a plain CSS function instead. | | global-variable-exists(variablename) | Checks whether the specified global variable exists. <br/><br/>**Example:**<br/>`variable-exists(a)`<br/>Result: `true` | | inspect(value) | Returns a string representation of value. | | mixin-exists(mixinname) | Checks whether the specified mixin exists. <br/><br/>**Example:**<br/>`mixin-exists("important-text")`<br/>Result: `true` | | type-of(value) | Returns the type of value. Can be number, string, color, list, map, bool, null, function, arglist. <br/><br/>**Example:**<br/>`type-of(15px)`<br/>Result: `numbertype-of(#ff0000)`<br/>Result: `color` | | unit(number) | Returns the unit associated with a number. <br/><br/>**Example:**<br/>`unit(15px)`<br/>Result: `px` | | unitless(number) | Checks whether the specified number has a unit associated with it. <br/><br/>**Example:**<br/>`unitless(15px)`<br/>Result: `falseunitless(15)`<br/>Result: `true` | | variable-exists(variablename) | Checks whether the specified variable exists in the current scope. <br/><br/>**Example:**<br/>`variable-exists(b)`<br/>Result: `true` |
上一篇:
Sass Selector
下一篇:
Sass Color