Skip to content

Commit 3bf36b5

Browse files
committed
fix(docs): place theme toggle in top-right navbar
1 parent 12936e9 commit 3bf36b5

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

docs/_includes/head_custom.html

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,13 @@
5454
btn.textContent = icons[currentMode];
5555
btn.title = titles[currentMode];
5656

57-
// Insert into aux nav
58-
var auxNav = document.querySelector('.site-nav, .aux-nav');
57+
// Insert into aux nav (top-right header area with GitHub link)
58+
var auxNav = document.querySelector('nav.aux-nav ul');
5959
if (auxNav) {
60-
var auxList = auxNav.querySelector('ul');
61-
if (auxList) {
62-
var li = document.createElement('li');
63-
li.className = 'aux-nav-item';
64-
li.appendChild(btn);
65-
auxList.appendChild(li);
66-
}
60+
var li = document.createElement('li');
61+
li.className = 'aux-nav-item';
62+
li.appendChild(btn);
63+
auxNav.appendChild(li);
6764
}
6865

6966
// Listen for system preference changes

0 commit comments

Comments
 (0)