remove hugo code in .css files.

This commit is contained in:
Junyi Hou 2024-03-13 16:38:42 +08:00
parent a29bf0d7b0
commit 8aba514632
4 changed files with 74 additions and 65 deletions

View File

@ -1,35 +1,75 @@
/* dark.css */
--font-color: #dadadb;
--bg-color: #1d1e20;
@media (prefers-color-scheme: dark) {
html {
--font-color: #dadadb;
--bg-color: #1d1e20;
--card-color: #2e2e33;
--card-border-color: #333333;
--card-color: #2e2e33;
--card-border-color: #333333;
--link-color:#599ada;
--link-state-color:#ff5858;
--link-state-border-color: rgba(238, 54, 54, 0.5);
--link-color: #599ada;
--link-state-color: #ff5858;
--link-state-border-color: rgba(238, 54, 54, 0.5);
--thead-bg-color: #343a40;
--table-border-color: lightgrey;
--thead-bg-color: #343a40;
--table-border-color: lightgrey;
--nav-bg-color: #2e2e33;
--nav-link-color: #b6b6b6;
--nav-bg-color: #2e2e33;
--nav-link-color: #b6b6b6;
--pre-color: #f8f8f2;
--pre-bg-color: rgba(175, 184, 193, 0.1);
--pre-border-color: rgba(175, 184, 193, 0.3);
--pre-color: #f8f8f2;
--pre-bg-color: rgba(175, 184, 193, 0.1);
--pre-border-color: rgba(175, 184, 193, 0.3);
--bq-color: #ccc;
--hr-color: #333;
--bq-color: #ccc;
--hr-color: #333;
--pagination-bg-color: #2e2e33;
--pagination-link-color: #b6b6b6;
--pagination-border-color: #333333;
--pagination-border-radius: 5px;
--pagination-bg-color: #2e2e33;
--pagination-link-color: #b6b6b6;
--pagination-border-color: #333333;
--pagination-border-radius: 5px;
--post-info-color: grey;
--post-info-color: grey;
--switcher-color: #fff;
--switcher-color: #fff;
--svg-color: #ccc;
--svg-state-color:#ff5858;
--svg-color: #ccc;
--svg-state-color: #ff5858;
}
}
/* Same as above. */
html[data-theme='dark'] {
--font-color: #dadadb;
--bg-color: #1d1e20;
--card-color: #2e2e33;
--card-border-color: #333333;
--link-color: #599ada;
--link-state-color: #ff5858;
--link-state-border-color: rgba(238, 54, 54, 0.5);
--thead-bg-color: #343a40;
--table-border-color: lightgrey;
--nav-bg-color: #2e2e33;
--nav-link-color: #b6b6b6;
--pre-color: #f8f8f2;
--pre-bg-color: rgba(175, 184, 193, 0.1);
--pre-border-color: rgba(175, 184, 193, 0.3);
--bq-color: #ccc;
--hr-color: #333;
--pagination-bg-color: #2e2e33;
--pagination-link-color: #b6b6b6;
--pagination-border-color: #333333;
--pagination-border-radius: 5px;
--post-info-color: grey;
--switcher-color: #fff;
--svg-color: #ccc;
--svg-state-color: #ff5858;
}

View File

@ -1,14 +1,12 @@
:root {
/* light.css */
html[data-theme='light'] {
--font-color: #1e1e1e;
--bg-color: #ffffff;
--card-color: #fafafa;
--card-border-color: #eeeeee;
--link-color:#1d60a3;
--link-state-color:rgb(163, 29, 29);
--link-color: #1d60a3;
--link-state-color: rgb(163, 29, 29);
--link-state-border-color: rgba(163, 29, 29, .5);
--thead-bg-color: lightgrey;

View File

@ -1,34 +1,3 @@
{{ $light := resources.Get "css/light.css" }}
{{ $dark := resources.Get "css/dark.css" }}
{{ $style := "light-without-switcher" }}
{{ if and (isset site.Params "style") (ne site.Params.style "") }}
{{ $style = site.Params.style | lower }}
{{ end }}
{{ if eq $style "dark-without-switcher" }}
:root {
{{ $dark.Content }}
}
{{ else }}
{{ $light.Content }}
{{ if eq $style "auto-without-switcher" }}
@media (prefers-color-scheme: dark) {
:root {
{{ $dark.Content }}
}
}
{{ else if ne $style "light-without-switcher" }}
[data-theme="dark"] {
{{ $dark.Content }}
}
{{ end }}
{{ end }}
/* Basic */
:root {
@ -207,7 +176,7 @@ pre,
kbd {
color: var(--pre-color);
background-color: var(--pre-bg-color);
font-family: monospace;
font-family: 'Courier New', 'Consolas', monospace;
font-size: 0.90em;
line-height: 154%;
border-radius: 6px;

View File

@ -45,6 +45,8 @@
{{end}}
{{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/main.css") }}
{{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/light.css") }}
{{ partial "resource.html" (dict "context" . "type" "css" "filename" "css/dark.css") }}
{{ if .Site.Params.copyCodeButton | default true }}
{{ partial "resource.html" (dict "context" . "type" "js" "filename" "js/copy-code.js") }}