mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 15:41:30 -07:00
js: Replace :focus-within with JS-maintained .focus-within
Old browsers (like KaiOS 2.5) don't have :focus-within, but it's pretty easy to replace the pseudo-class with a real .focus-within class maintained by JavaScript event handlers. This is made only marginally fiddlier by the odd fact that "focus" and "blur" events don't bubble.
This commit is contained in:
@ -128,7 +128,7 @@ EOF
|
||||
}
|
||||
|
||||
#gamemenu li > :hover:not(:disabled),
|
||||
#gamemenu li > :focus-within {
|
||||
#gamemenu li > .focus-within {
|
||||
/* When the mouse is over a menu item, highlight it */
|
||||
background: rgba(0,0,0,0.3);
|
||||
}
|
||||
@ -186,7 +186,7 @@ EOF
|
||||
}
|
||||
|
||||
#gamemenu :hover > ul,
|
||||
#gamemenu :focus-within > ul {
|
||||
#gamemenu .focus-within > ul {
|
||||
/* Last but by no means least, the all-important line that makes
|
||||
* submenus be displayed! Any <ul> whose parent <li> is being
|
||||
* hovered over gets display:flex overriding the display:none
|
||||
|
Reference in New Issue
Block a user