Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jpachecox/setup-gulp/llms.txt
Use this file to discover all available pages before exploring further.
_functions.scss provides three pure Sass utility functions that are used throughout the mixin library and color system. They handle the low-level work of color decomposition and string manipulation so the higher-level files (_colors.scss, _mixins.scss) stay readable. The file is loaded into _mixins.scss with @use './functions' at the top of that partial, and into _colors.scss with @import './functions'.
hex-to-rgb($hex)
Converts a Sass color value to a comma-separated R, G, B channel string. The output is designed to be interpolated into a CSS custom property so the property stores bare channel values that can later be wrapped in rgba() at any opacity.
Parameters
| Parameter | Type | Description |
|---|---|---|
$hex | Sass color | Any valid Sass color value, e.g. #a855f7 or purple |
"R, G, B", e.g. "168, 85, 247".
This function is the foundation of the entire opacity variant system in
_colors.scss. Every color token stores its value as raw channels via hex-to-rgb(), which is what makes var(--purple-50) — defined as rgba(var(--purple), 0.5) — resolvable by the browser.red(), green(), and blue() channel functions each return an integer (0–255). The function returns them as a comma-separated list, which interpolation (#{}) then renders as the "R, G, B" string.
str-replace($string, $search, $replace: '')
Performs a recursive find-and-replace on a Sass string. Every occurrence of $search within $string is substituted with $replace. When $replace is omitted it defaults to an empty string, effectively deleting all occurrences of the search term.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
$string | String | — | The source string to search within |
$search | String | — | The substring to find |
$replace | String | '' | The replacement substring; omit to delete |
$suffix after each replacement, so all occurrences are handled — not just the first one.
to-string($value)
Converts any Sass value to its string representation using Sass’s native inspect() function. This is a thin named wrapper that makes intent explicit at call-sites.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | Any | Any Sass value: number, color, list, map, boolean, etc. |
inspect() would produce.
to-string() is used by the background() mixin to convert a Sass color value (which Sass stores as a typed color object) into a plain string before str-slice() strips the leading # to build a valid CSS class name. Without this step, the mixin would receive a color object rather than the "#rrggbb" string it needs.