Skip to content

Add support for color modes #867

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sevdog opened this issue Dec 17, 2024 · 3 comments
Open

Add support for color modes #867

sevdog opened this issue Dec 17, 2024 · 3 comments

Comments

@sevdog
Copy link

sevdog commented Dec 17, 2024

Describe the solution you'd like
Bootstrap 5.3 added support for dark-mode and color-modes:

https://getbootstrap.com/docs/5.3/customize/color-modes/

It would be nice to have this also in this component.

How is this solution useful to others?
Every user which allows color-modes in their app will benefit from this.

PS: it would also be very useful if the styles in RBT could use bootstrap sass color variables, which will also simplify theming and customization.

@ericgio
Copy link
Owner

ericgio commented Feb 22, 2025

I'm pretty sure color modes should already mostly work with this component out of the box, right? you can simply add data-bs-theme="dark" to any parent element of the typeahead, or to individual typeahead elements like the menu or input. Where this might break down a little is the color of the hint and tokens, since those aren't standard Bootstrap components, but it shouldn't be too hard to customize those as needed. Is there some other behavior you're looking for?

@sevdog
Copy link
Author

sevdog commented Feb 22, 2025

Currently there are no references to color-mode in Typeahead.scss).

Also by default colors are RGB values and not css variables and thus it would not take any change which is performed on those by BS.

Since this plugin is intended to work with BS, colors should be taken from BS theme. This way any user should have to worry only to choose the right color scheme in BS without having to change also the colors for typeahead.

@ericgio
Copy link
Owner

ericgio commented Feb 22, 2025

The component relies almost entirely on default BS colors/themes, so using dark mode should mostly work. As mentioned, the tokens used in the multi-select version have no BS analog, so those do require some custom colors and styles. If there are specific cases where you're finding the dark theme isn't working, can you please itemize them, ideally with screenshots, so I have a better idea of the problem? Thanks!

Here's the component using dark mode:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants