13.14. Sass Introspection function

发布时间 : 2025-10-25 13:32:21 UTC      

Page Views: 9 views

Sass Introspection functions are rarely used to build stylesheets and are generally used for code debugging.

The following table lists the Sass’s Introspection function:

Function

Description & example

call(function, arguments...)

The dynamic call of the function, that is, the function parameter of the calling function is arguments and the result is returned.

content-exists()

Check to see if the current blend passes the @ content block.

feature-exists(feature)

Check whether the current Sass implementation supports this feature.

Example: feature-exists (“at-error”); result: true

function-exists(functionname)

Detect whether the specified function exists

Example: function-exists (“nonsense”) result: false

get-function(functionname, css: false)

Returns the specified function. If css is true, a pure CSS function is returned.

global-variable-exists(variablename)

Detects whether a global variable is defined.

Example: variable-exists (a) result: true

inspect(value)

Returns a representation of a string, where value is an sass expression.

mixin-exists(mixinname)

Detects the existence of the specified mixinname.

Example: mixin-exists (“important-text”) result: true

type-of(value)

Returns the value type. The returned values can be number, string, color, list, map, bool, null, function, arglist.

Example: type-of (15px) result: number type-of (# ff0000) result: color

unit(number)

Returns the unit (or compound unit) of the incoming number.

Example: unit (15px) result: px

unitless(number)

Returns a Boolean value to determine whether the incoming number has a unit.

Example: unitless (15px) result: false unitless (15) result: true

variable-exists(variablename)

Determine whether the variable is in the current scope.

Example: variable-exists (b) result: true

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。