Could the bootstrap documentation be wrong in its explanation in this section "Remove from Map"? #41278
Unanswered
RockyMdee32
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been reading the bootstrap documentation, so I have arrived in this section Remove from Map
It says To remove colors from
$theme-colors
, or any other map, usemap-remove
. Be aware you must insert$theme-colors
between our requirements just after its definition in variables and before its usage in maps:and then provides this code
but remember bootstrap's

$theme-colors
map is defined with the!default
flag.This means the value is only assigned if the variable isn't already defined. This means that from the above code provided in the bootstrap documenation by the time the
map-remove()
line is executed,$theme-colors
is already defined. Therefore the!default
flag prevents themap-remove()
from having any effect because the variable already has a value.I have been chatting with Gemini 1.5 Pro and it says to remove keys from a map with !default, you must define your modified map before importing the file that contains the
!default
definition. Here's the correct way to remove"info"
,"light"
, and"dark"
from$theme-colors
:Gemini 1.5 Pro also says if the map you're trying to modify was originally defined with the
!default
flag (as is common in Bootstrap), you can't directly modify it usingmap-remove()
. You'll need to create a new map with the desired key-value pairs.Could there be an error in the bootstrap documentation, or is it possible that I am misunderstanding this section?
Beta Was this translation helpful? Give feedback.
All reactions