Skip to content

Commit

Permalink
docs: add info on modifying and adding utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke-zhang-04 authored and XhmikosR committed Nov 5, 2020
1 parent 3b98597 commit 5e270a1
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions site/content/docs/5.0/utilities/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,45 @@ $utilities: (
"float": null,
);
```

## Adding to existing utilities

Add new utilities with `map-merge`.Start by importing the utilities stylesheet, then use `map-merge` to add new properties and values.s

```scss
@import "bootstrap/scss/utilities";

$utilities: map-merge(
$utilities,
(
"font-size": (
responsive: true,
property: font-weight,
values: $display-font-sizes,
)
)
);
```

## Modifying existing utilities

Modify existing utilities with `map-get` and `map-merge`. Once again, be sure to import the utilities stylesheet before your custom utilities.

```scss
@import "bootstrap/scss/utilities";

$utilities: map-merge(
$utilities,
(
"width": map-merge(
map-get($utilities, "width"),
(
values: map-merge(
map-get(map-get($utilities, "width"), "values"),
(10: 10%),
),
),
),
)
);
```

0 comments on commit 5e270a1

Please sign in to comment.