13.14. Sass Introspection function

发布时间 :2024-02-29 23:00:06 UTC      

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

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.