Posted in bootstrap
9153
12:31 am, November 23, 2020
 

Fix Hover Over color on list group dark mode in bootstrap

How to fix the problem when switching to dark mode, the list group item text disappears when active.

Here is what it currently looks like.

To fix this we need to target the element and force the state to active or hover, in chrome press f12 and then use the selector to target the element.

to force a state on an element so we can change it, right click it in the console., and then go to force state, and select hover over. this will stick the element in hover over mode, like the mouse is over it or it being clicked.

now if you look at it it will be all white, which is what we need to fix.

this is the css culprit that is causing the text to be white.

so to fix we can either change the text to black or the hover over to a light gray rather than the white. the normal button hover over looks nice so ill use that.

copy these styles to our list element

so we end up with this

Now save the styles to your main css file, I usually add a theme.css file that loads the changes under the bootstrap.css so you can easily override existing styles, so just add all changes to this.

Reload and test and you should have something like this in your list group hover over.

All fixed, however. this also applies to the white or light version which is annoying, so may need to modify the darkmode switch to also add a tag to the body so that we can target if the site it in dark or light mode, as currently we cant target light or dark mode without changing the light or dark css.

View Statistics
This Week
229
This Month
1193
This Year
2883

No Items Found.

Add Comment
Type in a Nick Name here
 
Related Search Terms
Search Code
Search Code by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

Subscribe to weekly updates about things i have added to the site or thought interesting during the last week.

You could also follow me on twitter or not... does anyone even use twitter anymore?

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote
The mind must be given relaxation; it will arise better and keener after resting. As rich fields must not be forced-for their productiveness, the have no rest, will quickly exhaust them constantlabor will break the vigor of the mind, but if it is released and relaxed a little while, it will recover its powers
Seneca
Random CSS Property

ruby-align

The ruby-align CSS property defines the distribution of the different ruby elements over the base.
ruby-align css reference