From 80ba70f4b9a5204c6b479ad0aa176cc128c9d65f Mon Sep 17 00:00:00 2001 From: Jess Fairbairn Date: Sun, 16 Feb 2025 23:15:51 +0000 Subject: [PATCH] Display context menu nicely + little bit of accessibility --- page/TabItems.js | 5 +++-- page/style.css | 13 ++++++------- page/templates.html | 23 ++++++++++++----------- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/page/TabItems.js b/page/TabItems.js index 05e258e..7b49126 100644 --- a/page/TabItems.js +++ b/page/TabItems.js @@ -37,10 +37,11 @@ export class TabItemList extends HTMLElement { } this.shadowRoot.querySelector("#closeAllButton").onclick = _event => { - closeFunction(false) + closeFunction(false); }; this.shadowRoot.querySelector("#close-all-including-hidden-button").onclick = _event => { - closeFunction(true) + shadowRoot.getElementById("context-button").focus(); + closeFunction(true); }; this.shadowRoot.querySelector("#collapseButton").onclick = this.toggleCollapse; diff --git a/page/style.css b/page/style.css index 411232e..a0baf8d 100644 --- a/page/style.css +++ b/page/style.css @@ -2,12 +2,11 @@ @import url('light-colours.css') (prefers-color-scheme: light); *, button { - font-family: "Fira Sans", Helvetica, sans-serif; + font-family: "Fira Sans", Helvetica, sans-serif!important; } - + .cool-list { - padding: 0.5em; } @@ -18,18 +17,18 @@ } -/* .cool-list li:nth-child(odd) { +.cool-list li:nth-child(odd) { background-color: var(--group-background-colour); -} */ +} .cool-list > li, .cool-list > .tab-item { - /* background-color: var(--alternate-row-colour); */ + background-color: var(--alternate-row-colour); background-color: var(--group-background-colour); } .cool-list ul > li { background-color: var(--alternate-row-colour); -} +} */ .cool-list, ul.cool-list{ diff --git a/page/templates.html b/page/templates.html index f51a6a0..8ecead6 100644 --- a/page/templates.html +++ b/page/templates.html @@ -97,6 +97,10 @@ padding-top: 2px; /*not super important but makes the chevron not too high*/ } + #menuWrapper { + position: relative; + } + menu { display: none; background-color: grey; @@ -117,9 +121,10 @@ menu button { border: 0; padding: 0.5em; + min-width: 10em; } - a#context-button:active menu, menu:focus-within, menu.visible { + #context-button:active~menu, menu:focus-within, menu.visible { display: block; position: absolute; } @@ -138,20 +143,16 @@ }
: - + +