From 5c99c514767f0967181aaf91f4fa0723a3d172aa Mon Sep 17 00:00:00 2001 From: syfxlin Date: Mon, 20 Jan 2025 19:43:42 +0800 Subject: [PATCH] feat(ui): Refactor UI view and switch styles to shadcn ui. --- src/styles.less | 46 ++++++---------------------------------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/src/styles.less b/src/styles.less index c913911..6f6c700 100644 --- a/src/styles.less +++ b/src/styles.less @@ -3,42 +3,6 @@ @import (inline) "tippy.js/dist/tippy.css"; @import (inline) "tippy.js/animations/shift-away.css"; -:root { - --background: 0 0% 100%; - --foreground: 240 10% 3.9%; - --card: 0 0% 100%; - --card-foreground: 240 10% 3.9%; - --popover: 0 0% 100%; - --popover-foreground: 240 10% 3.9%; - --primary: 221.2 83.2% 53.3%; - --primary-foreground: 210 40% 98%; - --secondary: 240 4.8% 95.9%; - --secondary-foreground: 240 5.9% 10%; - --muted: 240 4.8% 95.9%; - --muted-foreground: 240 3.8% 46.1%; - --accent: 240 4.8% 95.9%; - --accent-foreground: 240 5.9% 10%; - --destructive: 0 72.22% 50.59%; - --destructive-foreground: 0 0% 98%; - --border: 240 5.9% 90%; - --input: 240 5.9% 90%; - --ring: 240 5% 64.9%; - --radius: 0.5rem; - --chart-1: 12 76% 61%; - --chart-2: 173 58% 39%; - --chart-3: 197 37% 24%; - --chart-4: 43 74% 66%; - --chart-5: 27 87% 67%; - --sidebar-background: 0 0% 98%; - --sidebar-foreground: 240 5.3% 26.1%; - --sidebar-primary: 240 5.9% 10%; - --sidebar-primary-foreground: 0 0% 98%; - --sidebar-accent: 240 4.8% 95.9%; - --sidebar-accent-foreground: 240 5.9% 10%; - --sidebar-border: 220 13% 91%; - --sidebar-ring: 240 5% 64.9% -} - :root { // font --tiptap-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", @@ -57,12 +21,14 @@ --tiptap-selected: hsla(207, 100%, 50%, 0.05); --tiptap-foreground: hsl(var(--foreground, 240 10% 3.9%)); --tiptap-background: hsl(var(--background, 0 0% 100%)); - --tiptap-primary-foreground: hsl(var(--primary-foreground, 0 0% 98%)); - --tiptap-primary-background: hsl(var(--primary, 240 5.9% 10%)); + --tiptap-primary-foreground: hsl(var(--primary-foreground, 210 40% 98%)); + --tiptap-primary-background: hsl(var(--primary, 221.2 83.2% 53.3%)); --tiptap-muted-foreground: hsl(var(--muted-foreground, 240 3.8% 46.1%)); --tiptap-muted-background: hsl(var(--muted, 240 4.8% 95.9%)); --tiptap-accent-foreground: hsl(var(--accent-foreground, 240 5.9% 10%)); --tiptap-accent-background: hsl(var(--accent, 240 4.8% 95.9%)); + --tiptap-card-foreground: hsl(var(--accent-foreground, 240 5.9% 10%)); + --tiptap-card-background: hsl(var(--accent, 240 4.8% 95.9%) / 20%); --tiptap-popover-foreground: hsl(var(--popover-foreground, 240 10% 3.9%)); --tiptap-popover-background: hsl(var(--popover, 0 0% 100%)); --tiptap-info-foreground: hsl(220, 6%, 40%); @@ -1254,7 +1220,7 @@ gap: 0.5em; border-radius: var(--tiptap-radius); border: 1px solid var(--tiptap-border); - background-color: var(--tiptap-muted-background); + background-color: var(--tiptap-card-background); // toolbar [data-type="codeBlockToolbar"] { @@ -1538,7 +1504,7 @@ &-editor { padding: 0.75em 1em; - background-color: var(--tiptap-muted-background); + background-color: var(--tiptap-card-background); border-top-left-radius: var(--tiptap-radius); border-top-right-radius: var(--tiptap-radius); border-bottom: 1px solid var(--tiptap-border);