Skip to content

Commit 8ea2de5

Browse files
committed
fix(docs): opaque sticky top bar; unify header icon button styles
- .ftn-site-navbar: sticky, z-index 8, solid --ftn-header-bar-bg, bottom border - .header: transparent shell; mast keeps own fill/border - .ftn-header-icon-btn: shared hit box, transparent idle, --ftn-header-bar-hover focus/hover (overrides site-extra theme-toggle hardcoded hover) - Git link + theme toggle use ftn-header-icon-btn; pre-existing toggle gets class in JS - Copy theme icon SVG rules under header for consistent styling Made-with: Cursor
1 parent 4da6ebe commit 8ea2de5

3 files changed

Lines changed: 44 additions & 38 deletions

File tree

site/supplemental-ui/css/site-ftn-docs.css

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,17 @@ pre,
6969
/* ——— Top bar: light strip in “light” theme, dark strip in dark theme ——— */
7070
.header.ftn-header {
7171
display: block;
72-
background: var(--ftn-header-bar-bg);
7372
color: var(--ftn-header-bar-fg);
74-
border-bottom: 1px solid var(--ftn-header-bar-border);
7573
box-sizing: border-box;
74+
/* Mast has its own fill and bottom border; top row is .ftn-site-navbar (sticky + opaque). */
75+
background: transparent;
7676
}
7777

78+
/* Sticky first row: must be solid so page content does not show through on scroll. */
7879
.ftn-site-navbar {
80+
position: sticky;
81+
top: 0;
82+
z-index: 8;
7983
width: 100%;
8084
min-height: 3.5rem;
8185
display: flex;
@@ -85,9 +89,9 @@ pre,
8589
box-sizing: border-box;
8690
padding: 0 0.6rem 0 0.5rem;
8791
column-gap: 0.75rem;
88-
/* Let .header.ftn-header own the bar color (bundle .navbar can otherwise paint a dark strip) */
89-
background: transparent !important;
92+
background: var(--ftn-header-bar-bg) !important;
9093
color: inherit;
94+
border-bottom: 1px solid var(--ftn-header-bar-border);
9195
}
9296

9397
.header.ftn-header .ftn-topbar,
@@ -186,31 +190,36 @@ a.ftn-header-title:focus {
186190
opacity: 0.9;
187191
}
188192

189-
/* Org GitHub profile — img/vcs/github.svg is white; light mode uses --ftn-header-github-icon-filter */
190-
.ftn-header-github,
191-
.navbar-item.ftn-header-github {
192-
color: var(--ftn-header-bar-fg);
193-
text-decoration: none;
194-
display: flex;
193+
/* Header end controls (GitHub, theme) — one shape; beats site-extra .theme-toggle:hover colors. */
194+
.header.ftn-header .navbar .navbar-end .ftn-header-icon-btn {
195+
min-width: var(--ftn-header-ctrl) !important;
196+
min-height: var(--ftn-header-ctrl) !important;
197+
width: var(--ftn-header-ctrl) !important;
198+
height: var(--ftn-header-ctrl) !important;
199+
padding: 0 !important;
200+
display: inline-flex !important;
195201
align-items: center;
196202
justify-content: center;
197-
width: var(--ftn-header-ctrl);
198-
height: var(--ftn-header-ctrl);
199-
min-width: var(--ftn-header-ctrl);
200-
min-height: var(--ftn-header-ctrl);
201-
border-radius: 0.2rem;
202-
padding: 0;
203203
box-sizing: border-box;
204204
flex-shrink: 0;
205+
border: none;
206+
border-radius: 0.2rem;
207+
text-decoration: none;
208+
color: var(--ftn-header-bar-fg) !important;
209+
background: transparent !important;
210+
cursor: pointer;
205211
}
206212

207-
.ftn-header-github:hover,
208-
.ftn-header-github:focus {
209-
background: var(--ftn-header-bar-hover);
213+
.header.ftn-header .navbar .navbar-end .ftn-header-icon-btn:hover,
214+
.header.ftn-header .navbar .navbar-end .ftn-header-icon-btn:focus {
215+
background: var(--ftn-header-bar-hover) !important;
210216
text-decoration: none;
217+
outline: none;
211218
}
212219

213-
.ftn-header-github-img {
220+
/* GitHub mark in light mode needs filter; theme icons use currentColor. */
221+
.ftn-header-github .ftn-header-github-img,
222+
.ftn-header-icon-btn.ftn-header-github .ftn-header-github-img {
214223
width: 24px;
215224
height: 24px;
216225
display: block;
@@ -220,24 +229,20 @@ a.ftn-header-title:focus {
220229
filter: var(--ftn-header-github-icon-filter, none);
221230
}
222231

223-
/* Theme toggle: same hit box; stroke uses currentColor — dark on light bar, light on dark bar */
224-
.header.ftn-header .navbar .navbar-end .theme-toggle {
225-
min-width: var(--ftn-header-ctrl) !important;
226-
min-height: var(--ftn-header-ctrl) !important;
227-
width: var(--ftn-header-ctrl) !important;
228-
height: var(--ftn-header-ctrl) !important;
229-
padding: 0 !important;
230-
display: inline-flex !important;
231-
align-items: center;
232-
justify-content: center;
233-
box-sizing: border-box;
234-
flex-shrink: 0;
235-
color: var(--ftn-header-bar-fg) !important;
232+
.header.ftn-header .ftn-header-icon-btn .theme-icon {
233+
width: 18px;
234+
height: 18px;
235+
display: block;
236+
fill: none;
237+
stroke: currentColor;
238+
stroke-width: 2;
239+
stroke-linecap: round;
240+
stroke-linejoin: round;
236241
}
237242

238-
.header.ftn-header .navbar .navbar-end .theme-toggle:hover,
239-
.header.ftn-header .navbar .navbar-end .theme-toggle:focus {
240-
background: var(--ftn-header-bar-hover) !important;
243+
.header.ftn-header .ftn-header-icon-btn .theme-icon path,
244+
.header.ftn-header .ftn-header-icon-btn .theme-icon circle {
245+
fill: none;
241246
}
242247

243248
@media screen and (min-width: 1024px) {

site/supplemental-ui/js/site-dark-mode.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
function ensureToggleButton() {
5252
const existingToggle = document.getElementById("theme-toggle");
5353
if (existingToggle) {
54+
existingToggle.classList.add("ftn-header-icon-btn");
5455
existingToggle.addEventListener("click", toggleTheme);
5556
updateToggleLabel();
5657
return;
@@ -61,7 +62,7 @@
6162

6263
const button = document.createElement("button");
6364
button.id = "theme-toggle";
64-
button.className = "navbar-item theme-toggle";
65+
button.className = "navbar-item ftn-header-icon-btn theme-toggle";
6566
button.type = "button";
6667
button.addEventListener("click", toggleTheme);
6768

site/supplemental-ui/partials/header-content.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</div>
99
<div id="topbar-nav" class="navbar-menu ftn-topbar" role="navigation" aria-label="External links">
1010
<div class="navbar-end ftn-header-actions">
11-
<a class="navbar-item ftn-header-github" href="{{{or (lookup site.keys 'github_profile_url') 'https://github.com/FoodTruckNerdz'}}}" rel="noopener" target="_blank" title="Food Truck Nerdz on GitHub" aria-label="Food Truck Nerdz on GitHub">
11+
<a class="navbar-item ftn-header-icon-btn ftn-header-github" href="{{{or (lookup site.keys 'github_profile_url') 'https://github.com/FoodTruckNerdz'}}}" rel="noopener" target="_blank" title="Food Truck Nerdz on GitHub" aria-label="Food Truck Nerdz on GitHub">
1212
<img class="ftn-header-github-img" src="{{{uiRootPath}}}/img/vcs/github.svg" width="24" height="24" alt="" />
1313
</a>
1414
</div>

0 commit comments

Comments
 (0)