Skip to content

Commit c4b9dc9

Browse files
author
Jani Giannoudis
committed
docfx: navbar fixing
1 parent bc9dc8c commit c4b9dc9

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

docfx/templates/darkerfx/styles/toggle-theme.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,29 @@ document.addEventListener("DOMContentLoaded", function () {
33
// Brand: icon + title text
44
var brand = document.querySelector(".navbar-brand");
55
if (brand) {
6-
brand.style.cssText = "display:inline-flex;align-items:center;gap:10px;";
7-
// Remove any appName span injected by template
8-
brand.querySelectorAll("span").forEach(function(s) { s.remove(); });
6+
brand.style.cssText = "display:inline-flex;align-items:center;gap:10px;padding:4px 0;";
7+
// Remove only text nodes / empty spans injected by template, keep img
8+
brand.childNodes.forEach(function(n) {
9+
if (n.nodeType === 3 || (n.nodeType === 1 && n.tagName !== "IMG")) n.remove ? n.remove() : n.parentNode.removeChild(n);
10+
});
11+
// Ensure icon is visible
12+
var img = brand.querySelector("img");
13+
if (img) { img.style.cssText = "height:28px;width:28px;flex-shrink:0;"; }
914
var title = document.createElement("span");
1015
title.textContent = "Client Scripting";
11-
title.style.cssText = "font-size:1rem;font-weight:700;color:#fff;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;";
16+
title.style.cssText = "font-size:1.05rem;font-weight:700;color:#fff;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;";
1217
brand.appendChild(title);
1318
}
14-
// Badge: absolutely positioned top-right in navbar
15-
var navbar = document.querySelector(".navbar");
16-
if (navbar) {
17-
navbar.style.position = "relative";
19+
// Badge: absolutely positioned top-right within content container
20+
var navContainer = document.querySelector(".navbar .container");
21+
if (navContainer) {
22+
navContainer.style.position = "relative";
1823
var badge = document.createElement("span");
1924
badge.textContent = "Regulator";
2025
badge.style.cssText = [
2126
"position:absolute",
2227
"top:50%",
23-
"right:1rem",
28+
"right:0",
2429
"transform:translateY(-50%)",
2530
"font-size:.7rem",
2631
"font-weight:700",

0 commit comments

Comments
 (0)