Merge pull request #21260 from dvdksn/fix-site-header-sm-screens

site: improve header display on small devices
This commit is contained in:
David Karlsson 2024-10-29 10:08:50 +01:00 committed by GitHub
commit 2e0d0fd50d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 35 additions and 12 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@ -41,6 +41,7 @@
"Docker-Compose", "Docker-Compose",
"Docker-Desktop", "Docker-Desktop",
"Docker-Hub", "Docker-Hub",
"Docker-Scout-Dashboard",
"Download", "Download",
"Editor-or-IDE", "Editor-or-IDE",
"Entra-ID", "Entra-ID",
@ -86,6 +87,7 @@
"Node", "Node",
"Non-compliant", "Non-compliant",
"Okta", "Okta",
"Okta-SAML",
"Old-Dockerfile", "Old-Dockerfile",
"PHP", "PHP",
"PowerShell", "PowerShell",
@ -469,6 +471,7 @@
"self-start", "self-start",
"shadow", "shadow",
"shadow-lg", "shadow-lg",
"sm:block",
"sm:flex", "sm:flex",
"sm:flex-row", "sm:flex-row",
"sm:hidden", "sm:hidden",
@ -479,7 +482,6 @@
"space-y-4", "space-y-4",
"sticky", "sticky",
"svg-container", "svg-container",
"svg-icon",
"syntax-light", "syntax-light",
"systemd-networkd", "systemd-networkd",
"text-2xl", "text-2xl",

View File

@ -62,10 +62,33 @@
>Legal</a> >Legal</a>
</div> </div>
</div> </div>
<div> <div class="flex justify-between items-center">
<button type="button" id="ot-sdk-btn" class="ot-sdk-show-settings"> <button type="button" id="ot-sdk-btn" class="ot-sdk-show-settings">
Cookies Settings Cookies Settings
</button> </button>
<div class="flex items-center gap-2">
<span>Theme:</span>
<button
aria-label="Theme switch"
id="theme-switch"
class="rounded bg-blue-light px-4 py-1 text-white transition
hover:bg-blue-light-400 dark:bg-blue-dark-400
dark:hover:bg-blue-dark"
x-data="{ theme: localStorage.getItem('theme-preference') }"
x-init="$watch('theme', value => {
localStorage.setItem('theme-preference', value);
document.firstElementChild.className = value;
})"
@click="theme = (theme === 'dark' ? 'light' : 'dark')"
>
<span class="icon-svg icon-sm dark:hidden"
>Light {{ partialCached "icon" "light_mode" "light_mode" }}</span
>
<span class="icon-svg icon-sm hidden dark:block"
>Dark {{ partialCached "icon" "dark_mode" "dark_mode" }}</span
>
</button>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -10,9 +10,12 @@
<div> <div>
{{/* main logo */}} {{/* main logo */}}
<a title="Docker Docs home page" href="{{ site.BaseURL }}"> <a title="Docker Docs home page" href="{{ site.BaseURL }}">
<div> <div class="hidden sm:block">
{{- (resources.Get "images/docker-docs-white.svg").Content | safe.HTML -}} {{- (resources.Get "images/docker-docs-white.svg").Content | safe.HTML -}}
</div> </div>
<div class="block sm:hidden">
{{- (resources.Get "images/docker-docs-white-condensed.svg").Content | safe.HTML -}}
</div>
</a> </a>
</div> </div>
<nav class="mt-1 hidden md:block"> <nav class="mt-1 hidden md:block">
@ -37,15 +40,6 @@
<span>Ask&nbsp;AI</span> <span>Ask&nbsp;AI</span>
<img src="{{ (resources.Get "images/ai-stars.svg").Permalink }}" alt="AI Stars" /> <img src="{{ (resources.Get "images/ai-stars.svg").Permalink }}" alt="AI Stars" />
</button> </button>
<button aria-label="Theme switch" id="theme-switch" class="svg-icon"
x-data="{ theme: localStorage.getItem('theme-preference') }" x-init="$watch('theme', value => {
localStorage.setItem('theme-preference', value);
document.firstElementChild.className = value;
})" @click="theme = (theme === 'dark' ? 'light' : 'dark')">
<span class="icon-svg dark:hidden">{{ partialCached "icon" "light_mode" "light_mode"}}</span>
<span class="icon-svg hidden dark:block">{{ partialCached "icon" "dark_mode" "dark_mode"}}</span>
</button>
</div> </div>
</div> </div>
</header> </header>