chiark / gitweb /
webstead: style for #pixels input:focus-visible
authorBen Harris <bjh21@bjh21.me.uk>
Sun, 12 Oct 2025 15:27:13 +0000 (16:27 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Tue, 13 Jan 2026 21:42:18 +0000 (21:42 +0000)
The usual focus ring in Firefox and Chromium appears at the same
stacking level as the element it's attached to.  This means that it's
hidden by elements after it in the document, including pixels below it
and to its right.  Fiddling with the z-index of the focussed pixel
helps with this.

webstead.xhtml

index a6ab612ddc696f59dbeb89aa495f085a658781a4..7452ecdba31351920454a806a8e82c40dbc83810 100644 (file)
           width: calc(var(--pix) - 6px);
           height: calc(var(--pix) - 6px);
       }
+      #pixels input:focus-visible {
+          position: relative;
+          z-index: 1;
+      }
     </style>
     <!-- Script is async rather than deferred because Chromium can't
          handle deferred scripts in XHTML.