From f7ffbf375e8c101c9b1d5b9129d4bfa5a179654a Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 25 Aug 2026 22:16:39 +0800 Subject: [PATCH 1/2] docs: update website theme styles --- website/theme/index.scss | 36 +------------------- website/theme/theme.scss | 71 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+), 35 deletions(-) create mode 100644 website/theme/theme.scss diff --git a/website/theme/index.scss b/website/theme/index.scss index 1c4cd0ed..9a0c9c56 100644 --- a/website/theme/index.scss +++ b/website/theme/index.scss @@ -1,10 +1,4 @@ -:root { - --rp-c-text-code: var(--rp-c-text-1); -} - -.dark { - --rp-c-link: var(--rp-c-brand-light); -} +@import './theme.scss'; /* Keep document content visually centered when a page has no sidebar. */ @media (min-width: 1280px) { @@ -20,31 +14,3 @@ body:has(#home-hero-title) .rp-nav { .rspress-logo { height: 1.8rem; } - -.rp-doc { - .rp-link, - .rp-link code { - color: inherit; - text-decoration-line: underline; - text-underline-offset: 2px; - text-decoration-color: rgba(0, 0, 0, 0.25); - - &:hover { - opacity: 1; - text-decoration-color: currentColor; - border-bottom: none !important; - } - } -} - -.dark { - .rp-doc { - .rp-link { - text-decoration-color: rgba(255, 255, 255, 0.5); - - &:hover { - text-decoration-color: currentColor; - } - } - } -} diff --git a/website/theme/theme.scss b/website/theme/theme.scss new file mode 100644 index 00000000..8ad9673d --- /dev/null +++ b/website/theme/theme.scss @@ -0,0 +1,71 @@ +:root { + --rp-c-brand: #f93920; + --rp-c-brand-light: #fa6552; + --rp-c-brand-lighter: #fc9183; + --rp-c-brand-dark: #f82307; + --rp-c-brand-darker: #e01f06; + --rp-c-brand-tint: rgba(249, 57, 32, 0.15); + --rp-c-text-code: var(--rp-c-text-1); +} + +.dark { + --rp-c-link: var(--rp-c-brand-light); +} + +html:not(.rp-dark) { + --rp-c-text-2: #666; +} + +.rp-sidebar-item:hover, +.rp-sidebar-item--active, +.rp-sidebar-item--active:hover { + color: var(--rp-c-text-0); + background-color: var(--rp-c-bg-mute); +} + +.dark { + .rp-sidebar-item:hover, + .rp-sidebar-item--active, + .rp-sidebar-item--active:hover { + background-color: #1f1f1f; + } +} + +.rp-toc-item__text, +.rp-toc-item__text code { + color: var(--rp-c-text-2); +} + +.rp-toc-item--active .rp-toc-item__text, +.rp-toc-item--active .rp-toc-item__text code { + color: var(--rp-c-text-0); + font-weight: 500; +} + +.rp-doc { + .rp-link, + .rp-link code { + color: inherit; + text-decoration-line: underline; + text-underline-offset: 2px; + text-decoration-color: rgba(0, 0, 0, 0.25); + + &:hover { + opacity: 1; + text-decoration-color: currentColor; + border-bottom: none !important; + } + } +} + +.dark { + .rp-doc { + .rp-link { + text-decoration-color: rgba(255, 255, 255, 0.5); + + &:hover { + text-decoration-color: currentColor; + } + } + } +} From 1d2faac54ad6cced6f60e7ce7fb1579a45f9fd4d Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 26 Aug 2026 10:08:35 +0800 Subject: [PATCH 2/2] docs: fix --- website/theme/theme.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/theme/theme.scss b/website/theme/theme.scss index 8ad9673d..2f6c9ce4 100644 --- a/website/theme/theme.scss +++ b/website/theme/theme.scss @@ -12,7 +12,7 @@ --rp-c-link: var(--rp-c-brand-light); } -html:not(.rp-dark) { +html:not(.dark) { --rp-c-text-2: #666; }