refactor(sidebar): Simplify styles

Co-authored-by: Jimmy Cai <hi@jimmycai.com>
This commit is contained in:
Jiahao Li 2024-03-10 21:01:23 +02:00 committed by Jimmy Cai
parent 3074b4a676
commit de18f408a5
2 changed files with 28 additions and 35 deletions

View File

@ -141,12 +141,14 @@
margin: 0 calc(var(--container-padding) * -1);
padding: 30px 30px;
@include respond(xl) {
padding: 15px 0;
}
& {
&, .menu-bottom-section ol {
gap: 30px;
@include respond(xl) {
gap: 25px;
}
@ -165,10 +167,6 @@
margin: 0;
}
li:last-of-type {
margin-top: auto;
}
li {
position: relative;
vertical-align: middle;
@ -204,18 +202,15 @@
}
}
.menu-bottom-section {
&.menu-bottom-section {
margin-top: auto;
ol {
margin-top: auto;
display: flex;
flex-direction: column;
width: 100%;
padding-left: 0;
gap: 30px;
@include respond(xl) {
gap: 25px;
}
}
}
}

View File

@ -74,32 +74,30 @@
</a>
</li>
{{ end }}
<li>
<div class="menu-bottom-section">
<ol class="menu">
{{- $currentLanguageCode := .Language.Lang -}}
{{ if ( compare.Gt .Site.Home.AllTranslations.Len 1 ) }}
{{ with .Site.Home.AllTranslations }}
<li id="i18n-switch">
{{ partial "helper/icon" "language" }}
<select name="language" title="language" onchange="window.location.href = this.selectedOptions[0].value">
{{ range . }}
<option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
{{ end }}
</select>
</li>
{{ end }}
{{ end }}
{{ if (default false .Site.Params.colorScheme.toggle) }}
<li id="dark-mode-toggle">
{{ partial "helper/icon" "toggle-left" }}
{{ partial "helper/icon" "toggle-right" }}
<span>{{ T "darkMode" }}</span>
<li class="menu-bottom-section">
<ol class="menu">
{{- $currentLanguageCode := .Language.Lang -}}
{{ if ( compare.Gt .Site.Home.AllTranslations.Len 1 ) }}
{{ with .Site.Home.AllTranslations }}
<li id="i18n-switch">
{{ partial "helper/icon" "language" }}
<select name="language" title="language" onchange="window.location.href = this.selectedOptions[0].value">
{{ range . }}
<option value="{{ .Permalink }}" {{ if eq .Language.Lang $currentLanguageCode }}selected{{ end }}>{{ .Language.LanguageName }}</option>
{{ end }}
</select>
</li>
{{ end }}
</ol>
</div>
{{ end }}
{{ if (default false .Site.Params.colorScheme.toggle) }}
<li id="dark-mode-toggle">
{{ partial "helper/icon" "toggle-left" }}
{{ partial "helper/icon" "toggle-right" }}
<span>{{ T "darkMode" }}</span>
</li>
{{ end }}
</ol>
</li>
</ol>
</aside>