From c33dabf3a233fdeb46bdc63bb6256d75b709faad Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Mon, 26 Oct 2020 22:19:05 +0530
Subject: [PATCH] header: add Language switch (#54)
* language-switch: init
* header: move logo-switches together
---
assets/css/header.css | 24 ++++++++++-
layouts/partials/header.html | 79 ++++++++++++++++++++++++------------
2 files changed, 75 insertions(+), 28 deletions(-)
diff --git a/assets/css/header.css b/assets/css/header.css
index 72b5f6aa..fe255762 100644
--- a/assets/css/header.css
+++ b/assets/css/header.css
@@ -7,17 +7,18 @@
max-width: calc(var(--nav-width) + var(--gap) * 2);
margin-inline-start: auto;
margin-inline-end: auto;
+ line-height: var(--header-height);
}
.nav a {
display: block;
- line-height: var(--header-height);
}
.logo,
.menu {
display: flex;
margin: auto var(--gap);
+ flex-wrap: inherit;
}
.logo a {
@@ -40,7 +41,7 @@
user-select: none;
}
-body.dark #moon{
+body.dark #moon {
vertical-align: middle;
display: none;
}
@@ -68,3 +69,22 @@ body:not(.dark) #sun {
font-weight: 500;
border-bottom: 2px solid currentColor;
}
+
+.lang-switch ul {
+ display: inline-flex;
+}
+
+.lang-switch a {
+ font-size: 16px;
+ font-weight: 500;
+ margin: 0 8px;
+}
+
+.lang-switch li {
+ display: inline-flex;
+}
+
+.logo-switches {
+ display: inline-flex;
+ flex-wrap: inherit;
+}
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 0f2e72b1..48a9f4eb 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -10,6 +10,7 @@
document.body.classList.add('dark');
}
}
+
{{- end }}
{{- if (and (.Site.Params.disableThemeToggle) (eq .Site.Params.defaultTheme "auto")) }}
@@ -17,6 +18,7 @@
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark');
}
+
{{- end }}