### Getting a Color's Color Space in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Documents the color.space() function, which returns the name of the color space the given color is defined in. ```Sass color.space($color) ``` -------------------------------- ### Merging Nested Maps with map.deep-merge() in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Demonstrates how to use the `map.deep-merge()` function in Sass to recursively merge nested maps. The example shows merging a map containing a nested 'color' map with another map that updates a value within the same nested map. ```Sass map.deep-merge( (color: (primary: red, secondary: blue), (color: (secondary: teal) ) // => (color: (primary: red, secondary: teal)) ``` -------------------------------- ### Removing Nested Map Keys with map.deep-remove() in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Illustrates the usage of the `map.deep-remove()` function in Sass to remove a key from a nested map. The example shows removing the 'primary' key from the nested 'color' map using a sequence of keys. ```Sass map.deep-remove( (color: (primary: red, secondary: blue)), color, primary ) // => (color: (secondary: blue)) ``` -------------------------------- ### Initializing Local Development Dependencies with Paths - Shell Source: https://github.com/sass/embedded-host-node/blob/main/CONTRIBUTING.md Demonstrates how to use the `npm run init` command with `---path` flags to specify local filesystem paths for the compiler and language dependencies. This is essential for local development when working on the host and its dependencies concurrently. ```Shell npm run init -- --compiler-path=dart-sass --language-path=language ``` -------------------------------- ### Compiling Sass with sass-embedded (JavaScript) Source: https://github.com/sass/embedded-host-node/blob/main/README.md Demonstrates how to use the `sass-embedded` package to compile Sass files using both the synchronous `compile` and asynchronous `compileAsync` methods. Note that the asynchronous method is generally faster due to the compilation running in a separate process. ```JavaScript const sass = require('sass-embedded'); const result = sass.compile(scssFilename); // OR const result = await sass.compileAsync(scssFilename); ``` -------------------------------- ### New CSS Color Level 4 Functions in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Lists the new color functions introduced to support CSS Color Level 4 color spaces, including oklab(), oklch(), lab(), lch(), the space-separated hwb(), and the versatile color() function supporting various color spaces. ```Sass oklab() oklch() lab() lch() hwb() /* space-separated syntax */ color() /* supports srgb, display-p3, etc. */ ``` -------------------------------- ### Comparing Sass RGB Colors with Non-Integer Channels Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Illustrates the change where Sass no longer rounds RGB channels to integers, aligning with CSS spec and browser behavior. Shows that colors differing only by fractional values are now considered unequal. ```Sass rgb(0 0 1) != rgb(0 0 0.6) ``` -------------------------------- ### Converting Colors to Different Color Spaces in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Documents the color.to-space() function, the primary method for converting a color to a specified color space. Explains that conversions are generally lossless but may result in out-of-gamut colors, which are handled differently by hsl/hwb (clamped) vs. others (potentially displayed by browsers). ```Sass color.to-space($color, $space) ``` -------------------------------- ### Media Query Not Expression Parsing (Sass) Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Demonstrates a change in how Sass parses 'not' expressions at the beginning of parenthesized sections within media queries. Previously, this would be evaluated; now, it is emitted unchanged to match CSS specifications. ```scss @media (width >= 500px) and (not (grid)) ``` -------------------------------- ### Using Percentage Alpha in Sass color.change Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Explains the breaking change where percentage units for the $alpha parameter in color manipulation functions like color.change() are now interpreted as percentages, affecting the resulting color's opacity. ```Sass color.change(red, $alpha: 50%) ``` -------------------------------- ### Accessing Color Channels in Specific Spaces in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Documents the color.channel() function, which replaces older functions like color.red(). It allows retrieving the value of a specific channel for a color, optionally converting the color to a different space first. ```Sass color.channel($color, $channel, $space: null) ``` -------------------------------- ### Comparing Colors Across Different Color Spaces in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Documents the color.same() function, which checks if two colors represent the same visual color, even if they are defined in different color spaces. Contrasts this with the == operator, which considers colors in different non-legacy spaces unequal. ```Sass color.same($color1, $color2) ``` -------------------------------- ### Constraining a Color to its Gamut in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Documents the color.to-gamut() function, which returns a color clamped to the valid range of its color space or a specified target space. Notes that this is often unnecessary as browsers handle out-of-gamut colors. ```Sass color.to-gamut($color, $space: null) ``` -------------------------------- ### Checking for Powerless Color Channels in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Documents the color.is-powerless() function, which checks if a specific channel in a color (optionally converted to a space) has no effect on the color's appearance, such as the hue channel for a grayscale color. ```Sass color.is-powerless($color, $channel, $space: null) ``` -------------------------------- ### Checking for Missing Color Channel Values in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Documents the color.is-missing() function, which checks if a specific channel in a color has a missing value. Missing values can be explicitly set with none or result from conversions, and are typically treated as 0 or the other color's value during interpolation/mixing. ```Sass color.is-missing($color, $channel) ``` -------------------------------- ### Checking if a Color is in a Legacy Space in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Documents the color.is-legacy() function, which returns true if the color is defined in one of the legacy color spaces (rgb, hsl, or hwb). ```Sass color.is-legacy($color) ``` -------------------------------- ### Checking if a Color is In-Gamut in Sass Source: https://github.com/sass/embedded-host-node/blob/main/CHANGELOG.md Documents the color.is-in-gamut() function, which determines if a color is within the valid range (gamut) of its current color space or a specified target space. ```Sass color.is-in-gamut($color, $space: null) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.