Browse Source

Fixes for contrast theme

pull/19/head
Anxhelo Lushka 3 years ago
parent
commit
b4e5cfe479
  1. 21
      assets/scss/_custom.scss
  2. 12
      layouts/partials/menu.html

21
assets/scss/_custom.scss

@ -18,6 +18,15 @@ html[data-theme="dark"] {
text-decoration: underline;
}
& .nav-link.active.language {
color: #121212 !important;
background-color: $contrast !important;
}
& .nav-link.language {
color: $contrast !important;
}
& .screen-reader-text:focus {
background-color: $contrast;
}
@ -26,6 +35,10 @@ html[data-theme="dark"] {
fill: $contrast !important;
}
& .vr {
background-color: $contrast !important;
}
& a {
color: $contrast !important;
border-color: $contrast;
@ -151,6 +164,14 @@ body {
background-color: $black;
}
.txt-dark {
color: #212529;
}
.txt-white {
color: $white !important;
}
// Headings
h1,
h2,

12
layouts/partials/menu.html

@ -19,7 +19,7 @@
</a>
<button class="navbar-toggler" type="button" aria-label="Toggle navigation" onclick="openNav()">
<span class="inline-svg">
<svg class="{{ if .IsHome }}text-white{{ else if eq $theme "dark" }}text-white{{ else if eq $theme "light" }}text-dark{{ else if eq $type "about" }}text-white{{ else }}color-blue-500{{ end }}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" {{ if isset .Page.Params "text" }}style="color: {{ .Page.Params.text }} !important;"{{ end }}><path fill="currentColor" d="M416 288C433.7 288 448 302.3 448 320C448 337.7 433.7 352 416 352H32C14.33 352 0 337.7 0 320C0 302.3 14.33 288 32 288H416zM416 160C433.7 160 448 174.3 448 192C448 209.7 433.7 224 416 224H32C14.33 224 0 209.7 0 192C0 174.3 14.33 160 32 160H416z"></path></svg>
<svg class="{{ if .IsHome }}txt-white{{ else if eq $theme "dark" }}txt-white{{ else if eq $theme "light" }}txt-dark{{ else if eq $type "about" }}txt-white{{ else }}color-blue-500{{ end }}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" {{ if isset .Page.Params "text" }}style="color: {{ .Page.Params.text }} !important;"{{ end }}><path fill="currentColor" d="M416 288C433.7 288 448 302.3 448 320C448 337.7 433.7 352 416 352H32C14.33 352 0 337.7 0 320C0 302.3 14.33 288 32 288H416zM416 160C433.7 160 448 174.3 448 192C448 209.7 433.7 224 416 224H32C14.33 224 0 209.7 0 192C0 174.3 14.33 160 32 160H416z"></path></svg>
</span>
</button>
<div class="collapse navbar-collapse flex-grow-0">
@ -27,12 +27,12 @@
{{- $firstUrlElement := print "/" (index (split .RelPermalink "/") 2) "/" -}}
{{- range .Site.Menus.main -}}
<li class="nav-item ms-4">
<a class="nav-link {{ if eq $theme "dark" }}text-white{{ else if eq $theme "light" }}text-dark{{ else if $home }}text-white{{ else if eq $type "about" }}text-white{{ else }}{{ end }} {{ if eq ($firstUrlElement|lower) (.URL|lower) }}active{{end}}" {{ if eq
($firstUrlElement|lower) (.URL|lower) }}aria-current="page" {{end}} {{ if isset $param "text" }}style="color: {{ $text }} !important;"{{ end }} href="{{ .URL | absLangURL }}">{{ .Name }}</a>
<a class="nav-link {{ if eq $theme "dark" }}txt-white{{ else if eq $theme "light" }}txt-dark{{ else if $home }}txt-white{{ else if eq $type "about" }}txt-white{{ else }}{{ end }} {{ if eq ($firstUrlElement|lower) (.URL|lower) }}active{{end}}" {{ if eq
($firstUrlElement|lower) (.URL|lower) }}aria-current="page" {{end}} {{ if isset $param "text" }}style="color: {{ $text }};"{{ end }} href="{{ .URL | absLangURL }}">{{ .Name }}</a>
</li>
{{ end }}
<li class="nav-item ms-4 {{ if eq $theme "dark" }}text-white{{ else if eq $theme "light" }}text-dark{{ else if $home }}text-white{{ else if eq $type "about" }}text-white{{ else }}{{ end }}" {{ if isset $param "text" }}style="color: {{ $text }} !important;"{{ end }}>
<li class="nav-item ms-4 {{ if eq $theme "dark" }}txt-white{{ else if eq $theme "light" }}txt-dark{{ else if $home }}txt-white{{ else if eq $type "about" }}txt-white{{ else }}{{ end }}" {{ if isset $param "text" }}style="color: {{ $text }} !important;"{{ end }}>
<div class="vr"></div>
</li>
@ -41,12 +41,12 @@
{{ range .Site.Languages }}
{{ if eq . $.Site.Language }}
<li class="nav-item ms-2">
<p class="nav-link active language text-uppercase mb-0 {{ if eq $theme "dark" }}background-white{{ else if eq $theme "light" }}text-dark background-white{{ else if $home }}color-blue-500 background-white{{ else if eq $type "about" }}color-blue-500 background-white{{ else }}text-white background-blue-500{{ end }}" {{ if eq $.Params.text "#FFFFFF" }}style="color: {{ $.Params.background }} !important;"{{ else }}{{ end }}>{{ .Lang }}</p>
<p class="nav-link active language text-uppercase mb-0 {{ if eq $theme "dark" }}background-white{{ else if eq $theme "light" }}txt-dark background-white{{ else if $home }}color-blue-500 background-white{{ else if eq $type "about" }}color-blue-500 background-white{{ else }}txt-white background-blue-500{{ end }}" {{ if eq $.Params.text "#FFFFFF" }}style="color: {{ $.Params.background }} !important;"{{ else }}{{ end }}>{{ .Lang }}</p>
</li>
{{ else }}
{{ range $.Translations }}
<li class="nav-item ms-2">
<a class="nav-link language text-uppercase {{ if eq $theme "dark" }}text-white{{ else if eq $theme "light" }}text-dark{{ else if $home }}text-white{{ else if eq $type "about" }}text-white{{ else }}{{ end }}" {{ if isset $param "text" }}style="color: {{ $text }} !important;"{{ end }} href ="{{ .Permalink }}">{{ .Lang }}</a>
<a class="nav-link language text-uppercase {{ if eq $theme "dark" }}txt-white{{ else if eq $theme "light" }}txt-dark{{ else if $home }}txt-white{{ else if eq $type "about" }}txt-white{{ else }}{{ end }}" {{ if isset $param "text" }}style="color: {{ $text }};"{{ end }} href ="{{ .Permalink }}">{{ .Lang }}</a>
</li>
{{ end }}
{{ end }}

Loading…
Cancel
Save