Skip to content

Commit cf66d01

Browse files
committed
refactor(docs-ui): top bar site logo = icon btn + adt-header-site-logo
- header: navbar-item adt-header-icon-btn adt-header-site-logo (same as GitHub VCS) - site-doc-layout: apply icon control rules to all .navbar .adt-header-icon-logo in the header, not only .navbar-end (logo lives in .navbar-brand) - override: retarget light tile + no SVG filter; fix :focus vs transparent for logo Made-with: Cursor
1 parent f4b3496 commit cf66d01

3 files changed

Lines changed: 26 additions & 44 deletions

File tree

site/supplemental-ui/css/site-doc-layout.css

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -178,33 +178,14 @@ pre,
178178
column-gap: 0.15rem;
179179
}
180180

181-
.adt-header-logo-item {
182-
display: flex;
183-
align-items: center;
184-
justify-content: center;
185-
flex: 0 0 auto;
186-
width: var(--adt-header-ctrl);
187-
height: var(--adt-header-ctrl);
188-
min-width: var(--adt-header-ctrl);
189-
min-height: var(--adt-header-ctrl);
190-
padding: 0;
191-
line-height: 0;
192-
border-radius: 0.2rem;
193-
text-decoration: none;
194-
box-sizing: border-box;
195-
}
196-
197-
.adt-header-logo-item:hover,
198-
.adt-header-logo-item:focus {
199-
background: var(--adt-header-bar-hover);
200-
outline: none;
201-
}
202-
203-
.adt-header-logo {
181+
/* Optional hook for the site logo: same as .adt-header-icon-btn (see below) + this class. */
182+
.adt-header-icon-btn.adt-header-site-logo .adt-header-logo {
204183
display: block;
205184
width: 30px;
206185
height: 30px;
207186
object-fit: contain;
187+
pointer-events: none;
188+
flex-shrink: 0;
208189
}
209190

210191
/* Dark-mode FTN header logo: see css/site-header-logo-override.css (logo link background +
@@ -230,8 +211,8 @@ a.adt-header-title:focus {
230211
opacity: 0.9;
231212
}
232213

233-
/* Header end controls (GitHub, theme)one shape; beats site-extra .theme-toggle:hover colors. */
234-
.header.adt-header .navbar .navbar-end .adt-header-icon-btn {
214+
/* Top bar icon controls (logo, GitHub, theme): one shape. Include .navbar-brand, not only .navbar-end. */
215+
.header.adt-header .navbar .adt-header-icon-btn {
235216
min-width: var(--adt-header-ctrl) !important;
236217
min-height: var(--adt-header-ctrl) !important;
237218
width: var(--adt-header-ctrl) !important;
@@ -251,17 +232,17 @@ a.adt-header-title:focus {
251232
}
252233

253234
/* :focus (mouse click) would keep the “hover” fill until click-away—use :focus-visible for keyboard. */
254-
.header.adt-header .navbar .navbar-end .adt-header-icon-btn:hover {
235+
.header.adt-header .navbar .adt-header-icon-btn:hover {
255236
background: var(--adt-header-bar-hover) !important;
256237
text-decoration: none;
257238
}
258239

259-
.header.adt-header .navbar .navbar-end .adt-header-icon-btn:focus {
240+
.header.adt-header .navbar .adt-header-icon-btn:focus {
260241
outline: none;
261242
background: transparent !important;
262243
}
263244

264-
.header.adt-header .navbar .navbar-end .adt-header-icon-btn:focus-visible {
245+
.header.adt-header .navbar .adt-header-icon-btn:focus-visible {
265246
background: var(--adt-header-bar-hover) !important;
266247
outline: 2px solid var(--adt-header-bar-fg);
267248
outline-offset: 2px;
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
1-
/* Load after site-doc-layout (head-meta). Separate file to avoid long-lived cache on
2-
site-doc-layout.css. Target is the *button* (the logo link) background in dark mode,
3-
not text — the <a> is img-only, but the hit area must read as a filled control. */
4-
html.dark-theme a.adt-header-logo-item,
5-
html.dark-theme .navbar a.adt-header-logo-item,
6-
html.dark-theme .adt-header-logo-item {
1+
/* Load after site-doc-layout (head-meta). Markup: navbar-item adt-header-icon-btn adt-header-site-logo
2+
(same as other top bar icon buttons) + adt-header-site-logo for per-site / per-logo overrides. */
3+
/* Dark: light “button” fill so the full control matches the other top bar hit targets. */
4+
html.dark-theme .header.adt-header .navbar .navbar-item.adt-header-icon-btn.adt-header-site-logo,
5+
html.dark-theme .header.adt-header .navbar a.adt-header-icon-btn.adt-header-site-logo {
76
background: #eef0f3 !important;
87
background-color: #eef0f3 !important;
98
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
109
}
1110

12-
html.dark-theme a.adt-header-logo-item:hover,
13-
html.dark-theme a.adt-header-logo-item:focus,
14-
html.dark-theme .navbar a.adt-header-logo-item:hover,
15-
html.dark-theme .navbar a.adt-header-logo-item:focus,
16-
html.dark-theme .adt-header-logo-item:hover,
17-
html.dark-theme .adt-header-logo-item:focus {
11+
html.dark-theme .header.adt-header .navbar .adt-header-icon-btn.adt-header-site-logo:hover {
1812
background: #dde1e6 !important;
1913
background-color: #dde1e6 !important;
2014
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12) !important;
2115
}
2216

17+
/* site-doc-layout uses :focus { background: transparent } on all icon btn — re-apply the tile for the site logo. */
18+
html.dark-theme .header.adt-header .navbar .adt-header-icon-btn.adt-header-site-logo:focus,
19+
html.dark-theme .header.adt-header .navbar .adt-header-icon-btn.adt-header-site-logo:focus-visible {
20+
background: #eef0f3 !important;
21+
background-color: #eef0f3 !important;
22+
}
23+
2324
/* antora-dark-theme: do not recolor the SVG */
24-
html.dark-theme .adt-header-logo,
25-
html.dark-theme a.adt-header-logo-item .adt-header-logo,
26-
html.dark-theme a.adt-header-logo-item > img {
25+
html.dark-theme .adt-header-site-logo .adt-header-logo,
26+
html.dark-theme .adt-header-icon-btn.adt-header-site-logo .adt-header-logo,
27+
html.dark-theme .adt-header-icon-btn.adt-header-site-logo > img {
2728
filter: none !important;
2829
opacity: 1 !important;
2930
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<header class="header adt-header">
22
<nav class="navbar adt-site-navbar" aria-label="Site">
33
<div class="navbar-brand adt-header-brand">
4-
<a class="adt-header-logo-item" href="{{{or (lookup site.keys 'foodtrucknerdz_com') 'https://foodtrucknerdz.com'}}}" rel="noopener" target="_blank" title="foodtrucknerdz.com" aria-label="foodtrucknerdz.com (opens in new tab)">
4+
<a class="navbar-item adt-header-icon-btn adt-header-site-logo" href="{{{or (lookup site.keys 'foodtrucknerdz_com') 'https://foodtrucknerdz.com'}}}" rel="noopener" target="_blank" title="foodtrucknerdz.com" aria-label="foodtrucknerdz.com (opens in new tab)">
55
<img class="adt-header-logo" src="{{{uiRootPath}}}/img/foodtrucknerdz.svg" width="34" height="34" alt="" />
66
</a>
77
<a class="navbar-item adt-header-title" href="{{{or site.url siteRootPath}}}">{{detag (or (lookup site.keys 'title_bar_brand') (or site.title 'FTN Docs'))}}</a>

0 commit comments

Comments
 (0)