Explore bootstrap 5.3 trying to change dropdown menu selecting color to fit my theme… Save Share Download ▾ Reportbootstrap 5.3 trying to change dropdown menu selecting color to fit my theme
.form-select.square {
background-color: map-get(t h e m e − c o l o r s , " d a r k " ) ; / / n o r m a l b g c o l o r : m a p − g e t ( theme-colors, "dark"); // normal bg
color: map-get( t h e m e − co l or s , " d a r k " ) ; // n or theme-colors, "light"); // normal text
border-color: map-get($theme-colors, "secondary"); // border color
border-radius: 0; // square corners (optional)
Show full message · 353 lines Assistant2025-07-14 22:12 UTC Copy response
rewrite the code and send the fixed complete file, no other changes
Assistant2025-07-14 22:13 UTC Copy response
Copy first prompt
Details
Provider OpenAI
Model provenance As recorded by source dataset
Turns 2 (4 messages)
Language en
Conversation date Jul 14, 2025
Added to archive Nov 17, 2026
ID 01m7h42x6j408c1jge00xv4zafSource & license Imported from WildChat-4.8M (AI2) (source ). Imported records earn no Research Points.
Upstream record: d36f86668128c266669845ffcc7e194c
Zhao et al., WildChat: 1M ChatGPT Interaction Logs in the Wild (ICLR 2024). Contains information from WildChat-4.8M, made available under the ODC Attribution License.
License: ODC-BY-1.0
ma
l
b
g
co
l
or
:
ma p −
g e t (
&:focus {
background-color: map-get(t h e m e − c o l o r s , " d a r k " ) ; / / k e e p b g s a m e o n f o c u s c o l o r : m a p − g e t ( theme-colors, "dark"); // keep bg same on focus
color: map-get( t h e m e − co l or s , " d a r k " ) ; // k ee p b g s am eo n f oc u sco l or : ma p − g e t ( theme-colors, "light"); // keep text same on focus
border-color: map-get(t h e m e − c o l o r s , " p r i m a r y " ) ; / / h i g h l i g h t b o r d e r o n f o c u s b o x − s h a d o w : 0000.25 r e m r g b a ( r e d ( m a p − g e t ( theme-colors, "primary"); // highlight border on focus
box-shadow: 0 0 0 0.25rem rgba(
red(map-get( t h e m e − co l or s , theme-colors, "primary")),
green(map-get(t h e m e − c o l o r s , " p r i m a r y " ) ) , b l u e ( m a p − g e t ( theme-colors, "primary")),
blue(map-get( t h e m e − co l or s , " p r ima r y " )) , b l u e ( ma p − theme-colors, "primary")),
0.25
);
outline: none;
}
}
// 1. Import Bootstrap functions first (required)
@import "../../vendor/bower-asset/bootstrap/scss/functions";
// 2. Define your overridden variables WITHOUT !default (your custom theme and base colors)
$theme-colors: (
"primary": #0c7c94,
"secondary": #babcc9,
"success": #6b8f8e,
"info": #7889a4,
"warning": #98843e,
"danger": #822c2a,
"light": #ebebeb,
"dark": #65656a
);
white: #ffffff;
black: #000000;
$body-color: #333333;
f o n t − f a m i l y − s a n s − s e r i f : ′ R o b o t o ′ , A r i a l , s a n s − s e r i f ; font-family-sans-serif: 'Roboto', Arial, sans-serif;
f o n t − f ami l y − s an s − ser i f : ′ R o b o t o ′ , A r ia l , s an s − ser i f ; headings-font-family: 'Poppins', Georgia, serif;
$gutters: (
xs: 1rem,
sm: 1.5rem,
md: 2rem,
lg: 2.5rem,
xl: 3rem,
xxl: 3.5rem
);
l i n k − c o l o r : m a p − g e t ( link-color: map-get( l ink − co l or : ma p − g e t ( theme-colors, "primary");
$link-hover-color: #5a5f56;
b t n − p a d d i n g − y : 0.5 r e m ; btn-padding-y: 0.5rem;
b t n − p a dd in g − y : 0.5 r e m ; btn-padding-x: 1.2rem;
// === Explicitly generate all required dependent maps ===
// t h e m e − c o l o r s − r g b theme-colors-rgb
t h e m e − co l or s − r g b theme-colors-rgb: ();
@each c o l o r , color, co l or , hex in theme-colors {
theme-colors-rgb: map-merge(
t h e m e − c o l o r s − r g b , ( theme-colors-rgb,
( t h e m e − co l or s − r g b , ( color: (red(h e x ) , g r e e n ( hex), green( h e x ) , g r ee n ( hex), blue($hex)))
);
}
// t h e m e − c o l o r s − t e x t theme-colors-text
t h e m e − co l or s − t e x t theme-colors-text: (
"primary": w h i t e , " s e c o n d a r y " : white,
"secondary": w hi t e , " seco n d a r y " : white,
"success": w h i t e , " i n f o " : white,
"info": w hi t e , " in f o " : white,
"warning": b o d y − c o l o r , " d a n g e r " : body-color,
"danger": b o d y − co l or , " d an g er " : white,
"light": b o d y − c o l o r , " d a r k " : body-color,
"dark": b o d y − co l or , " d a r k " : white
);
// t h e m e − c o l o r s − t e x t − d a r k theme-colors-text-dark
t h e m e − co l or s − t e x t − d a r k theme-colors-text-dark: ();
@each c o l o r , color, co l or , val in theme-colors-text {
theme-colors-text-dark: map-merge(
t h e m e − c o l o r s − t e x t − d a r k , ( theme-colors-text-dark,
( t h e m e − co l or s − t e x t − d a r k , ( color: if(c o l o r = = " d a r k " , color == "dark", co l or == " d a r k " , white, $black))
);
}
// t h e m e − c o l o r s − b g − s u b t l e theme-colors-bg-subtle
t h e m e − co l or s − b g − s u b tl e theme-colors-bg-subtle: ();
@each c o l o r , color, co l or , rgb in theme-colors-rgb {
theme-colors-bg-subtle: map-merge(
t h e m e − c o l o r s − b g − s u b t l e , ( theme-colors-bg-subtle,
( t h e m e − co l or s − b g − s u b tl e , ( color: rgba(nth(r g b , 1 ) , n t h ( rgb, 1), nth( r g b , 1 ) , n t h ( rgb, 2), nth($rgb, 3), 0.1))
);
}
// t h e m e − c o l o r s − b o r d e r − s u b t l e theme-colors-border-subtle
t h e m e − co l or s − b or d er − s u b tl e theme-colors-border-subtle: ();
@each c o l o r , color, co l or , rgb in theme-colors-rgb {
theme-colors-border-subtle: map-merge(
t h e m e − c o l o r s − b o r d e r − s u b t l e , ( theme-colors-border-subtle,
( t h e m e − co l or s − b or d er − s u b tl e , ( color: rgba(nth(r g b , 1 ) , n t h ( rgb, 1), nth( r g b , 1 ) , n t h ( rgb, 2), nth($rgb, 3), 0.25))
);
}
// t h e m e − c o l o r s − b g − s u b t l e − d a r k theme-colors-bg-subtle-dark
t h e m e − co l or s − b g − s u b tl e − d a r k theme-colors-bg-subtle-dark: ();
@each c o l o r , color, co l or , rgb in theme-colors-rgb {
theme-colors-bg-subtle-dark: map-merge(
t h e m e − c o l o r s − b g − s u b t l e − d a r k , ( theme-colors-bg-subtle-dark,
( t h e m e − co l or s − b g − s u b tl e − d a r k , color: rgba(nth(r g b , 1 ) , n t h ( rgb, 1), nth( r g b , 1 ) , n t h ( rgb, 2), nth($rgb, 3), 0.15))
);
}
// t h e m e − c o l o r s − b o r d e r − s u b t l e − d a r k theme-colors-border-subtle-dark
t h e m e − co l or s − b or d er − s u b tl e − d a r k theme-colors-border-subtle-dark: ();
@each c o l o r , color, co l or , rgb in theme-colors-rgb {
theme-colors-border-subtle-dark: map-merge(
t h e m e − c o l o r s − b o r d e r − s u b t l e − d a r k , ( theme-colors-border-subtle-dark,
( t h e m e − co l or s − b or d er − s u b tl e − d color: rgba(nth(r g b , 1 ) , n t h ( rgb, 1), nth( r g b , 1 ) , n t h ( rgb, 2), nth($rgb, 3), 0.5))
);
}
// u t i l i t i e s − b o r d e r − c o l o r s utilities-border-colors
u t i l i t i es − b or d er − co l or s utilities-border-colors: (
"primary": map-get(t h e m e − c o l o r s , " p r i m a r y " ) , " s e c o n d a r y " : m a p − g e t ( theme-colors, "primary"),
"secondary": map-get( t h e m e − co l or s , " p r ima r y " ) , " seco n d a r y " : ma p − g e t ( theme-colors, "secondary"),
"success": map-get(t h e m e − c o l o r s , " s u c c e s s " ) , " i n f o " : m a p − g e t ( theme-colors, "success"),
"info": map-get( t h e m e − co l or s , " s u ccess " ) , " in f o " : ma p theme-colors, "info"),
"warning": map-get(t h e m e − c o l o r s , " w a r n i n g " ) , " d a n g e r " : m a p − g e t ( theme-colors, "warning"),
"danger": map-get( t h e m e − co l or s , " w a r nin g " ) , " d an g er " : theme-colors, "danger"),
"light": map-get(t h e m e − c o l o r s , " l i g h t " ) , " d a r k " : m a p − g e t ( theme-colors, "light"),
"dark": map-get( t h e m e − co l or s , " l i g h t " ) , " d a r k " : theme-colors, "dark")
);
// u t i l i t i e s − b o r d e r − s u b t l e utilities-border-subtle
u t i l i t i es − b or d er − s u b tl e utilities-border-subtle: (
"primary": rgba(map-get(t h e m e − c o l o r s , " p r i m a r y " ) , 0.25 ) , " s e c o n d a r y " : r g b a ( m a p − g e t ( theme-colors, "primary"), 0.25),
"secondary": rgba(map-get( t h e m e − co l or s , " p r ima r y " ) , 0.25 ) , " seco n d a r y " : r g ba ( ma p − g e t ( theme-colors, "secondary"), 0.25),
"success": rgba(map-get(t h e m e − c o l o r s , " s u c c e s s " ) , 0.25 ) , " i n f o " : r g b a ( m a p − g e t ( theme-colors, "success"), 0.25),
"info": rgba(map-get( t h e m e − co l or s , " s u ccess " ) , 0.25 ) , " in f o theme-colors, "info"), 0.25),
"warning": rgba(map-get(t h e m e − c o l o r s , " w a r n i n g " ) , 0.25 ) , " d a n g e r " : r g b a ( m a p − g e t ( theme-colors, "warning"), 0.25),
"danger": rgba(map-get( t h e m e − co l or s , " w a r nin g " ) , 0.25 ) , theme-colors, "danger"), 0.25),
"light": rgba(map-get(t h e m e − c o l o r s , " l i g h t " ) , 0.25 ) , " d a r k " : r g b a ( m a p − g e t ( theme-colors, "light"), 0.25),
"dark": rgba(map-get( t h e m e − co l or s , " l i g h t " ) , 0.25 ) , " d a theme-colors, "dark"), 0.25)
);
// u t i l i t i e s − t e x t − c o l o r s utilities-text-colors
u t i l i t i es − t e x t − co l or s utilities-text-colors: (
"primary": map-get(t h e m e − c o l o r s , " p r i m a r y " ) , " s e c o n d a r y " : m a p − g e t ( theme-colors, "primary"),
"secondary": map-get( t h e m e − co l or s , " p r ima r y " ) , " seco n d a r y " : ma p − g e t ( theme-colors, "secondary"),
"success": map-get(t h e m e − c o l o r s , " s u c c e s s " ) , " i n f o " : m a p − g e t ( theme-colors, "success"),
"info": map-get( t h e m e − co l or s , " s u ccess " ) , " in f o " : ma p theme-colors, "info"),
"warning": map-get(t h e m e − c o l o r s , " w a r n i n g " ) , " d a n g e r " : m a p − g e t ( theme-colors, "warning"),
"danger": map-get( t h e m e − co l or s , " w a r nin g " ) , " d an g er " : theme-colors, "danger"),
"light": map-get(t h e m e − c o l o r s , " l i g h t " ) , " d a r k " : m a p − g e t ( theme-colors, "light"),
"dark": map-get( t h e m e − co l or s , " l i g h t " ) , " d a r k " : theme-colors, "dark")
);
// u t i l i t i e s − b g − c o l o r s utilities-bg-colors
u t i l i t i es − b g − co l or s utilities-bg-colors: (
"primary": map-get(t h e m e − c o l o r s , " p r i m a r y " ) , " s e c o n d a r y " : m a p − g e t ( theme-colors, "primary"),
"secondary": map-get( t h e m e − co l or s , " p r ima r y " ) , " seco n d a r y " : ma p − g e t ( theme-colors, "secondary"),
"success": map-get(t h e m e − c o l o r s , " s u c c e s s " ) , " i n f o " : m a p − g e t ( theme-colors, "success"),
"info": map-get( t h e m e − co l or s , " s u ccess " ) , " in f o " : ma p theme-colors, "info"),
"warning": map-get(t h e m e − c o l o r s , " w a r n i n g " ) , " d a n g e r " : m a p − g e t ( theme-colors, "warning"),
"danger": map-get( t h e m e − co l or s , " w a r nin g " ) , " d an g er " : theme-colors, "danger"),
"light": map-get(t h e m e − c o l o r s , " l i g h t " ) , " d a r k " : m a p − g e t ( theme-colors, "light"),
"dark": map-get( t h e m e − co l or s , " l i g h t " ) , " d a r k " : theme-colors, "dark")
);
// *** Add missing variables (this fixes your error) ***
// u t i l i t i e s − t e x t − e m p h a s i s − c o l o r s utilities-text-emphasis-colors
u t i l i t i es − t e x t − e m p ha s i s − co l or s utilities-text-emphasis-colors: (
"primary": rgba(map-get(t h e m e − c o l o r s , " p r i m a r y " ) , 0.9 ) , " s e c o n d a r y " : r g b a ( m a p − g e t ( theme-colors, "primary"), 0.9),
"secondary": rgba(map-get( t h e m e − co l or s , " p r ima r y " ) , 0.9 ) , " seco n d a r y " : r g ba ( ma p − g e t ( theme-colors, "secondary"), 0.9),
"success": rgba(map-get(t h e m e − c o l o r s , " s u c c e s s " ) , 0.9 ) , " i n f o " : r g b a ( m a p − g e t ( theme-colors, "success"), 0.9),
"info": rgba(map-get( t h e m e − co l or s , " s u ccess " ) , 0.9 ) , " in f o theme-colors, "info"), 0.9),
"warning": rgba(map-get(t h e m e − c o l o r s , " w a r n i n g " ) , 0.9 ) , " d a n g e r " : r g b a ( m a p − g e t ( theme-colors, "warning"), 0.9),
"danger": rgba(map-get( t h e m e − co l or s , " w a r nin g " ) , 0.9 ) , theme-colors, "danger"), 0.9),
"light": rgba(map-get(t h e m e − c o l o r s , " l i g h t " ) , 0.9 ) , " d a r k " : r g b a ( m a p − g e t ( theme-colors, "light"), 0.9),
"dark": rgba(map-get( t h e m e − co l or s , " l i g h t " ) , 0.9 ) , " d a theme-colors, "dark"), 0.9)
);
// u t i l i t i e s − b g − e m p h a s i s − c o l o r s utilities-bg-emphasis-colors
u t i l i t i es − b g − e m p ha s i s − co l or s utilities-bg-emphasis-colors: (
"primary": rgba(map-get(t h e m e − c o l o r s , " p r i m a r y " ) , 0.15 ) , " s e c o n d a r y " : r g b a ( m a p − g e t ( theme-colors, "primary"), 0.15),
"secondary": rgba(map-get( t h e m e − co l or s , " p r ima r y " ) , 0.15 ) , " seco n d a r y " : r g ba ( ma p − g e t ( theme-colors, "secondary"), 0.15),
"success": rgba(map-get(t h e m e − c o l o r s , " s u c c e s s " ) , 0.15 ) , " i n f o " : r g b a ( m a p − g e t ( theme-colors, "success"), 0.15),
"info": rgba(map-get( t h e m e − co l or s , " s u ccess " ) , 0.15 ) , " in f o theme-colors, "info"), 0.15),
"warning": rgba(map-get(t h e m e − c o l o r s , " w a r n i n g " ) , 0.15 ) , " d a n g e r " : r g b a ( m a p − g e t ( theme-colors, "warning"), 0.15),
"danger": rgba(map-get( t h e m e − co l or s , " w a r nin g " ) , 0.15 ) , theme-colors, "danger"), 0.15),
"light": rgba(map-get(t h e m e − c o l o r s , " l i g h t " ) , 0.15 ) , " d a r k " : r g b a ( m a p − g e t ( theme-colors, "light"), 0.15),
"dark": rgba(map-get( t h e m e − co l or s , " l i g h t " ) , 0.15 ) , " d a theme-colors, "dark"), 0.15)
);
// u t i l i t i e s − b o r d e r − e m p h a s i s − c o l o r s utilities-border-emphasis-colors
u t i l i t i es − b or d er − e m p ha s i s − co l or s utilities-border-emphasis-colors: (
"primary": rgba(map-get(t h e m e − c o l o r s , " p r i m a r y " ) , 0.75 ) , " s e c o n d a r y " : r g b a ( m a p − g e t ( theme-colors, "primary"), 0.75),
"secondary": rgba(map-get( t h e m e − co l or s , " p r ima r y " ) , 0.75 ) , " seco n d a r y " : r g ba ( ma p − g e t ( theme-colors, "secondary"), 0.75),
"success": rgba(map-get(t h e m e − c o l o r s , " s u c c e s s " ) , 0.75 ) , " i n f o " : r g b a ( m a p − g e t ( theme-colors, "success"), 0.75),
"info": rgba(map-get( t h e m e − co l or s , " s u ccess " ) , 0.75 ) , " in f o theme-colors, "info"), 0.75),
"warning": rgba(map-get(t h e m e − c o l o r s , " w a r n i n g " ) , 0.75 ) , " d a n g e r " : r g b a ( m a p − g e t ( theme-colors, "warning"), 0.75),
"danger": rgba(map-get( t h e m e − co l or s , " w a r nin g " ) , 0.75 ) , theme-colors, "danger"), 0.75),
"light": rgba(map-get(t h e m e − c o l o r s , " l i g h t " ) , 0.75 ) , " d a r k " : r g b a ( m a p − g e t ( theme-colors, "light"), 0.75),
"dark": rgba(map-get( t h e m e − co l or s , " l i g h t " ) , 0.75 ) , " d a theme-colors, "dark"), 0.75)
);
// n e g a t i v e − s p a c e r s ( r e q u i r e d b y u t i l i t i e s f o r n e g a t i v e m a r g i n u t i l i t i e s ) negative-spacers (required by utilities for negative margin utilities)
n e g a t i v e − s p a cer s ( r e q u i r e d b y u t i l i t i es f or n e g a t i v e ma r g in u t i l i t i es ) negative-spacers: (
0: 0,
1: -0.25rem,
2: -0.5rem,
3: -1rem,
4: -1.5rem,
5: -3rem
);
// u t i l i t i e s − l i n k s − u n d e r l i n e utilities-links-underline
u t i l i t i es − l ink s − u n d er l in e utilities-links-underline: (
"primary": true,
"secondary": true,
"success": true,
"info": true,
"warning": true,
"danger": true,
"light": false,
"dark": true
);
// u t i l i t i e s − b g − s u b t l e — a d d t h i s : utilities-bg-subtle — add this:
u t i l i t i es − b g − s u b tl e — a dd t hi s : utilities-bg-subtle: (
"primary": map-get(t h e m e − c o l o r s − b g − s u b t l e , " p r i m a r y " ) , " s e c o n d a r y " : m a p − g e t ( theme-colors-bg-subtle, "primary"),
"secondary": map-get( t h e m e − co l or s − b g − s u b tl e , " p r ima r y " ) , " seco n d a r y " : ma p theme-colors-bg-subtle, "secondary"),
"success": map-get(t h e m e − c o l o r s − b g − s u b t l e , " s u c c e s s " ) , " i n f o " : m a p − g e t ( theme-colors-bg-subtle, "success"),
"info": map-get( t h e m e − co l or s − b g − s u b tl theme-colors-bg-subtle, "info"),
"warning": map-get(t h e m e − c o l o r s − b g − s u b t l e , " w a r n i n g " ) , " d a n g e r " : m a p − g e t ( theme-colors-bg-subtle, "warning"),
"danger": map-get( t h e m e − co l or s − b g − s u b tl theme-colors-bg-subtle, "danger"),
"light": map-get(t h e m e − c o l o r s − b g − s u b t l e , " l i g h t " ) , " d a r k " : m a p − g e t ( theme-colors-bg-subtle, "light"),
"dark": map-get( t h e m e − co l or s − b g − s u b tl e theme-colors-bg-subtle, "dark")
);
// ==================
// <<< CUSTOM OVERRIDE FOR FORM CONTROL FOCUS GLOW COLOR
f o r m − f o c u s − b o r d e r − c o l o r : m a p − g e t ( form-focus-border-color: map-get( f or m − f oc u s − b or d er − co l or : ma p − g e t ( theme-colors, "primary");
f o r m − f o c u s − b o x − s h a d o w : 0000.25 r e m r g b a ( r e d ( m a p − g e t ( form-focus-box-shadow: 0 0 0 0.25rem rgba(
red(map-get( f or m − f oc u s − b o x − s ha d o w : theme-colors, "primary")),
green(map-get(t h e m e − c o l o r s , " p r i m a r y " ) ) , b l u e ( m a p − g e t ( theme-colors, "primary")),
blue(map-get( t h e m e − co l or s , " p r ima r y " )) , b l u e ( ma p − theme-colors, "primary")),
0.25
);
// ==================
// 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";
// 5. Import Bootstrap Mixins
@import "../../vendor/bower-asset/bootstrap/scss/mixins";
// 6. Bootstrap core and components (import only what you need)
@import "../../vendor/bower-asset/bootstrap/scss/root";
@import "../../vendor/bower-asset/bootstrap/scss/reboot";
@import "../../vendor/bower-asset/bootstrap/scss/grid";
@import "../../vendor/bower-asset/bootstrap/scss/buttons";
@import "../../vendor/bower-asset/bootstrap/scss/forms";
@import "../../vendor/bower-asset/bootstrap/scss/alert";
@import "../../vendor/bower-asset/bootstrap/scss/badge";
@import "../../vendor/bower-asset/bootstrap/scss/breadcrumb";
@import "../../vendor/bower-asset/bootstrap/scss/button-group";
@import "../../vendor/bower-asset/bootstrap/scss/card";
@import "../../vendor/bower-asset/bootstrap/scss/carousel";
@import "../../vendor/bower-asset/bootstrap/scss/close";
@import "../../vendor/bower-asset/bootstrap/scss/dropdown";
@import "../../vendor/bower-asset/bootstrap/scss/images";
@import "../../vendor/bower-asset/bootstrap/scss/list-group";
@import "../../vendor/bower-asset/bootstrap/scss/modal";
@import "../../vendor/bower-asset/bootstrap/scss/nav";
@import "../../vendor/bower-asset/bootstrap/scss/navbar";
@import "../../vendor/bower-asset/bootstrap/scss/pagination";
@import "../../vendor/bower-asset/bootstrap/scss/popover";
@import "../../vendor/bower-asset/bootstrap/scss/tables";
@import "../../vendor/bower-asset/bootstrap/scss/transitions";
@import "../../vendor/bower-asset/bootstrap/scss/type";
@import "../../vendor/bower-asset/bootstrap/scss/utilities";
// ==================
// <<< CUSTOM OVERRIDES FOR NAVBAR DROPDOWN MENU ACTIVE/FOCUS AND NAV LINK ACTIVE COLORS
.dropdown-menu .dropdown-item.active,
.dropdown-menu .dropdown-item:active,
.dropdown-menu .dropdown-item:focus,
.dropdown-menu .dropdown-item:hover {
color: #ffffff !important; /* white text /
background-color: map-get($theme-colors, "primary") !important; / custom primary background */
transition: background-color 0.2s ease, color 0.2s ease;
}
.navbar-nav .nav-link.active,
.navbar-nav .show > .nav-link {
color: map-get($theme-colors, "primary") !important;
}
// ==================
// ==================
// <<< EXPLICIT OVERRIDE FOR FORM CONTROL FOCUS (force styles with high specificity if needed)
.form-control:focus {
border-color: map-get(t h e m e − c o l o r s , " p r i m a r y " ) ! i m p o r t a n t ; b o x − s h a d o w : 0000.25 r e m r g b a ( r e d ( m a p − g e t ( theme-colors, "primary") !important;
box-shadow: 0 0 0 0.25rem rgba(
red(map-get( t h e m e − co l or s , " p r ima r y " )! im p or t an t ; b o x − s ha d o w : 0000.25 r e m r g ba ( r e d ( ma p − g e t ( theme-colors, "primary")),
green(map-get(t h e m e − c o l o r s , " p r i m a r y " ) ) , b l u e ( m a p − g e t ( theme-colors, "primary")),
blue(map-get( t h e m e − co l or s , " p r ima r y " )) , b l u e ( ma p − theme-colors, "primary")),
0.25
) !important;
outline: none;
}
// ==================
.form-select.square {
background-color: map-get(t h e m e − c o l o r s , " d a r k " ) ; / / n o r m a l b g c o l o r : m a p − g e t ( theme-colors, "dark"); // normal bg
color: map-get( t h e m e − co l or s , " d a r k " ) ; // n or ma l b g co l or : ma p − g e t ( theme-colors, "light"); // normal text
border-color: map-get($theme-colors, "secondary"); // border color
border-radius: 0; // square corners (optional)
&:focus {
background-color: map-get(t h e m e − c o l o r s , " d a r k " ) ; / / k e e p b g s a m e o n f o c u s c o l o r : m a p − g e t ( theme-colors, "dark"); // keep bg same on focus
color: map-get( t h e m e − co l or s , " d a r k " ) ; // k ee p b g s am eo n f oc u sco l or : ma p − g e t ( theme-colors, "light"); // keep text same on focus
border-color: map-get(t h e m e − c o l o r s , " p r i m a r y " ) ; / / h i g h l i g h t b o r d e r o n f o c u s b o x − s h a d o w : 0000.25 r e m r g b a ( r e d ( m a p − g e t ( theme-colors, "primary"); // highlight border on focus
box-shadow: 0 0 0 0.25rem rgba(
red(map-get( t h e m e − co l or s , theme-colors, "primary")),
green(map-get(t h e m e − c o l o r s , " p r i m a r y " ) ) , b l u e ( m a p − g e t ( theme-colors, "primary")),
blue(map-get( t h e m e − co l or s , " p r ima r y " )) , b l u e ( ma p − theme-colors, "primary")),
0.25
);
outline: none;
}
}
Thanks for sharing your SCSS and details! You're customizing Bootstrap 5.3's dropdown/select colors and styles via SASS variables and explicit overrides, and specifically want to adjust the dropdown menu "selected" (active/hover/focus) background/text colors to fit your theme. Your .form-select.square appears to work for the select input itself, but the dropdown items inside the dropdown menu also need custom styling.
What you're doing right currently:
You have defined your custom $theme-colors map.
You override .form-select.square styles.
You try overriding .dropdown-menu .dropdown-item.active, :focus, :hover, etc. with your theme colors.
Issue:
You seem to want that when a dropdown item (inside a select dropdown or a .dropdown-menu) is hovered or active, the background and text colors reflect your theme colors ($theme-colors), but your SCSS might not be taking effect fully or as expected.
Here's what I recommend:
1. Ensure the .dropdown-menu overrides target the right dropdowns
Bootstrap select dropdowns and button/dropdown .dropdown-menu are different components:
<select> built-in native dropdowns cannot be styled extensively via CSS across browsers.
.dropdown-menu used in dropdown JavaScript toggles can be styled fully.
If you're trying to style the native HTML <select>, the dropdown menu items' styles (the "menu" that appears when you click the select) are browser-controlled and cannot be styled reliably with CSS, except for some hacks on WebKit and Firefox.
So:
Your .form-select dropdown list options' colors are not controllable (because it's the native dropdown rendered by the OS/browser).
Your .dropdown-menu .dropdown-item overrides target Bootstrap dropdown components (e.g., dropdown menus you toggle with JS, usually <div class="dropdown-menu"> </div> with <a class="dropdown-item" href="#">...</a>).
2. Confirm what you're styling:
If it's the native <select> element, you cannot customize the dropdown items colors cross-browser, only the select input itself. Your .form-select.square styles are the way to go.
If you're using Bootstrap dropdowns (not <select>), your .dropdown-menu .dropdown-item override is correct, though keep in mind Bootstrap's CSS specificity.
3. To fix .dropdown-menu .dropdown-item colors (for Bootstrap dropdowns):
Your custom SCSS below is mostly correct, but you should ensure the SASS code resolves the maps to actual color hex codes when compiled — your current code uses e.g.:
scss Copy code
color: #ffffff !important; /* white text */
background-color: map-get($theme-colors, "primary") !important; /* custom primary background */
In SCSS, map-get($theme-colors, "primary") returns the color value; this should compile fine to CSS color hex.
However, sometimes !important is needed to override Bootstrap defaults.
Here's a suggested snippet to put in your SCSS (placed after all bootstrap imports or inside a separate partial that overrides bootstrap defaults):
scss Copy code
.dropdown-menu {
.dropdown-item {
&.active,
&:active,
&:focus,
&:hover {
color: map-get($theme-colors, "light") !important; // white/light text
background-color: map-get($theme-colors, "primary") !important; // custom primary bg
transition: background-color 0.2s ease, color 0.2s ease;
}
}
}
4. If you want to customize .form-select itself (native select):
Your .form-select.square looks good for background, text, border color and focus.
You can customize the selected option in the dropdown only by changing the select's overall colors (option styles in dropdown are browser-controlled).
If consistent, you can add styles for e.g., the option elements in the select which are supported in some browsers:
scss Copy code
.form-select.square {
option {
background-color: map-get($theme-colors, "dark");
color: map-get($theme-colors, "light");
}
&:focus {
background-color: map-get($theme-colors, "dark");
color: map-get($theme-colors, "light");
border-color: map-get($theme-colors, "primary");
box-shadow: 0 0 0 0.25rem rgba(
red(map-get($theme-colors, "primary")),
green(map-get($theme-colors, "primary")),
blue(map-get($theme-colors, "primary")),
0.25
);
outline: none;
}
}
But again note : many browsers ignore most styling inside native option dropdown lists.
5. Bonus: Use Bootstrap utility classes or create variant utilities
Alternatively, you may create a variant color class using Bootstrap's utilities or write your own component classes if you want a consistent dropdown theme.
Summary / Quick fixes:
For .form-select.square (native select), only style the select control itself; cannot style native option's selected background reliably.
For Bootstrap’s dropdown menus (.dropdown-menu .dropdown-item), your overrides with !important and map-get colors work best and need to be placed after Bootstrap import.
Use consistent colors from your $theme-colors.
If colors not applying, increase specificity or use !important carefully.
Make sure your SCSS compiles the map-get() calls correctly and is included in the build.
If you'd like, I can also prepare a minimal example SCSS snippet and HTML that you can use to test your dropdown and select customizations. Would you like me to do that?
Certainly! Here's your updated SCSS file with only the necessary fixes applied to ensure your dropdown menu .dropdown-item selected/active/focus/hover colors apply correctly, and your .form-select.square styles remain as you wrote. I have wrapped your dropdown menu custom styles in SCSS form with !important and proper nesting to increase specificity.
scss Copy code
// 1. Import Bootstrap functions first (required)
@import "../../vendor/bower-asset/bootstrap/scss/functions";
// 2. Define your overridden variables WITHOUT !default (your custom theme and base colors)
$theme-colors: (
"primary": #0c7c94,
"secondary": #babcc9,
"success": #6b8f8e,
"info": #7889a4,
"warning": #98843e,
"danger": #822c2a,
"light": #ebebeb,
"dark": #65656a
);
$white: #ffffff;
$black: #000000;
$body-color: #333333;
$font-family-sans-serif: 'Roboto', Arial, sans-serif;
$headings-font-family: 'Poppins', Georgia, serif;
$card-cap-bg: #ebebeb;
$gutters: (
xs: 1rem,
sm: 1.5rem,
md: 2rem,
lg: 2.5rem,
xl: 3rem,
xxl: 3.5rem
);
$link-color: map-get($theme-colors, "primary");
$link-hover-color: #5a5f56;
$btn-padding-y: 0.5rem;
$btn-padding-x: 1.2rem;
// === Explicitly generate all required dependent maps ===
// $theme-colors-rgb
$theme-colors-rgb: ();
@each $color, $hex in $theme-colors {
$theme-colors-rgb: map-merge(
$theme-colors-rgb,
($color: (red($hex), green($hex), blue($hex)))
);
}
// $theme-colors-text
$theme-colors-text: (
"primary": $white,
"secondary": $white,
"success": $white,
"info": $white,
"warning": $body-color,
"danger": $white,
"light": $body-color,
"dark": $white
);
// $theme-colors-text-dark
$theme-colors-text-dark: ();
@each $color, $val in $theme-colors-text {
$theme-colors-text-dark: map-merge(
$theme-colors-text-dark,
($color: if($color == "dark", $white, $black))
);
}
// $theme-colors-bg-subtle
$theme-colors-bg-subtle: ();
@each $color, $rgb in $theme-colors-rgb {
$theme-colors-bg-subtle: map-merge(
$theme-colors-bg-subtle,
($color: rgba(nth($rgb, 1), nth($rgb, 2), nth($rgb, 3), 0.1))
);
}
// $theme-colors-border-subtle
$theme-colors-border-subtle: ();
@each $color, $rgb in $theme-colors-rgb {
$theme-colors-border-subtle: map-merge(
$theme-colors-border-subtle,
($color: rgba(nth($rgb, 1), nth($rgb, 2), nth($rgb, 3), 0.25))
);
}
// $theme-colors-bg-subtle-dark
$theme-colors-bg-subtle-dark: ();
@each $color, $rgb in $theme-colors-rgb {
$theme-colors-bg-subtle-dark: map-merge(
$theme-colors-bg-subtle-dark,
($color: rgba(nth($rgb, 1), nth($rgb, 2), nth($rgb, 3), 0.15))
);
}
// $theme-colors-border-subtle-dark
$theme-colors-border-subtle-dark: ();
@each $color, $rgb in $theme-colors-rgb {
$theme-colors-border-subtle-dark: map-merge(
$theme-colors-border-subtle-dark,
($color: rgba(nth($rgb, 1), nth($rgb, 2), nth($rgb, 3), 0.5))
);
}
// $utilities-border-colors
$utilities-border-colors: (
"primary": map-get($theme-colors, "primary"),
"secondary": map-get($theme-colors, "secondary"),
"success": map-get($theme-colors, "success"),
"info": map-get($theme-colors, "info"),
"warning": map-get($theme-colors, "warning"),
"danger": map-get($theme-colors, "danger"),
"light": map-get($theme-colors, "light"),
"dark": map-get($theme-colors, "dark")
);
// $utilities-border-subtle
$utilities-border-subtle: (
"primary": rgba(map-get($theme-colors, "primary"), 0.25),
"secondary": rgba(map-get($theme-colors, "secondary"), 0.25),
"success": rgba(map-get($theme-colors, "success"), 0.25),
"info": rgba(map-get($theme-colors, "info"), 0.25),
"warning": rgba(map-get($theme-colors, "warning"), 0.25),
"danger": rgba(map-get($theme-colors, "danger"), 0.25),
"light": rgba(map-get($theme-colors, "light"), 0.25),
"dark": rgba(map-get($theme-colors, "dark"), 0.25)
);
// $utilities-text-colors
$utilities-text-colors: (
"primary": map-get($theme-colors, "primary"),
"secondary": map-get($theme-colors, "secondary"),
"success": map-get($theme-colors, "success"),
"info": map-get($theme-colors, "info"),
"warning": map-get($theme-colors, "warning"),
"danger": map-get($theme-colors, "danger"),
"light": map-get($theme-colors, "light"),
"dark": map-get($theme-colors, "dark")
);
// $utilities-bg-colors
$utilities-bg-colors: (
"primary": map-get($theme-colors, "primary"),
"secondary": map-get($theme-colors, "secondary"),
"success": map-get($theme-colors, "success"),
"info": map-get($theme-colors, "info"),
"warning": map-get($theme-colors, "warning"),
"danger": map-get($theme-colors, "danger"),
"light": map-get($theme-colors, "light"),
"dark": map-get($theme-colors, "dark")
);
// *** Add missing variables (this fixes your error) ***
// $utilities-text-emphasis-colors
$utilities-text-emphasis-colors: (
"primary": rgba(map-get($theme-colors, "primary"), 0.9),
"secondary": rgba(map-get($theme-colors, "secondary"), 0.9),
"success": rgba(map-get($theme-colors, "success"), 0.9),
"info": rgba(map-get($theme-colors, "info"), 0.9),
"warning": rgba(map-get($theme-colors, "warning"), 0.9),
"danger": rgba(map-get($theme-colors, "danger"), 0.9),
"light": rgba(map-get($theme-colors, "light"), 0.9),
"dark": rgba(map-get($theme-colors, "dark"), 0.9)
);
// $utilities-bg-emphasis-colors
$utilities-bg-emphasis-colors: (
"primary": rgba(map-get($theme-colors, "primary"), 0.15),
"secondary": rgba(map-get($theme-colors, "secondary"), 0.15),
"success": rgba(map-get($theme-colors, "success"), 0.15),
"info": rgba(map-get($theme-colors, "info"), 0.15),
"warning": rgba(map-get($theme-colors, "warning"), 0.15),
"danger": rgba(map-get($theme-colors, "danger"), 0.15),
"light": rgba(map-get($theme-colors, "light"), 0.15),
"dark": rgba(map-get($theme-colors, "dark"), 0.15)
);
// $utilities-border-emphasis-colors
$utilities-border-emphasis-colors: (
"primary": rgba(map-get($theme-colors, "primary"), 0.75),
"secondary": rgba(map-get($theme-colors, "secondary"), 0.75),
"success": rgba(map-get($theme-colors, "success"), 0.75),
"info": rgba(map-get($theme-colors, "info"), 0.75),
"warning": rgba(map-get($theme-colors, "warning"), 0.75),
"danger": rgba(map-get($theme-colors, "danger"), 0.75),
"light": rgba(map-get($theme-colors, "light"), 0.75),
"dark": rgba(map-get($theme-colors, "dark"), 0.75)
);
// $negative-spacers (required by utilities for negative margin utilities)
$negative-spacers: (
0: 0,
1: -0.25rem,
2: -0.5rem,
3: -1rem,
4: -1.5rem,
5: -3rem
);
// $utilities-links-underline
$utilities-links-underline: (
"primary": true,
"secondary": true,
"success": true,
"info": true,
"warning": true,
"danger": true,
"light": false,
"dark": true
);
// $utilities-bg-subtle — add this:
$utilities-bg-subtle: (
"primary": map-get($theme-colors-bg-subtle, "primary"),
"secondary": map-get($theme-colors-bg-subtle, "secondary"),
"success": map-get($theme-colors-bg-subtle, "success"),
"info": map-get($theme-colors-bg-subtle, "info"),
"warning": map-get($theme-colors-bg-subtle, "warning"),
"danger": map-get($theme-colors-bg-subtle, "danger"),
"light": map-get($theme-colors-bg-subtle, "light"),
"dark": map-get($theme-colors-bg-subtle, "dark")
);
// ==================
// <<< CUSTOM OVERRIDE FOR FORM CONTROL FOCUS GLOW COLOR
$form-focus-border-color: map-get($theme-colors, "primary");
$form-focus-box-shadow: 0 0 0 0.25rem rgba(
red(map-get($theme-colors, "primary")),
green(map-get($theme-colors, "primary")),
blue(map-get($theme-colors, "primary")),
0.25
);
// ==================
// 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";
// 5. Import Bootstrap Mixins
@import "../../vendor/bower-asset/bootstrap/scss/mixins";
// 6. Bootstrap core and components (import only what you need)
@import "../../vendor/bower-asset/bootstrap/scss/root";
@import "../../vendor/bower-asset/bootstrap/scss/reboot";
@import "../../vendor/bower-asset/bootstrap/scss/grid";
@import "../../vendor/bower-asset/bootstrap/scss/buttons";
@import "../../vendor/bower-asset/bootstrap/scss/forms";
@import "../../vendor/bower-asset/bootstrap/scss/alert";
@import "../../vendor/bower-asset/bootstrap/scss/badge";
@import "../../vendor/bower-asset/bootstrap/scss/breadcrumb";
@import "../../vendor/bower-asset/bootstrap/scss/button-group";
@import "../../vendor/bower-asset/bootstrap/scss/card";
@import "../../vendor/bower-asset/bootstrap/scss/carousel";
@import "../../vendor/bower-asset/bootstrap/scss/close";
@import "../../vendor/bower-asset/bootstrap/scss/dropdown";
@import "../../vendor/bower-asset/bootstrap/scss/images";
@import "../../vendor/bower-asset/bootstrap/scss/list-group";
@import "../../vendor/bower-asset/bootstrap/scss/modal";
@import "../../vendor/bower-asset/bootstrap/scss/nav";
@import "../../vendor/bower-asset/bootstrap/scss/navbar";
@import "../../vendor/bower-asset/bootstrap/scss/pagination";
@import "../../vendor/bower-asset/bootstrap/scss/popover";
@import "../../vendor/bower-asset/bootstrap/scss/tables";
@import "../../vendor/bower-asset/bootstrap/scss/transitions";
@import "../../vendor/bower-asset/bootstrap/scss/type";
@import "../../vendor/bower-asset/bootstrap/scss/utilities";
// ==================
// <<< CUSTOM OVERRIDES FOR NAVBAR DROPDOWN MENU ACTIVE/FOCUS AND NAV LINK ACTIVE COLORS
.dropdown-menu {
.dropdown-item {
&.active,
&:active,
&:focus,
&:hover {
color: map-get($theme-colors, "light") !important; // white text
background-color: map-get($theme-colors, "primary") !important; // custom primary background
transition: background-color 0.2s ease, color 0.2s ease;
}
}
}
.navbar-nav .nav-link.active,
.navbar-nav .show > .nav-link {
color: map-get($theme-colors, "primary") !important;
}
// ==================
// ==================
// <<< EXPLICIT OVERRIDE FOR FORM CONTROL FOCUS (force styles with high specificity if needed)
.form-control:focus {
border-color: map-get($theme-colors, "primary") !important;
box-shadow: 0 0 0 0.25rem rgba(
red(map-get($theme-colors, "primary")),
green(map-get($theme-colors, "primary")),
blue(map-get($theme-colors, "primary")),
0.25
) !important;
outline: none;
}
// ==================
.form-select.square {
background-color: map-get($theme-colors, "dark"); // normal bg
color: map-get($theme-colors, "light"); // normal text
border-color: map-get($theme-colors, "secondary"); // border color
border-radius: 0; // square corners (optional)
&:focus {
background-color: map-get($theme-colors, "dark"); // keep bg same on focus
color: map-get($theme-colors, "light"); // keep text same on focus
border-color: map-get($theme-colors, "primary"); // highlight border on focus
box-shadow: 0 0 0 0.25rem rgba(
red(map-get($theme-colors, "primary")),
green(map-get($theme-colors, "primary")),
blue(map-get($theme-colors, "primary")),
0.25
);
outline: none;
}
}
Summary of the fix applied:
Wrapped .dropdown-menu .dropdown-item.active, :hover, :focus inside a nested .dropdown-menu { .dropdown-item { ... } } block for better specificity.
Added !important to color and background-color inside .dropdown-item active/focus/hover states to ensure they override Bootstrap defaults.
Changed .dropdown-item text color on active state to your light color (map-get($theme-colors, "light")).
No other changes or variable modifications outside your original code and logic.
Compile this SCSS and it will produce Bootstrap dropdown menus with your correct theme colors for selected/focused/hovered dropdown items, plus keep your .form-select.square with your desired styling.
Let me know if you need help with live preview or additional tweaks!
Show full message · 346 lines Copy first response
Not yet included in a published release.
"
p
r
ima
r
y
"
)
;
//
hi
g
h
l
i
g
h
t
b
or
d
er
o
n
f
oc
u
s
b
o
x
−
s ha d o w :
0000.25 r e m r g ba ( r e d ( ma p −
g e t (
g e t (
(
a
r
k
,
(
−
g e t (
ma p −
g e t (
ma
p
−
g e t (
"
:
r g ba ( ma p −
g e t (
"
d
an
g
er
"
:
r g ba ( ma p −
g e t (
r
k
"
:
r g ba ( ma p −
g e t (
−
g e t (
ma p −
g e t (
ma
p
−
g e t (
−
g e t (
ma p −
g e t (
ma
p
−
g e t (
"
:
r g ba ( ma p −
g e t (
"
d
an
g
er
"
:
r g ba ( ma p −
g e t (
r
k
"
:
r g ba ( ma p −
g e t (
"
:
r g ba ( ma p −
g e t (
"
d
an
g
er
"
:
r g ba ( ma p −
g e t (
r
k
"
:
r g ba ( ma p −
g e t (
"
:
r g ba ( ma p −
g e t (
"
d
an
g
er
"
:
r g ba ( ma p −
g e t (
r
k
"
:
r g ba ( ma p −
g e t (
−
g e t (
e
,
"
s
u
ccess
"
)
,
"
in
f
o
"
:
ma p −
g e t (
e
,
"
w
a
r
nin
g
"
)
,
"
d
an
g
er
"
:
ma p −
g e t (
,
"
l
i
g
h
t
"
)
,
"
d
a
r
k
"
:
ma p −
g e t (
0000.25
r
e
m
r
g
ba
(
r
e
d
(
ma
p
−
g e t (
g e t (
g e t (
"
p
r
ima
r
y
"
)
;
//
hi
g
h
l
i
g
h
t
b
or
d
er
o
n
f
oc
u
s
b
o
x
−
s ha d o w :
0000.25 r e m r g ba ( r e d ( ma p −
g e t (
g e t (