style(header): enhance logo and theme switch layout for better alignment

This commit is contained in:
Aditya Telange
2026-04-11 23:51:20 +05:30
parent 9870ab3b40
commit ee4cadecc5
2 changed files with 41 additions and 35 deletions
+36 -30
View File
@@ -19,26 +19,27 @@
} }
.logo { .logo {
flex-wrap: inherit; align-items: center;
column-gap: 0.55rem;
flex-wrap: wrap;
} }
.logo a { .logo a {
font-size: 24px; font-size: 24px;
font-weight: 700; font-weight: 700;
display: flex;
align-items: center;
column-gap: 0.55rem;
} }
.logo a img, .logo a svg { .logo a img,
display: inline; .logo a svg {
vertical-align: middle;
pointer-events: none; pointer-events: none;
transform: translate(0, -10%);
border-radius: 6px; border-radius: 6px;
margin-inline-end: 8px;
} }
.theme-toggle { .theme-toggle {
font-size: 26px; padding: 0 0.4rem;
margin: auto 4px;
} }
[data-theme="dark"] .moon { [data-theme="dark"] .moon {
@@ -49,6 +50,33 @@
display: none; display: none;
} }
.logo-switches {
display: inline-flex;
gap: 0.4rem;
align-items: inherit;
min-height: stretch;
flex-wrap: inherit;
}
.logo-switches>* {
min-height: inherit;
align-items: center;
display: inline-flex;
}
.lang-menu * {
display: inherit;
min-height: inherit;
align-items: inherit;
}
.lang-menu a {
font-size: 1rem;
font-weight: 500;
padding: 0 0.4rem;
display: inline-flex
}
.menu { .menu {
list-style: none; list-style: none;
word-break: keep-all; word-break: keep-all;
@@ -68,25 +96,3 @@
font-weight: 500; font-weight: 500;
border-bottom: 2px solid currentColor; border-bottom: 2px solid currentColor;
} }
.lang-switch li,
.lang-switch ul,
.logo-switches {
display: inline-flex;
margin: auto 4px;
}
.lang-switch {
display: flex;
flex-wrap: inherit;
}
.lang-switch a {
margin: auto 3px;
font-size: 16px;
font-weight: 500;
}
.logo-switches {
flex-wrap: inherit;
}
+4 -4
View File
@@ -37,12 +37,12 @@
<div class="logo-switches"> <div class="logo-switches">
{{- if (not site.Params.disableThemeToggle) }} {{- if (not site.Params.disableThemeToggle) }}
<button id="theme-toggle" class="theme-toggle" accesskey="t" title="(Alt + T)" aria-label="Toggle theme"> <button id="theme-toggle" class="theme-toggle" accesskey="t" title="(Alt + T)" aria-label="Toggle theme">
<svg class="moon" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" <svg class="moon" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round">
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path> <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
</svg> </svg>
<svg class="sun" xmlns="http://www.w3.org/2000/svg" width="24" height="18" viewBox="0 0 24 24" <svg class="sun" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round"> stroke-linejoin="round">
<circle cx="12" cy="12" r="5"></circle> <circle cx="12" cy="12" r="5"></circle>
@@ -61,9 +61,9 @@
{{- if (not site.Params.disableLangToggle) }} {{- if (not site.Params.disableLangToggle) }}
{{- $lang := .Lang}} {{- $lang := .Lang}}
{{- $separator := or $label_text (not site.Params.disableThemeToggle)}} {{- $separator := or $label_text (not site.Params.disableThemeToggle)}}
{{- if $separator }}<span>|</span>{{ end }}
{{- with site.Home.Translations }} {{- with site.Home.Translations }}
<ul class="lang-switch"> <ul class="lang-menu">
{{- if $separator }}<li>|</li>{{ end }}
{{- range . -}} {{- range . -}}
{{- if ne $lang .Lang }} {{- if ne $lang .Lang }}
<li> <li>