Hi!
For a long time, hovering the icons on my website made them grey despite I overrode it with a custom color (a light blue):
Because of this Discourse CSS:
.discourse-no-touch .d-header-icons .icon:hover .d-icon, .discourse-no-touch .d-header-icons .icon:focus .d-icon {
color: #919191;
}
The light blue worked at the very beginning, and I think it stopped working after a Discourse upgrade, and I didn’t take a look at this for maybe a year.
Then, I upgraded to 2.9.0 very recently (I upgrade each time the interface tells me to do so, and sometimes a bit more often), and the custom color that I previously set came back by itself, like magic
However, I notice now that the grey color came back again
It is possible that I upgraded Discourse again in the meantime.
Anyway, I don’t know why the right color came back and went away again since I didn’t edit my forum CSS.
So, here’s the current CSS rules order:
I want my light blue back.
My current custom CSS:
.d-header-icons .d-icon {
color: white;
}
.d-header-icons .icon:hover, .d-header-icons .icon:focus {
background: white;
}
.d-header-icons .icon:hover .d-icon, .d-header-icons .icon:focus .d-icon {
color: var(--tertiary-medium);
}
.drop-down-mode .d-header-icons .active .icon .d-icon {
color: var(--tertiary);
}
I prefer not to use !important
when I can do otherwise, and I have often trouble overriding Discourse’s CSS in a simple way because of the parent .discourse-no-touch
class that requires me to create a real train of selectors to achieve my goal.
-
Any idea why my color override worked again for a few days, and then not anymore?
-
How to override properly Discourse’s classes with this annoying great grandparent
.discourse-no-touch
?
Note: The blue color works on smartphones though. Is there a simple target rule to make CSS changes affect both touch and no-touch devices?