I would like to add a darkened background color to my buttons when someone hovers over them. My problem is that the buttons have a background-color: transparent
by default (when not being hovered over).
So that means the buttons have different background colors (depending on the background div's color). Therefore I cannot make 20+ css classes for every darkened color. I would like a solution that I can just add to my single icon-button class. See my examples for a better explanation.
I would like something like this:
.icon-button:hover {
background-color: black;
background-color-opacity: 25%;
}
Instead of doing this:
.icon-button.white:hover {
background-color: #xxxxxx; (darkened white)
}
.icon-button.red:hover {
background-color: #xxxxxx; (darkened red)
}
.icon-button.purple:hover {
background-color: #xxxxxx; (darkened purple)
}
.icon-button.green:hover {
background-color: #xxxxxx; (darkened green)
}
.....
(For some reason my image upload is failing, check it here) https://i.stack.imgur.com/jn9MR.jpg