Update Theming docs for removing map items (#25108)

This commit is contained in:
Mark Otto 2017-12-30 07:29:36 -08:00 committed by XhmikosR
parent d62a6d32ca
commit 7adaa2f6ef
1 changed files with 9 additions and 1 deletions

View File

@ -93,7 +93,9 @@ Repeat as necessary for any variable in Bootstrap, including the global options
Bootstrap 4 includes a handful of Sass maps, key value pairs that make it easier to generate families of related CSS. We use Sass maps for our colors, grid breakpoints, and more. Just like Sass variables, all Sass maps include the `!default` flag and can be overridden and extended.
For example, to modify an existing color in our `$theme-colors` map, add the following to your custom Sass file:
Some of our Sass maps are merged into empty ones by default. This is done to allow easy expansion of a given Sass map, but comes at the cost of making _removing_ items from a map slightly more difficult.
To modify an existing color in our `$theme-colors` map, add the following to your custom Sass file:
{% highlight scss %}
$theme-colors: (
@ -110,6 +112,12 @@ $theme-colors: (
);
{% endhighlight %}
To remove colors from `$theme-colors`, or any other map, use `map-remove`:
{% highlight scss %}
$theme-colors: map-remove($theme-colors, "success", "info", "danger");
{% endhighlight %}
### Functions
Bootstrap utilizes several Sass functions, but only a subset are applicable to general theming. We've included three functions for getting values from the color maps: