0

Description

Problem

See bug report here: Duplicate modal - row hover state not cleared

The background is "sticky" added on hover then removed on a second hover.

Fix

This userstyle removes the sticky behaviour and only adds the style while hovering.

Showcase of background changing on hover and reverting after the mouse is moved away.

Installation

Prerequisites to install a userstyle

You need a userstyle manager like Stylus:

Installing the userstyle

Direct install (GitHub)

See the code on GitHub

Code


/* ==UserStyle==
@name         Stack Exchange - fix annoying sticky duplicate window hover
@description  Fix for https://meta.stackexchange.com/questions/400179/duplicate-modal-row-hover-state-not-cleared - hovering adds a sticky background remvoed on a second hover
@namespace    https://github.com/PurpleMagick/
@version      1
@author       VLAZ
@license      MIT
==/UserStyle== */

@-moz-document domain("stackoverflow.com"), domain("superuser.com"), domain("serverfault.com"), domain("askubuntu.com"), domain("stackapps.com"), domain("mathoverflow.net"), domain("stackexchange.com") {

/* remove the background-color alteration for the class */
.close-as-duplicate-pane .original-display .list-originals .list .item.hover {
    background-color: unset;
}

/* attach the background-color to the :hover pseudo-class and let the browser handle it */
.close-as-duplicate-pane .original-display .list-originals .list .item:hover,
.close-as-duplicate-pane .original-display .list-originals .list .item.hover:hover {
    background-color: var(--black-200);
}

}

0

You must log in to answer this question.

Browse other questions tagged .