Skip to content

Commit 0bcbd86

Browse files
author
Jani Giannoudis
committed
docfx: fix navbar
1 parent c4b9dc9 commit 0bcbd86

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

.github/workflows/pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ jobs:
4848
run: cd docfx && docfx docfx.json
4949

5050
- name: Upload Pages artifact
51-
uses: actions/upload-pages-artifact@v4
51+
uses: actions/upload-pages-artifact@v5
5252
with:
5353
path: docfx/_site
5454

5555
- name: Deploy to GitHub Pages
5656
id: deployment
57-
uses: actions/deploy-pages@v4
57+
uses: actions/deploy-pages@v5

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ document.addEventListener("DOMContentLoaded", function () {
44
var brand = document.querySelector(".navbar-brand");
55
if (brand) {
66
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);
7+
// Remove only text nodes and injected spans, keep img and svg
8+
Array.from(brand.childNodes).forEach(function(n) {
9+
var keep = n.nodeType === 1 && (n.tagName === "IMG" || n.tagName === "svg" || n.tagName === "SVG");
10+
if (!keep) { n.parentNode && n.parentNode.removeChild(n); }
1011
});
11-
// Ensure icon is visible
12-
var img = brand.querySelector("img");
13-
if (img) { img.style.cssText = "height:28px;width:28px;flex-shrink:0;"; }
12+
// Size the icon (img or svg)
13+
var icon = brand.querySelector("img, svg");
14+
if (icon) { icon.style.cssText = "height:28px;width:28px;flex-shrink:0;"; }
1415
var title = document.createElement("span");
1516
title.textContent = "Client Scripting";
1617
title.style.cssText = "font-size:1.05rem;font-weight:700;color:#fff;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;";

0 commit comments

Comments
 (0)