Skip to content

Commit 2e0d0fd

Browse files
authored
Merge pull request #21260 from dvdksn/fix-site-header-sm-screens
site: improve header display on small devices
2 parents 73ebb95 + 93f816e commit 2e0d0fd

File tree

4 files changed

+35
-12
lines changed

4 files changed

+35
-12
lines changed
Lines changed: 4 additions & 0 deletions
Loading

hugo_stats.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"Docker-Compose",
4242
"Docker-Desktop",
4343
"Docker-Hub",
44+
"Docker-Scout-Dashboard",
4445
"Download",
4546
"Editor-or-IDE",
4647
"Entra-ID",
@@ -86,6 +87,7 @@
8687
"Node",
8788
"Non-compliant",
8889
"Okta",
90+
"Okta-SAML",
8991
"Old-Dockerfile",
9092
"PHP",
9193
"PowerShell",
@@ -469,6 +471,7 @@
469471
"self-start",
470472
"shadow",
471473
"shadow-lg",
474+
"sm:block",
472475
"sm:flex",
473476
"sm:flex-row",
474477
"sm:hidden",
@@ -479,7 +482,6 @@
479482
"space-y-4",
480483
"sticky",
481484
"svg-container",
482-
"svg-icon",
483485
"syntax-light",
484486
"systemd-networkd",
485487
"text-2xl",

layouts/partials/footer.html

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,33 @@
6262
>Legal</a>
6363
</div>
6464
</div>
65-
<div>
65+
<div class="flex justify-between items-center">
6666
<button type="button" id="ot-sdk-btn" class="ot-sdk-show-settings">
6767
Cookies Settings
6868
</button>
69+
<div class="flex items-center gap-2">
70+
<span>Theme:</span>
71+
<button
72+
aria-label="Theme switch"
73+
id="theme-switch"
74+
class="rounded bg-blue-light px-4 py-1 text-white transition
75+
hover:bg-blue-light-400 dark:bg-blue-dark-400
76+
dark:hover:bg-blue-dark"
77+
x-data="{ theme: localStorage.getItem('theme-preference') }"
78+
x-init="$watch('theme', value => {
79+
localStorage.setItem('theme-preference', value);
80+
document.firstElementChild.className = value;
81+
})"
82+
@click="theme = (theme === 'dark' ? 'light' : 'dark')"
83+
>
84+
<span class="icon-svg icon-sm dark:hidden"
85+
>Light {{ partialCached "icon" "light_mode" "light_mode" }}</span
86+
>
87+
<span class="icon-svg icon-sm hidden dark:block"
88+
>Dark {{ partialCached "icon" "dark_mode" "dark_mode" }}</span
89+
>
90+
</button>
91+
</div>
6992
</div>
7093
</div>
7194
</div>

layouts/partials/header.html

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
<div>
1111
{{/* main logo */}}
1212
<a title="Docker Docs home page" href="{{ site.BaseURL }}">
13-
<div>
13+
<div class="hidden sm:block">
1414
{{- (resources.Get "images/docker-docs-white.svg").Content | safe.HTML -}}
1515
</div>
16+
<div class="block sm:hidden">
17+
{{- (resources.Get "images/docker-docs-white-condensed.svg").Content | safe.HTML -}}
18+
</div>
1619
</a>
1720
</div>
1821
<nav class="mt-1 hidden md:block">
@@ -37,15 +40,6 @@
3740
<span>Ask&nbsp;AI</span>
3841
<img src="{{ (resources.Get "images/ai-stars.svg").Permalink }}" alt="AI Stars" />
3942
</button>
40-
<button aria-label="Theme switch" id="theme-switch" class="svg-icon"
41-
x-data="{ theme: localStorage.getItem('theme-preference') }" x-init="$watch('theme', value => {
42-
localStorage.setItem('theme-preference', value);
43-
document.firstElementChild.className = value;
44-
})" @click="theme = (theme === 'dark' ? 'light' : 'dark')">
45-
<span class="icon-svg dark:hidden">{{ partialCached "icon" "light_mode" "light_mode"}}</span>
46-
<span class="icon-svg hidden dark:block">{{ partialCached "icon" "dark_mode" "dark_mode"}}</span>
47-
</button>
4843
</div>
4944
</div>
50-
5145
</header>

0 commit comments

Comments
 (0)