From c61d8f1506d2f0e56d783c8bc02ef9ace66ef353 Mon Sep 17 00:00:00 2001 From: lutinglt Date: Thu, 3 Jul 2025 18:23:22 +0800 Subject: [PATCH] =?UTF-8?q?emoji=20=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/theme.ts | 33 +++++++++++++++++++++++++++++++-- styles/public/emoji.scss | 23 ----------------------- styles/public/fontcolor.scss | 11 ----------- 3 files changed, 31 insertions(+), 36 deletions(-) delete mode 100644 styles/public/emoji.scss delete mode 100644 styles/public/fontcolor.scss diff --git a/src/core/theme.ts b/src/core/theme.ts index ed53543..0684d83 100644 --- a/src/core/theme.ts +++ b/src/core/theme.ts @@ -13,12 +13,41 @@ function stringToBoolean(str: string, name: string): boolean { } } +const dark_emoji = ` +.emoji[aria-label="check mark"], +.emoji[aria-label="currency exchange"], +.emoji[aria-label="TOP arrow"], +.emoji[aria-label="END arrow"], +.emoji[aria-label="ON! arrow"], +.emoji[aria-label="SOON arrow"], +.emoji[aria-label="heavy dollar sign"], +.emoji[aria-label="copyright"], +.emoji[aria-label="registered"], +.emoji[aria-label="trade mark"], +.emoji[aria-label="multiply"], +.emoji[aria-label="plus"], +.emoji[aria-label="minus"], +.emoji[aria-label="divide"], +.emoji[aria-label="curly loop"], +.emoji[aria-label="double curly loop"], +.emoji[aria-label="wavy dash"], +.emoji[aria-label="paw prints"], +.emoji[aria-label="musical note"], +.emoji[aria-label="musical notes"] +`; + export function createTheme(theme: Theme): void { + const isDarkTheme = stringToBoolean(theme.isDarkTheme, "isDarkTheme"); + if (isDarkTheme) { + globalStyle(`${dark_emoji}`, { + filter: "invert(100%) hue-rotate(180deg)", + }); + } createGlobalTheme(":root", themeVars, theme); createGlobalTheme(":root", otherThemeVars, { git: "#f05133", light: { - mimicEnabled: theme.isDarkTheme + mimicEnabled: isDarkTheme ? "rgba(0, 0, 0, calc(40 / 255 * 222 / 255 / var(--opacity-disabled)))" : "rgba(0, 0, 0, calc(6 / 255 * 222 / 255 / var(--opacity-disabled)))", }, @@ -28,6 +57,6 @@ export function createTheme(theme: Theme): void { }); globalStyle(":root", { accentColor: themeVars.color.accent, - colorScheme: stringToBoolean(theme.isDarkTheme, "isDarkTheme") ? "dark" : "light", + colorScheme: isDarkTheme ? "dark" : "light", }); } diff --git a/styles/public/emoji.scss b/styles/public/emoji.scss deleted file mode 100644 index e054406..0000000 --- a/styles/public/emoji.scss +++ /dev/null @@ -1,23 +0,0 @@ -// Made by Luting ^-^ -.emoji[aria-label="check\\ mark"], -.emoji[aria-label="currency\\ exchange"], -.emoji[aria-label="TOP\\ arrow"], -.emoji[aria-label="END\\ arrow"], -.emoji[aria-label="ON! arrow"], -.emoji[aria-label="SOON\\ arrow"], -.emoji[aria-label="heavy dollar sign"], -.emoji[aria-label="copyright"], -.emoji[aria-label="registered"], -.emoji[aria-label="trade\\ mark"], -.emoji[aria-label="multiply"], -.emoji[aria-label="plus"], -.emoji[aria-label="minus"], -.emoji[aria-label="divide"], -.emoji[aria-label="curly\\ loop"], -.emoji[aria-label="double curly loop"], -.emoji[aria-label="wavy\\ dash"], -.emoji[aria-label="paw\\ prints"], -.emoji[aria-label="musical\\ note"], -.emoji[aria-label="musical\\ notes"] { - filter: invert(100%) hue-rotate(180deg); -} diff --git a/styles/public/fontcolor.scss b/styles/public/fontcolor.scss deleted file mode 100644 index af90a88..0000000 --- a/styles/public/fontcolor.scss +++ /dev/null @@ -1,11 +0,0 @@ -// Made by Luting ^-^ -.lines-num span:after { - color: var(--color-text); -} - -.ui.cards > .card, -.ui.card { - > .extra a:not(.ui):hover { - color: var(--color-blue); - } -}