css: prevent acidentally opening spoilered links

A small delay on the pointer-events property prevents accidentally
opening a link inside a spoiler when tapping to reveal the spoiler on
mobile.
This commit is contained in:
NamelessContributor
2022-04-07 11:43:17 +02:00
parent 98a9b2484b
commit 91a9153764

View File

@@ -123,6 +123,17 @@ div.prose {
color: var(--dtext-spoiler-hover-color);
}
// Prevent accidentally opening a link when tapping a spoiler to reveal it
.spoiler:hover a {
animation: delay-pointer-events 50ms;
}
@keyframes delay-pointer-events {
0%, 99% {
pointer-events: none;
}
}
.spoiler {
background: var(--dtext-spoiler-background-color);
}