From 9fd285f4fa73012a7974c0d56211a478225a0bd2 Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 3 Aug 2026 05:51:26 +0000 Subject: [PATCH 1/4] fix: syntax highlight on white mode Signed-off-by: lizzie --- src/webpage/style.css | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/webpage/style.css b/src/webpage/style.css index 381ccaa..4d14621 100644 --- a/src/webpage/style.css +++ b/src/webpage/style.css @@ -3386,32 +3386,32 @@ img.bigembedimg { } } ::highlight(highkeyword) { - color: yellow; + color: var(--yellow); } ::highlight(highnumber) { - color: orange; + color: color-mix(in srgb, var(--yellow) 50%, var(--red)); } ::highlight(highstring) { - color: red; + color: color-mix(in srgb, var(--red) 50%, var(--primary-text)); } ::highlight(highsymbol) { - color: white; + color: var(--primary-text-soft); font-weight: bold; } ::highlight(highcomment) { - color: green; + color: color-mix(in srgb, var(--green) 50%, var(--primary-text)); } ::highlight(highidentifier) { - color: white; + color: var(--primary-text); } ::highlight(highClass) { - color: #6741ff; + color: color-mix(in srgb, var(--red) 25%, var(--primary-text)); } ::highlight(highProp) { - color: #33dcff; + color: color-mix(in srgb, var(--blue) 50%, var(--primary-text)); } ::highlight(highFunc) { - color: #d564ff; + color: color-mix(in srgb, var(--red) 50%, var(--primary-text)); } #memberlisttoggle.svgicon { -moz-appearance: initial; From 1de56b9a1fd38251973c9e82e95935390931e301 Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 3 Aug 2026 05:53:46 +0000 Subject: [PATCH 2/4] fix yellow --- src/webpage/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webpage/style.css b/src/webpage/style.css index 4d14621..f857988 100644 --- a/src/webpage/style.css +++ b/src/webpage/style.css @@ -3386,7 +3386,7 @@ img.bigembedimg { } } ::highlight(highkeyword) { - color: var(--yellow); + color: color-mix(in srgb, var(--yellow) 75%, var(--primary-text)); } ::highlight(highnumber) { color: color-mix(in srgb, var(--yellow) 50%, var(--red)); From c3f3914931874d91352f48ec914a59072c293b1c Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 3 Aug 2026 06:35:29 +0000 Subject: [PATCH 3/4] BETTER code highlight --- src/webpage/style.css | 17 +++++++++-------- src/webpage/themes.css | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/webpage/style.css b/src/webpage/style.css index f857988..fcff672 100644 --- a/src/webpage/style.css +++ b/src/webpage/style.css @@ -3386,33 +3386,34 @@ img.bigembedimg { } } ::highlight(highkeyword) { - color: color-mix(in srgb, var(--yellow) 75%, var(--primary-text)); + color: var(--code-keyword); } ::highlight(highnumber) { - color: color-mix(in srgb, var(--yellow) 50%, var(--red)); + color: var(--code-number); } ::highlight(highstring) { - color: color-mix(in srgb, var(--red) 50%, var(--primary-text)); + color: var(--code-string); } ::highlight(highsymbol) { - color: var(--primary-text-soft); + color: var(--primary-text-prominent); font-weight: bold; } ::highlight(highcomment) { - color: color-mix(in srgb, var(--green) 50%, var(--primary-text)); + color: var(--code-comment); } ::highlight(highidentifier) { color: var(--primary-text); } ::highlight(highClass) { - color: color-mix(in srgb, var(--red) 25%, var(--primary-text)); + color: var(--code-class); } ::highlight(highProp) { - color: color-mix(in srgb, var(--blue) 50%, var(--primary-text)); + color: var(--code-prop); } ::highlight(highFunc) { - color: color-mix(in srgb, var(--red) 50%, var(--primary-text)); + color: var(--code-func); } + #memberlisttoggle.svgicon { -moz-appearance: initial; &::before { diff --git a/src/webpage/themes.css b/src/webpage/themes.css index e373477..16eb6b3 100644 --- a/src/webpage/themes.css +++ b/src/webpage/themes.css @@ -12,6 +12,14 @@ --blue: #779bff; --grey: #b5b5b5; --update: var(--green); + + --code-keyword: yellow; + --code-number: orange; + --code-string: red; + --code-comment: green; + --code-class: #6741ff; + --code-prop: #33dcff; + --code-func: #d564ff; } /* Themes. See themes.txt */ @@ -88,6 +96,15 @@ --secondary-text-soft: #4c4c5a; --dock-bg: #d1d1df; --dock-hover: #b8b8d0; + + --code-bg: #fdfdf4; + --code-keyword: rgb(180, 180, 76); + --code-number: rgb(161, 109, 12); + --code-string: rgb(153, 4, 4); + --code-comment: rgb(9, 116, 9); + --code-class: #230a86; + --code-prop: #027d96; + --code-func: #6c0091; } .Light-theme { From 8731fe7b733a4ea0186c6b65e2c2dcee8d0f325d Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 3 Aug 2026 06:38:19 +0000 Subject: [PATCH 4/4] fix small tiny issue with parser --- src/webpage/highlighter/clike/lex.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webpage/highlighter/clike/lex.ts b/src/webpage/highlighter/clike/lex.ts index 34dde2c..0de49b9 100644 --- a/src/webpage/highlighter/clike/lex.ts +++ b/src/webpage/highlighter/clike/lex.ts @@ -25,7 +25,7 @@ function regex(config: clikeConf): RegExp { `(${RegExp.escape(config.multiLine)}(?:${matchOpts.join("|")})*(?:${RegExp.escape(config.multiLine)})?)`, ); } - conds.push(`\'(\\\\(.|\\n)|[^"\\n\\\\])*\'?`); + conds.push(`\'(\\\\(.|\\n)|[^\'\\n\\\\])*\'?`); conds.push(`"(\\\\(.|\\n)|[^"\\n\\\\])*"?`); if (config.hashComments) { conds.push("#.*");