From 0581542aea33f824902e821cb185bc498253faed Mon Sep 17 00:00:00 2001 From: radishzzz Date: Fri, 9 May 2025 13:10:44 +0100 Subject: [PATCH] style: update styles for text selection and tables --- src/styles/global.css | 6 ++++++ src/styles/heti.css | 14 +++++++++++--- uno.config.ts | 1 + 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/styles/global.css b/src/styles/global.css index e2bfcd8..b5faf96 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -11,6 +11,12 @@ body { backface-visibility: hidden; -webkit-backface-visibility: hidden; } +::selection { + --at-apply: 'bg-mark'; +} +html.dark ::selection { + --at-apply: 'c-background'; +} /* View Transition with Theme Toggle >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */ ::view-transition-new(theme-transition) { diff --git a/src/styles/heti.css b/src/styles/heti.css index b8b9f3f..8a7b34d 100644 --- a/src/styles/heti.css +++ b/src/styles/heti.css @@ -145,7 +145,15 @@ html.dark .heti pre :where(span) { } .heti :where(th), .heti :where(td) { - --at-apply: 'pr-6 pb-1.5 border-b border-b-secondary/25'; + --at-apply: 'px-3 pb-1.5 border-b border-b-secondary/25'; +} +.heti :where(tr td:first-child), +.heti :where(tr th:first-child) { + --at-apply: 'pl-0'; +} +.heti :where(tr td:last-child), +.heti :where(tr th:last-child) { + --at-apply: 'pr-0'; } .heti :where(td) { --at-apply: 'pt-1.5'; @@ -218,7 +226,7 @@ html.dark .heti :where(u) { /* Highlighted Text */ .heti :where(mark) { - --at-apply: 'py-0.25 text-inherit bg-[rgba(255,235,0,0.5)]'; + --at-apply: 'py-0.25 text-inherit bg-mark'; } html.dark .heti :where(mark) { --at-apply: 'text-background'; @@ -231,7 +239,7 @@ html.dark .heti :where(mark) { } .heti sup:target, .heti sup a:target { - --at-apply: 'bg-[rgba(255,235,0,0.5)]'; + --at-apply: 'bg-mark'; } html.dark .heti sup:target, html.dark .heti sup a:target { diff --git a/uno.config.ts b/uno.config.ts index 4f81ec6..ec9af19 100644 --- a/uno.config.ts +++ b/uno.config.ts @@ -33,6 +33,7 @@ export default defineConfig({ theme: { colors: { ...light, + mark: 'oklch(0.93 0.195089 103.2532 / 0.5)', // rgba(255,235,0,0.5) note: 'oklch(48.8% 0.243 264.376 / 0.8)', // blue-700 tip: 'oklch(50.8% 0.118 165.612 / 0.8)', // emerald-700 important: 'oklch(49.6% 0.265 301.924 / 0.8)', // purple-700