Sass FunctionsLesson 14Free preview
Sass Introspection
This lesson is part of SASS · All levels
Summary
Introspection helps recognize current data types and structures, such as type-of for data types, units for units of numbers, variables-exists to check for the existence of variables, function-exists, mixin-exists, and inspect to display values in the form of strings. This is widely used for debugging and mixing which needs to adapt to input types.
Key points
- Type-of returns data types such as number, string, color, list, map
- The unit returns the unit of a number, unitless if it is without the unit
- Variable-exists and mixin-exists check the existence of a variable or mixin
- Inspect converts the value into a string representation for debugging purposes
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.