// 4. Import Bootstrap variables and dark variables AFTER your manual definitions to allow any defaults to fill the rest (safe to import)
@import "../../vendor/bower-asset/bootstrap/scss/variables";
@import "../../vendor/bower-asset/bootstrap/scss/variables-dark";
// 6. Bootstrap core and components (import only what you need)
@import "../../vendor/bower-asset/bootstrap/scss/root";
@import "../../vendor/bower-asset/bootstrap/scss/reboot";
is telling us that when importing Bootstrap's _utilities.scss, it expects the variable $utilities-text-emphasis-colors to be defined—but it is missing or undefined at this point in your build.
Why does this happen?
Bootstrap 5.3+ (and some 5.2+ versions) adds a number of utility color maps that need to be explicitly defined if you are customizing the theme colors and doing manual overrides. This is particularly important when you override the core $theme-colors map manually, as in your file, and you import Bootstrap's variables and utilities afterwards.
Your current code defines a lot of custom color maps, such as:
$theme-colors
$theme-colors-rgb
$theme-colors-text
$theme-colors-text-dark
$utilities-text-colors
etc.
However, Bootstrap also requires the presence of a few other utility color maps, including (but not limited to):
$utilities-text-emphasis-colors
$utilities-border-emphasis-colors
$utilities-bg-emphasis-colors
These are missing in your code, which leads the built Bootstrap .scss file to encounter an undefined variable.
How to fix it?
You need to explicitly define $utilities-text-emphasis-colorsand potentially other missing "emphasis" maps before importing Bootstrap's utilities.
Minimal $utilities-text-emphasis-colors definition to fix your error
Add this after your existing utilities color maps are defined, but before you import Bootstrap's utilities:
means that Bootstrap expects the variable $utilities-text-emphasis-colors to be defined before it compiles _utilities.scss, but it isn’t.
How to fix this step-by-step
Your current problem
You have overridden $theme-colors (which is fine) but you didn’t define some dependent utility variables Bootstrap needs, including:
$utilities-text-emphasis-colors (causing this error)
Possibly others (border-emphasis, bg-emphasis...)
These variables are normally set by Bootstrap internal _variables.scssunless you override $theme-colors BEFORE importing those variables—but then you also must define these derived variables yourself.
The solution
You need to explicitly declare the missing variable before importing Bootstrap's utilities code.
Add this snippet right after your other $utilities-text-colors, $utilities-border-colors, etc., mappings and before importing Bootstrap variables & mixins:
When you override $theme-colors early in your file, Bootstrap skips defining these dependent variables from default because your overrides take priority. So you must provide all dependent color maps manually before importing Bootstrap internal variables and utilities SCSS.
Let me know if you want me to prepare the complete minimal bootstrap overrides with all missing maps!
Sure! I'll update your original code to include the missing variable $utilities-text-emphasis-colors (and also define the related $utilities-bg-emphasis-colors and $utilities-border-emphasis-colors for completeness, to avoid similar errors in the future).
means that Bootstrap’s utilities expect the variable $utilities-links-underline to be defined but it isn’t.
This is the same type of issue you had earlier: by overriding Bootstrap variables early without importing all defaults first, you now need to manually define missing utility variables that Bootstrap relies on.
How to fix $utilities-links-underline
What is $utilities-links-underline?
This is a map that controls which link-related text utilities get underlined, added in Bootstrap 5.3+ for better utility management.
Bootstrap expects you to define it if you override defaults manually.
You can customize true/false values as needed, but this matches Bootstrap default behavior: most colors underline links except light which typically doesn’t.
Where to add it
Add the variable after your other utility variables but BEFORE importing Bootstrap variables and mixins, i.e. near where you added $utilities-text-emphasis-colors earlier.
Full placement example (append to your existing fix):
Define $utilities-links-underline as above, right alongside your other $utilities-* variables before importing Bootstrap variables/mixins.
This fixes the new "undefined variable" errors inside _utilities.scss.
Bootstrap adds new utility maps over versions—when doing theme overrides like yours, you must keep an eye on missing variables and define them manually.
If further variables cause errors, let me know! I can keep helping you by generating the missing variables.
Bootstrap is again complaining about an undefined variable:
code
values: $utilities-bg-subtle
Explanation
You previously defined $theme-colors-bg-subtle but you didn’t define the corresponding $utilities-bg-subtle map that Bootstrap expects internally in _utilities.scss.
Recall from your original code you have defined a $utilities-border-subtle but not $utilities-bg-subtle.
Solution: define $utilities-bg-subtle
Add the following map, before importing Bootstrap variables and mixins, along with your other $utilities-* maps:
This manual inclusion of these utility variables is necessary because Bootstrap expects you to maintain these dependencies yourself if you override core color maps before importing their default variables.
If you want, I can provide an updated full fixed version of your file with all these fixes applied. Let me know!