I have a sidebar, and when scrolling on the sidebar using mobile, I would like only scrolling to be possible, and not hovering. I've taken this approach (a CSS-only solution!), based on answers I've seen previously:
/* default hover class on list items*/
ul li:hover .check {
border: 4px solid #FFFFFF;
}
/* default hover class on list items when checked*/
ul li:hover .check {
border: 4px solid #FFFFFF;
}
/* for mobile, set hover-color on list items to be same as un-hovered list items --THIS IS WORKING*/
@media all and (min-width:320px) and (max-width: 960px) {
ul li:hover label {
color: #AAAAAA;
background: transparent;
}
}
/* for mobile, set hover-color on checkmark items to be same as un-hovered checkmark items -- THIS IS NOT WORKING, this color is not applied to the checkbox*/
@media all and (min-width:320px) and (max-width: 960px) {
ul li:hover .check{
color: #AAAAAA;
background: transparent;
}
}
/* catch-all - set hover color on all list items to be same as un-hovered*/
@media all and (min-width:320px) and (max-width: 960px) {
ul li:hover {
color: #AAAAAA;
background: transparent;
}
}
The issue is that the @media query doesn't recognize the ul li:hover .check. The @media query for ul li:hover label works perfectly. I'm not sure why this is. How can I make this work?