the home site for me: also iteration 3 or 4 of my site

feat: remove light mode

dunkirk.sh bf642655 7a203f6e

verified
Changed files
+98 -523
sass
static
templates
-1
sass/css/main.scss
···
@use "mods";
@use "copy-button";
-
@use "theme-toggle";
@use "view-transitions";
+2 -1
sass/css/mods.css
···
:root {
--nightshade-violet: oklch(0.27 0.0242 287.67);
--purple-night: oklch(27.58% 0.0203 289.13);
-
--dark-crushed-grape: oklch(74.02% 0.0756 311.96);
+
--red-crushed-grape: oklch(0.656 0.1189 296.74);
+
--dark-crushed-grape: oklch(0.6261 0.1289 284.99);
--light-crushed-grape: oklch(73.48% 0.1008 284.99);
--reseda-green: oklch(62.33% 0.0475 126.94);
--earth-yellow: oklch(86.49% 0.018 73.05);
+8 -88
sass/css/suCSS.css
···
--standard-border-radius: 5px;
/* default colors */
-
--bg: var(--earth-yellow);
-
--noise-strength: 0.3;
-
--bg-light: #cbcdcd;
-
--text: #41474e;
-
--text-light: #686764;
-
--text-dark: #20252b;
-
--accent: oklch(35.55% 0.0754 60.09);
-
--accent-dark: #56412bc5;
-
--accent-text: #dfd1bc;
-
--border: #646868;
-
--link: var(--accent);
-
--selection: color-mix(in oklab, var(--accent), var(--earth-yellow) 50%);
-
}
-
-
/* theme media queries */
-
@media (prefers-color-scheme: dark) {
-
:root,
-
::backdrop {
-
color-scheme: dark;
-
--bg: var(--purple-night);
-
--noise-strength: 0.15;
-
--bg-light: var(--ultra-violet);
-
--text: var(--lavendar-breeze);
-
--text-light: var(--pink-puree);
-
--text-dark: oklch(80.28% 0.0111 204.11);
-
--accent: var(--rose-quartz);
-
--accent-dark: var(--dark-crushed-grape);
-
--accent-text: var(--purple-gray);
-
--link: var(--light-crushed-grape);
-
--border: var(--pink-puree);
-
--selection: color-mix(
-
in oklab,
-
var(--accent),
-
var(--purple-night) 50%
-
);
-
}
-
}
-
-
[data-theme="dark"] {
color-scheme: dark;
--bg: var(--purple-night);
--noise-strength: 0.15;
···
--accent-dark: var(--dark-crushed-grape);
--accent-text: var(--purple-gray);
--link: var(--light-crushed-grape);
+
--link-visited: var(--red-crushed-grape);
--border: var(--pink-puree);
--selection: color-mix(in oklab, var(--accent), var(--purple-night) 50%);
}
-
@media (prefers-color-scheme: light) {
-
:root,
-
::backdrop {
-
color-scheme: light;
-
--bg: var(--earth-yellow);
-
--noise-strength: 0.15;
-
--bg-light: #cbcdcd;
-
--text: #41474e;
-
--text-light: #686764;
-
--accent: #58310ac5;
-
--accent-dark: #e08f67;
-
--accent-text: #dfd1bc;
-
--border: #646868;
-
--link: var(--accent);
-
--selection: color-mix(
-
in oklab,
-
var(--accent),
-
var(--earth-yellow) 50%
-
);
-
}
-
}
-
-
[data-theme="light"] {
-
/* default (light) theme */
-
color-scheme: light;
-
--bg: var(--earth-yellow);
-
--noise-strength: 0.22;
-
--bg-light: var(--reseda-green);
-
--text: #41474e;
-
--text-light: #686764;
-
--text-dark: #20252b;
-
--accent: #58310ac5;
-
--accent-dark: #56412bc5;
-
--accent-text: #dfd1bc;
-
--border: #646868;
-
--link: var(--accent);
-
--selection: color-mix(in oklab, var(--accent), var(--earth-yellow) 50%);
-
}
-
::selection,
::-moz-selection {
color: var(--bg);
···
h6 {
margin: 0.5em 0 0.5em 0;
padding: 0.22em 0.4em 0.22em 0.4em;
-
border-radius: 0.1em;
background-color: var(--accent);
border-bottom: 5px solid var(--bg-light);
-
border-radius: 7px 7px 10px 10px;
+
border-radius: 0.2em 0.2em 0.27em 0.27em;
color: var(--accent-text);
width: fit-content;
}
···
}
/* format links */
-
a,
-
a:visited {
-
text-decoration: none;
+
a {
font-weight: bold;
border-radius: 0.125rem;
-
color: var(--accent-dark);
+
color: var(--link);
+
text-decoration: underline double;
}
-
a {
-
color: var(--link);
+
a:visited {
+
color: var(--link-visited);
}
a:hover {
-
text-decoration: underline wavy;
+
color: var(--accent-dark);
}
/* format lists */
···
input[type="radio"] {
vertical-align: middle;
position: relative;
-
width: min-content;
width: 14px;
height: 14px;
}
+87 -366
sass/css/syntax-theme.css
···
* theme "Catppuccin" generated by syntect
*/
-
html[data-theme="light"] .z-code {
-
color: #4c4f69;
-
background-color: var(--sunset);
-
}
-
-
html[data-theme="light"] .z-comment {
-
color: #9ca0b0;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-string {
-
color: #40a02b;
-
}
-
html[data-theme="light"] .z-string.z-regexp {
-
color: #fe640b;
-
}
-
html[data-theme="light"] .z-constant.z-numeric {
-
color: #fe640b;
-
}
-
html[data-theme="light"] .z-constant.z-language.z-boolean {
-
color: #fe640b;
-
font-weight: bold;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-constant.z-language {
-
color: #7287fd;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-support.z-function.z-builtin {
-
color: #fe640b;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-variable.z-other.z-constant {
-
color: #fe640b;
-
}
-
html[data-theme="light"] .z-keyword {
-
color: #d20f39;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-keyword.z-control.z-loop,
-
html[data-theme="light"] .z-keyword.z-control.z-conditional,
-
html[data-theme="light"] .z-keyword.z-control.z-c\+\+ {
-
color: #8839ef;
-
font-weight: bold;
-
}
-
html[data-theme="light"] .z-keyword.z-control.z-return,
-
html[data-theme="light"] .z-keyword.z-control.z-flow.z-return {
-
color: #ea76cb;
-
font-weight: bold;
-
}
-
html[data-theme="light"] .z-support.z-type.z-exception {
-
color: #fe640b;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-keyword.z-operator,
-
html[data-theme="light"] .z-punctuation.z-accessor {
-
color: #04a5e5;
-
font-weight: bold;
-
}
-
html[data-theme="light"] .z-punctuation.z-separator {
-
color: #179299;
-
}
-
html[data-theme="light"] .z-punctuation.z-terminator {
-
color: #179299;
-
}
-
html[data-theme="light"] .z-punctuation.z-section {
-
color: #7c7f93;
-
}
-
html[data-theme="light"] .z-keyword.z-control.z-import.z-include {
-
color: #179299;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-storage {
-
color: #d20f39;
-
}
-
html[data-theme="light"] .z-storage.z-type {
-
color: #df8e1d;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-storage.z-modifier {
-
color: #d20f39;
-
}
-
html[data-theme="light"] .z-entity.z-name.z-namespace,
-
html[data-theme="light"] .z-meta.z-path {
-
color: #dc8a78;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-storage.z-type.z-class {
-
color: #dc8a78;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-entity.z-name.z-label {
-
color: #1e66f5;
-
}
-
html[data-theme="light"] .z-keyword.z-declaration.z-class {
-
color: #d20f39;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-entity.z-name.z-class,
-
html[data-theme="light"] .z-meta.z-toc-list.z-full-identifier {
-
color: #04a5e5;
-
}
-
html[data-theme="light"] .z-entity.z-other.z-inherited-class {
-
color: #04a5e5;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-entity.z-name.z-function,
-
html[data-theme="light"] .z-variable.z-function {
-
color: #1e66f5;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-entity.z-name.z-function.z-preprocessor {
-
color: #d20f39;
-
}
-
html[data-theme="light"] .z-keyword.z-control.z-import {
-
color: #d20f39;
-
}
-
html[data-theme="light"] .z-entity.z-name.z-function.z-constructor,
-
html[data-theme="light"] .z-entity.z-name.z-function.z-destructor {
-
color: #7287fd;
-
}
-
html[data-theme="light"] .z-variable.z-parameter.z-function {
-
color: #dc8a78;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-keyword.z-declaration.z-function {
-
color: #e64553;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-support.z-function {
-
color: #04a5e5;
-
}
-
html[data-theme="light"] .z-support.z-constant {
-
color: #1e66f5;
-
}
-
html[data-theme="light"] .z-support.z-type,
-
html[data-theme="light"] .z-support.z-class {
-
color: #1e66f5;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-variable.z-function {
-
color: #1e66f5;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-variable.z-parameter {
-
color: #dc8a78;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-variable.z-other {
-
color: #4c4f69;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-variable.z-other.z-member {
-
color: #dc8a78;
-
}
-
html[data-theme="light"] .z-variable.z-language {
-
color: #179299;
-
}
-
html[data-theme="light"] .z-entity.z-name.z-tag {
-
color: #fe640b;
-
}
-
html[data-theme="light"] .z-entity.z-other.z-attribute-name {
-
color: #8839ef;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-punctuation.z-definition.z-tag {
-
color: #e64553;
-
}
-
html[data-theme="light"] .z-markup.z-underline.z-link.z-markdown {
-
color: #dc8a78;
-
text-decoration: underline;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-meta.z-link.z-inline.z-description {
-
color: #7287fd;
-
font-weight: bold;
-
}
-
html[data-theme="light"] .z-comment.z-block.z-markdown,
-
html[data-theme="light"] .z-meta.z-code-fence,
-
html[data-theme="light"] .z-markup.z-raw.z-code-fence,
-
html[data-theme="light"] .z-markup.z-raw.z-inline {
-
color: #179299;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-punctuation.z-definition.z-heading,
-
html[data-theme="light"] .z-entity.z-name.z-section {
-
color: #1e66f5;
-
font-weight: bold;
-
}
-
html[data-theme="light"] .z-markup.z-italic {
-
color: #e64553;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-markup.z-bold {
-
color: #e64553;
-
font-weight: bold;
-
}
-
html[data-theme="light"] .z-constant.z-character.z-escape {
-
color: #ea76cb;
-
}
-
html[data-theme="light"]
-
.z-source.z-shell.z-bash
-
.z-meta.z-function.z-shell
-
.z-meta.z-compound.z-shell
-
.z-meta.z-function-call.z-identifier.z-shell {
-
color: #ea76cb;
-
}
-
html[data-theme="light"] .z-variable.z-language.z-shell {
-
color: #d20f39;
-
font-style: italic;
-
}
-
html[data-theme="light"]
-
.z-source.z-lua
-
.z-meta.z-function.z-lua
-
.z-meta.z-block.z-lua
-
.z-meta.z-mapping.z-value.z-lua
-
.z-meta.z-mapping.z-key.z-lua
-
.z-string.z-unquoted.z-key.z-lua {
-
color: #7287fd;
-
font-style: italic;
-
}
-
html[data-theme="light"]
-
.z-source.z-lua
-
.z-meta.z-function.z-lua
-
.z-meta.z-block.z-lua
-
.z-meta.z-mapping.z-key.z-lua
-
.z-string.z-unquoted.z-key.z-lua {
-
color: #dd7878;
-
}
-
html[data-theme="light"] .z-entity.z-name.z-constant.z-java {
-
color: #179299;
-
}
-
html[data-theme="light"] .z-support.z-type.z-property-name.z-css {
-
color: #dd7878;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-support.z-constant.z-property-value.z-css {
-
color: #4c4f69;
-
}
-
html[data-theme="light"] .z-constant.z-numeric.z-suffix.z-css,
-
html[data-theme="light"] .z-keyword.z-other.z-unit.z-css {
-
color: #179299;
-
font-style: italic;
-
}
-
html[data-theme="light"] .z-variable.z-other.z-custom-property.z-name.z-css,
-
html[data-theme="light"] .z-support.z-type.z-custom-property.z-name.z-css,
-
html[data-theme="light"] .z-punctuation.z-definition.z-custom-property.z-css {
-
color: #179299;
-
}
-
html[data-theme="light"] .z-entity.z-name.z-tag.z-css {
-
color: #7287fd;
-
}
-
html[data-theme="light"] .z-variable.z-other.z-sass {
-
color: #179299;
-
}
-
html[data-theme="light"] .z-invalid {
-
color: #4c4f69;
-
background-color: #d20f39;
-
}
-
html[data-theme="light"] .z-invalid.z-deprecated {
-
color: #4c4f69;
-
background-color: #8839ef;
-
}
-
html[data-theme="light"] .z-meta.z-diff,
-
html[data-theme="light"] .z-meta.z-diff.z-header {
-
color: #9ca0b0;
-
}
-
html[data-theme="light"] .z-markup.z-deleted {
-
color: #d20f39;
-
}
-
html[data-theme="light"] .z-markup.z-inserted {
-
color: #40a02b;
-
}
-
html[data-theme="light"] .z-markup.z-changed {
-
color: #df8e1d;
-
}
-
html[data-theme="light"] .z-message.z-error {
-
color: #d20f39;
-
}
-
/* dark */
-
html[data-theme="dark"] .z-code {
+
.z-code {
color: #cad3f5;
background-color: var(--nightshade-violet);
}
-
html[data-theme="dark"] .z-comment {
+
.z-comment {
color: #6e738d;
font-style: italic;
}
-
html[data-theme="dark"] .z-string {
+
.z-string {
color: #a6da95;
}
-
html[data-theme="dark"] .z-string.z-regexp {
+
.z-string.z-regexp {
color: #f5a97f;
}
-
html[data-theme="dark"] .z-constant.z-numeric {
+
.z-constant.z-numeric {
color: #f5a97f;
}
-
html[data-theme="dark"] .z-constant.z-language.z-boolean {
+
.z-constant.z-language.z-boolean {
color: #f5a97f;
font-weight: bold;
font-style: italic;
}
-
html[data-theme="dark"] .z-constant.z-language {
+
.z-constant.z-language {
color: #b7bdf8;
font-style: italic;
}
-
html[data-theme="dark"] .z-support.z-function.z-builtin {
+
.z-support.z-function.z-builtin {
color: #f5a97f;
font-style: italic;
}
-
html[data-theme="dark"] .z-variable.z-other.z-constant {
+
.z-variable.z-other.z-constant {
color: #f5a97f;
}
-
html[data-theme="dark"] .z-keyword {
+
.z-keyword {
color: #ed8796;
font-style: italic;
}
-
html[data-theme="dark"] .z-keyword.z-control.z-loop,
-
html[data-theme="dark"] .z-keyword.z-control.z-conditional,
-
html[data-theme="dark"] .z-keyword.z-control.z-c\+\+ {
+
.z-keyword.z-control.z-loop,
+
.z-keyword.z-control.z-conditional,
+
.z-keyword.z-control.z-c\+\+ {
color: #c6a0f6;
font-weight: bold;
}
-
html[data-theme="dark"] .z-keyword.z-control.z-return,
-
html[data-theme="dark"] .z-keyword.z-control.z-flow.z-return {
+
.z-keyword.z-control.z-return,
+
.z-keyword.z-control.z-flow.z-return {
color: #f5bde6;
font-weight: bold;
}
-
html[data-theme="dark"] .z-support.z-type.z-exception {
+
.z-support.z-type.z-exception {
color: #f5a97f;
font-style: italic;
}
-
html[data-theme="dark"] .z-keyword.z-operator,
-
html[data-theme="dark"] .z-punctuation.z-accessor {
+
.z-keyword.z-operator,
+
.z-punctuation.z-accessor {
color: #91d7e3;
font-weight: bold;
}
-
html[data-theme="dark"] .z-punctuation.z-separator {
+
.z-punctuation.z-separator {
color: #8bd5ca;
}
-
html[data-theme="dark"] .z-punctuation.z-terminator {
+
.z-punctuation.z-terminator {
color: #8bd5ca;
}
-
html[data-theme="dark"] .z-punctuation.z-section {
+
.z-punctuation.z-section {
color: #939ab7;
}
-
html[data-theme="dark"] .z-keyword.z-control.z-import.z-include {
+
.z-keyword.z-control.z-import.z-include {
color: #8bd5ca;
font-style: italic;
}
-
html[data-theme="dark"] .z-storage {
+
.z-storage {
color: #ed8796;
}
-
html[data-theme="dark"] .z-storage.z-type {
+
.z-storage.z-type {
color: #eed49f;
font-style: italic;
}
-
html[data-theme="dark"] .z-storage.z-modifier {
+
.z-storage.z-modifier {
color: #ed8796;
}
-
html[data-theme="dark"] .z-entity.z-name.z-namespace,
-
html[data-theme="dark"] .z-meta.z-path {
+
.z-entity.z-name.z-namespace,
+
.z-meta.z-path {
color: #f4dbd6;
font-style: italic;
}
-
html[data-theme="dark"] .z-storage.z-type.z-class {
+
.z-storage.z-type.z-class {
color: #f4dbd6;
font-style: italic;
}
-
html[data-theme="dark"] .z-entity.z-name.z-label {
+
.z-entity.z-name.z-label {
color: #8aadf4;
}
-
html[data-theme="dark"] .z-keyword.z-declaration.z-class {
+
.z-keyword.z-declaration.z-class {
color: #ed8796;
font-style: italic;
}
-
html[data-theme="dark"] .z-entity.z-name.z-class,
-
html[data-theme="dark"] .z-meta.z-toc-list.z-full-identifier {
+
.z-entity.z-name.z-class,
+
.z-meta.z-toc-list.z-full-identifier {
color: #91d7e3;
}
-
html[data-theme="dark"] .z-entity.z-other.z-inherited-class {
+
.z-entity.z-other.z-inherited-class {
color: #91d7e3;
font-style: italic;
}
-
html[data-theme="dark"] .z-entity.z-name.z-function,
-
html[data-theme="dark"] .z-variable.z-function {
+
.z-entity.z-name.z-function,
+
.z-variable.z-function {
color: #8aadf4;
font-style: italic;
}
-
html[data-theme="dark"] .z-entity.z-name.z-function.z-preprocessor {
+
.z-entity.z-name.z-function.z-preprocessor {
color: #ed8796;
}
-
html[data-theme="dark"] .z-keyword.z-control.z-import {
+
.z-keyword.z-control.z-import {
color: #ed8796;
}
-
html[data-theme="dark"] .z-entity.z-name.z-function.z-constructor,
-
html[data-theme="dark"] .z-entity.z-name.z-function.z-destructor {
+
.z-entity.z-name.z-function.z-constructor,
+
.z-entity.z-name.z-function.z-destructor {
color: #b7bdf8;
}
-
html[data-theme="dark"] .z-variable.z-parameter.z-function {
+
.z-variable.z-parameter.z-function {
color: #f4dbd6;
font-style: italic;
}
-
html[data-theme="dark"] .z-keyword.z-declaration.z-function {
+
.z-keyword.z-declaration.z-function {
color: #ee99a0;
font-style: italic;
}
-
html[data-theme="dark"] .z-support.z-function {
+
.z-support.z-function {
color: #91d7e3;
}
-
html[data-theme="dark"] .z-support.z-constant {
+
.z-support.z-constant {
color: #8aadf4;
}
-
html[data-theme="dark"] .z-support.z-type,
-
html[data-theme="dark"] .z-support.z-class {
+
.z-support.z-type,
+
.z-support.z-class {
color: #8aadf4;
font-style: italic;
}
-
html[data-theme="dark"] .z-variable.z-function {
+
.z-variable.z-function {
color: #8aadf4;
font-style: italic;
}
-
html[data-theme="dark"] .z-variable.z-parameter {
+
.z-variable.z-parameter {
color: #f4dbd6;
font-style: italic;
}
-
html[data-theme="dark"] .z-variable.z-other {
+
.z-variable.z-other {
color: #cad3f5;
font-style: italic;
}
-
html[data-theme="dark"] .z-variable.z-other.z-member {
+
.z-variable.z-other.z-member {
color: #f4dbd6;
}
-
html[data-theme="dark"] .z-variable.z-language {
+
.z-variable.z-language {
color: #8bd5ca;
}
-
html[data-theme="dark"] .z-entity.z-name.z-tag {
+
.z-entity.z-name.z-tag {
color: #f5a97f;
}
-
html[data-theme="dark"] .z-entity.z-other.z-attribute-name {
+
.z-entity.z-other.z-attribute-name {
color: #c6a0f6;
font-style: italic;
}
-
html[data-theme="dark"] .z-punctuation.z-definition.z-tag {
+
.z-punctuation.z-definition.z-tag {
color: #ee99a0;
}
-
html[data-theme="dark"] .z-markup.z-underline.z-link.z-markdown {
+
.z-markup.z-underline.z-link.z-markdown {
color: #f4dbd6;
text-decoration: underline;
font-style: italic;
}
-
html[data-theme="dark"] .z-meta.z-link.z-inline.z-description {
+
.z-meta.z-link.z-inline.z-description {
color: #b7bdf8;
font-weight: bold;
}
-
html[data-theme="dark"] .z-comment.z-block.z-markdown,
-
html[data-theme="dark"] .z-meta.z-code-fence,
-
html[data-theme="dark"] .z-markup.z-raw.z-code-fence,
-
html[data-theme="dark"] .z-markup.z-raw.z-inline {
+
.z-comment.z-block.z-markdown,
+
.z-meta.z-code-fence,
+
.z-markup.z-raw.z-code-fence,
+
.z-markup.z-raw.z-inline {
color: #8bd5ca;
font-style: italic;
}
-
html[data-theme="dark"] .z-punctuation.z-definition.z-heading,
-
html[data-theme="dark"] .z-entity.z-name.z-section {
+
.z-punctuation.z-definition.z-heading,
+
.z-entity.z-name.z-section {
color: #8aadf4;
font-weight: bold;
}
-
html[data-theme="dark"] .z-markup.z-italic {
+
.z-markup.z-italic {
color: #ee99a0;
font-style: italic;
}
-
html[data-theme="dark"] .z-markup.z-bold {
+
.z-markup.z-bold {
color: #ee99a0;
font-weight: bold;
}
-
html[data-theme="dark"] .z-constant.z-character.z-escape {
+
.z-constant.z-character.z-escape {
color: #f5bde6;
}
html[data-theme="dark"]
···
.z-meta.z-function-call.z-identifier.z-shell {
color: #f5bde6;
}
-
html[data-theme="dark"] .z-variable.z-language.z-shell {
+
.z-variable.z-language.z-shell {
color: #ed8796;
font-style: italic;
}
-
html[data-theme="dark"]
-
.z-source.z-lua
+
+
.z-source.z-lua
.z-meta.z-function.z-lua
.z-meta.z-block.z-lua
.z-meta.z-mapping.z-value.z-lua
···
color: #b7bdf8;
font-style: italic;
}
-
html[data-theme="dark"]
-
.z-source.z-lua
+
+
.z-source.z-lua
.z-meta.z-function.z-lua
.z-meta.z-block.z-lua
.z-meta.z-mapping.z-key.z-lua
.z-string.z-unquoted.z-key.z-lua {
color: #f0c6c6;
}
-
html[data-theme="dark"] .z-entity.z-name.z-constant.z-java {
+
.z-entity.z-name.z-constant.z-java {
color: #8bd5ca;
}
-
html[data-theme="dark"] .z-support.z-type.z-property-name.z-css {
+
.z-support.z-type.z-property-name.z-css {
color: #f0c6c6;
font-style: italic;
}
-
html[data-theme="dark"] .z-support.z-constant.z-property-value.z-css {
+
.z-support.z-constant.z-property-value.z-css {
color: #cad3f5;
}
-
html[data-theme="dark"] .z-constant.z-numeric.z-suffix.z-css,
-
html[data-theme="dark"] .z-keyword.z-other.z-unit.z-css {
+
.z-constant.z-numeric.z-suffix.z-css,
+
.z-keyword.z-other.z-unit.z-css {
color: #8bd5ca;
font-style: italic;
}
-
html[data-theme="dark"] .z-variable.z-other.z-custom-property.z-name.z-css,
-
html[data-theme="dark"] .z-support.z-type.z-custom-property.z-name.z-css,
-
html[data-theme="dark"] .z-punctuation.z-definition.z-custom-property.z-css {
+
.z-variable.z-other.z-custom-property.z-name.z-css,
+
.z-support.z-type.z-custom-property.z-name.z-css,
+
.z-punctuation.z-definition.z-custom-property.z-css {
color: #8bd5ca;
}
-
html[data-theme="dark"] .z-entity.z-name.z-tag.z-css {
+
.z-entity.z-name.z-tag.z-css {
color: #b7bdf8;
}
-
html[data-theme="dark"] .z-variable.z-other.z-sass {
+
.z-variable.z-other.z-sass {
color: #8bd5ca;
}
-
html[data-theme="dark"] .z-invalid {
+
.z-invalid {
color: #cad3f5;
background-color: #ed8796;
}
-
html[data-theme="dark"] .z-invalid.z-deprecated {
+
.z-invalid.z-deprecated {
color: #cad3f5;
background-color: #c6a0f6;
}
-
html[data-theme="dark"] .z-meta.z-diff,
-
html[data-theme="dark"] .z-meta.z-diff.z-header {
+
.z-meta.z-diff,
+
.z-meta.z-diff.z-header {
color: #6e738d;
}
-
html[data-theme="dark"] .z-markup.z-deleted {
+
.z-markup.z-deleted {
color: #ed8796;
}
-
html[data-theme="dark"] .z-markup.z-inserted {
+
.z-markup.z-inserted {
color: #a6da95;
}
-
html[data-theme="dark"] .z-markup.z-changed {
+
.z-markup.z-changed {
color: #eed49f;
}
-
html[data-theme="dark"] .z-message.z-error {
+
.z-message.z-error {
color: #ed8796;
}
-49
static/js/theme-toggle.js
···
-
const toggleButton = document.getElementById("theme-toggle");
-
const themeIcon = document
-
.getElementById("theme-toggle-label")
-
.querySelector("i");
-
const themeSound = document.getElementById("theme-sound");
-
-
// Function to update the theme icon based on the current theme
-
const updateThemeIcon = (isDarkMode) => {
-
themeIcon.style.setProperty(
-
"--icon-toggle",
-
isDarkMode ? "var(--icon-dark)" : "var(--icon-light)",
-
);
-
};
-
-
// Function to update the theme based on the current mode
-
const updateTheme = (isDarkMode) => {
-
const theme = isDarkMode ? "dark" : "light";
-
document.documentElement.setAttribute("data-theme", theme);
-
updateThemeIcon(isDarkMode);
-
};
-
-
// Function to toggle the theme
-
const toggleTheme = () => {
-
const isDarkMode = toggleButton.checked;
-
updateTheme(isDarkMode);
-
themeSound.currentTime = 0;
-
themeSound.play();
-
localStorage.setItem("theme", isDarkMode ? "dark" : "light");
-
};
-
-
// Event listener for theme toggle
-
toggleButton.addEventListener("change", toggleTheme);
-
-
// Function to initialize the theme based on the stored preference
-
const initializeTheme = () => {
-
const storedTheme = localStorage.getItem("theme");
-
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
-
const isDarkMode = storedTheme === "dark" || (!storedTheme && prefersDark);
-
toggleButton.checked = isDarkMode;
-
updateTheme(isDarkMode);
-
};
-
-
// Initialize the theme
-
initializeTheme();
-
-
// Listen for changes in system preference
-
window
-
.matchMedia("(prefers-color-scheme: dark)")
-
.addEventListener("change", initializeTheme);
+1 -6
templates/head.html
···
type="text/css"
href="{{ get_url(path='css/main.css?' ~ cssHash, trailing_slash=false) | safe }}"
/>
-
{% endblock css %} {% set jsHash = get_hash(path="js/theme-toggle.js", sha_type=256,
-
base64=true) %}
-
<script
-
src="{{ get_url(path='js/theme-toggle.js?' ~ jsHash, trailing_slash=false) | safe }}"
-
defer
-
></script>
+
{% endblock css %}
{% set jsHash = get_hash(path="js/copy-button.js", sha_type=256,
base64=true) %}
-12
templates/header.html
···
{{ nav_item.name }}
</a>
{% endfor %}
-
<div>
-
<input type="checkbox" id="theme-toggle" style="display: none" />
-
<label for="theme-toggle" id="theme-toggle-label"
-
><i class="icon"></i
-
></label>
-
<audio id="theme-sound">
-
<source
-
src="{{ get_url(path='click.ogg', trailing_slash=false) | safe }}"
-
type="audio/ogg"
-
/>
-
</audio>
-
</div>
</nav>
{% endif %}