]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Update Theming docs for removing map items (#25108)
authorMark Otto <markd.otto@gmail.com>
Sat, 30 Dec 2017 15:29:36 +0000 (07:29 -0800)
committerXhmikosR <xhmikosr@gmail.com>
Sat, 30 Dec 2017 15:29:36 +0000 (17:29 +0200)
docs/4.0/getting-started/theming.md

index 33623f4d0a998ac38afbdb2ea09b66362e7d66f9..bc7b5f466fc80cea854078c23e136f23e2f2a15e 100644 (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: