Skip to content

Commit 748cbed

Browse files
committed
document it instead
1 parent 8944e07 commit 748cbed

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

site/src/content/docs/customize/sass.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,19 @@ values: map-get-nested($font-sizes, "font-size")
444444
// Returns: ("xs": clamp(...), "sm": clamp(...), ...)
445445
```
446446

447+
#### `negativify-map($map)`
448+
449+
Turns a map into its negative variant by prefixing each key with `n` and negating the value. Keys equal to `0` are skipped. This is used internally to generate negative spacer utilities (e.g., `n1`, `n2`, etc.) from the `$spacers` map.
450+
451+
```scss
452+
@function negativify-map($map) { ... }
453+
454+
// Example: generate negative spacers from a spacers map
455+
$spacers: (0: 0, 1: .25rem, 2: .5rem, 3: 1rem);
456+
$negative-spacers: negativify-map($spacers);
457+
// Returns: ("n1": -.25rem, "n2": -.5rem, "n3": -1rem)
458+
```
459+
447460
### Theme color values
448461

449462
The [`theme-color-values($key)`]([[docsref:/customize/theme]]) function in `scss/_theme.scss` extracts a specific sub-key from every entry in the `$theme-colors` map, returning a flat map of color names to values. Since each theme color is a nested map with sub-keys like `base`, `text`, `bg`, `border`, etc., this function lets you pull one of those sub-keys across all colors at once. It powers most of the color-related utilities in `_utilities.scss`:

0 commit comments

Comments
 (0)