From 69f113891fee10bf3d491331dc2545fe914ed908 Mon Sep 17 00:00:00 2001 From: Kevin D Date: Wed, 23 Sep 2026 12:49:32 -0700 Subject: [PATCH] logo fix 2 --- banner.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/banner.js b/banner.js index 325939d..fa09c10 100644 --- a/banner.js +++ b/banner.js @@ -116,14 +116,24 @@ // filename inject-banner.sh replaces for the top-bar logo; keep these two // in sync if that ever changes again. const LOGO_IMG_MATCH = 'icon-transparent'; + const LOGO_MAX_SIZE = '2em'; // grow the icon now that the text next to it is gone function hideLogoText() { const logoImg = document.querySelector('img[src*="' + LOGO_IMG_MATCH + '"]'); if (!logoImg) return; - const container = logoImg.parentElement; + + logoImg.style.setProperty('max-height', LOGO_MAX_SIZE, 'important'); + logoImg.style.setProperty('max-width', LOGO_MAX_SIZE, 'important'); + + // The image is usually wrapped in its own icon span, so the text label + // is a sibling of that wrapper, not of the itself. Walk up to the + // whole clickable logo button/link and hide every child that isn't part + // of the branch containing the image. + const container = logoImg.closest('button, a, [role="button"]') || logoImg.parentElement; if (!container) return; Array.prototype.forEach.call(container.childNodes, function (node) { if (node === logoImg) return; + if (node.nodeType === Node.ELEMENT_NODE && node.contains(logoImg)) return; if (node.nodeType === Node.TEXT_NODE) { if (node.textContent.trim()) node.textContent = ''; } else if (node.nodeType === Node.ELEMENT_NODE && node.style.display !== 'none') {