twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
170.35k stars 78.8k forks source link

Color theme setting ignored by the menu of a <select> element in mobile browsers #40795

Open andreimilto opened 1 month ago

andreimilto commented 1 month ago

Prerequisites

Describe the issue

I have a <select> element. And I've set the color theme on the <html> element using data-bs-theme attribute.

In desktop browsers (Chrome, Edge, Safari, Firefox) the <select> is displayed correctly: ✅dark theme - dark <select>'s menu ✅light theme - light <select>'s menu

DesktopDarkDesktopLight

In mobile browsers (Chrome, Safari, Firefox) the menu of the <select> element seems to always be drawn according to the system's color theme, completely ignoring the data-bs-theme setting: ✅dark theme - dark <select>'s menu ❌light theme - dark <select>'s menu

MobileDarkMobileLight
I'm wondering if it can be fixed, or if it's the limitation of the browsers that cannot be overcome. If latter, then it would be useful to have the [documentation on color modes](https://getbootstrap.com/docs/5.3/customize/color-modes/) stating this limitation - save developers the trouble of figuring this out and preventing situations similar to the described one from happening in the first place🙌 ### Reduced test cases 1. Add ` ``` 2. Set the color theme to `dark` and check how ``'s menu is displayed in desktop and mobile browsers: ```html ``` ### What operating system(s) are you seeing the problem on? Android, iOS ### What browser(s) are you seeing the problem on? Chrome, Safari, Firefox ### What version of Bootstrap are you using? v5.3.3
MohamadSalman11 commented 7 hours ago

Hi @andreimilto , changing the color of a