mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2025-05-14 15:14:27 -04:00
Merge 71b5c16e7f
into 7cf752f864
This commit is contained in:
commit
7112d40d28
2 changed files with 33 additions and 9 deletions
|
@ -106,6 +106,38 @@
|
|||
<link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}">
|
||||
{{ end -}}
|
||||
|
||||
{{- /* theme-toggle is disabled and theme is auto */}}
|
||||
{{- if (and site.Params.disableThemeToggle (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark")) }}
|
||||
<style>
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--theme: rgb(29, 30, 32);
|
||||
--entry: rgb(46, 46, 51);
|
||||
--primary: rgb(218, 218, 219);
|
||||
--secondary: rgb(155, 156, 157);
|
||||
--tertiary: rgb(65, 66, 68);
|
||||
--content: rgb(196, 196, 197);
|
||||
--hljs-bg: rgb(46, 46, 51);
|
||||
--code-bg: rgb(55, 56, 62);
|
||||
--border: rgb(51, 51, 51);
|
||||
}
|
||||
|
||||
.list {
|
||||
background: var(--theme);
|
||||
}
|
||||
|
||||
.list:not(.dark)::-webkit-scrollbar-track {
|
||||
background: 0 0;
|
||||
}
|
||||
|
||||
.list:not(.dark)::-webkit-scrollbar-thumb {
|
||||
border-color: var(--theme);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
{{- end }}
|
||||
|
||||
<noscript>
|
||||
<style>
|
||||
#theme-toggle,
|
||||
|
@ -114,7 +146,7 @@
|
|||
}
|
||||
|
||||
</style>
|
||||
{{- if (and (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark")) }}
|
||||
{{- if (and (not site.Params.disableThemeToggle) (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark")) }}
|
||||
<style>
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
|
|
|
@ -29,14 +29,6 @@
|
|||
|
||||
</script>
|
||||
{{- end }}
|
||||
{{- /* theme-toggle is disabled and theme is auto */}}
|
||||
{{- else if (and (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark"))}}
|
||||
<script>
|
||||
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
document.body.classList.add('dark');
|
||||
}
|
||||
|
||||
</script>
|
||||
{{- end }}
|
||||
|
||||
<header class="header">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue