Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
fix: style codeblock streamdown
Faisal Amira3c0ab25b3a5
diff --git a/web-app/src/index.css b/web-app/src/index.cssindex 490ce530d..2ae8a4475 100644--- a/web-app/src/index.css+++ b/web-app/src/index.css@@ -22,6 +22,10 @@--color-accent-fg: var(--app-accent-fg);--color-destructive: var(--app-destructive);--color-destructive-fg: var(--app-destructive-fg);++ --color-muted: var(--muted);+ --color-muted-foreground: var(--muted-foreground);+ --color-border: var(--border);/* Font scale based on --font-size-base */--text-xs: calc(var(--font-size-base) * 0.75); /* ~12px */@@ -73,6 +77,16 @@--app-accent-fg: '';--app-destructive: '';--app-destructive-fg: '';++ --muted: oklch(0.97 0 0);+ --muted-foreground: oklch(0.556 0 0);+ --border: oklch(0.922 0 0);+}++.dark {+ --muted: oklch(0.269 0 0);+ --muted-foreground: oklch(0.708 0 0);+ --border: oklch(1 0 0 / 10%);}@layer base {diff --git a/web-app/src/providers/ThemeProvider.tsx b/web-app/src/providers/ThemeProvider.tsxindex 350f8b21d..8b7e2b6be 100644--- a/web-app/src/providers/ThemeProvider.tsx+++ b/web-app/src/providers/ThemeProvider.tsx@@ -8,7 +8,16 @@ import { isPlatformTauri } from '@/lib/platform/utils'* It first detects the OS theme preference and applies it accordingly*/export function ThemeProvider() {- const { activeTheme, setIsDark, setTheme } = useTheme()+ const { activeTheme, isDark, setIsDark, setTheme } = useTheme()++ // Apply dark class to root element+ useEffect(() => {+ if (isDark) {+ document.documentElement.classList.add('dark')+ } else {+ document.documentElement.classList.remove('dark')+ }+ }, [isDark])// Detect OS theme on mount and apply ituseEffect(() => {diff --git a/web-app/src/styles/markdown.css b/web-app/src/styles/markdown.cssindex b7b3d119d..6f8914ef7 100644--- a/web-app/src/styles/markdown.css+++ b/web-app/src/styles/markdown.css@@ -1,56 +1,6 @@.markdown {@apply text-inherit;- --background: oklch(1 0 0);- --foreground: oklch(0.145 0 0);- --card: oklch(1 0 0);- --card-foreground: oklch(0.145 0 0);- --popover: oklch(1 0 0);- --popover-foreground: oklch(0.145 0 0);- --primary: oklch(0.7003 0.1611 35.09);- --primary-foreground: oklch(0.985 0 0);- --secondary: oklch(0.97 0 0);- --secondary-foreground: oklch(0.205 0 0);- /* --muted: oklch(0.97 0 0); */- --muted-foreground: oklch(0.556 0 0);- --accent: oklch(0.97 0 0);- --accent-foreground: oklch(0.205 0 0);- --destructive: oklch(0.577 0.245 27.325);- --border: oklch(0.922 0 0);- --input: oklch(0.922 0 0);- --ring: oklch(0.708 0 0);- --chart-1: oklch(0.646 0.222 41.116);- --chart-2: oklch(0.6 0.118 184.704);- --chart-3: oklch(0.398 0.07 227.392);- --chart-4: oklch(0.828 0.189 84.429);- --chart-5: oklch(0.769 0.188 70.08);-- &:is(.dark *) {- --background: oklch(0.18 0 0);- --foreground: oklch(0.985 0 0);- --card: oklch(0.205 0 0);- --card-foreground: oklch(0.985 0 0);- --popover: oklch(0.205 0 0);- --popover-foreground: oklch(0.985 0 0);- --primary: oklch(0.7003 0.1611 35.09);- --primary-foreground: oklch(0.205 0 0);- --secondary: oklch(0.269 0 0);- --secondary-foreground: oklch(0.985 0 0);- --muted: oklch(0.269 0 0);- --muted-foreground: oklch(0.708 0 0);- --accent: oklch(0.269 0 0);- --accent-foreground: oklch(0.985 0 0);- --destructive: oklch(0.704 0.191 22.216);- --border: oklch(1 0 0 / 10%);- --input: oklch(1 0 0 / 15%);- --ring: oklch(0.556 0 0);- --chart-1: oklch(0.488 0.243 264.376);- --chart-2: oklch(0.696 0.17 162.48);- --chart-3: oklch(0.769 0.188 70.08);- --chart-4: oklch(0.627 0.265 303.9);- --chart-5: oklch(0.645 0.246 16.439);- }-&.is-user {p {line-height: 1.6;@@ -174,15 +124,15 @@pre {font-family: monospace;- @apply bg-main-view-fg/6 text-main-view-fg;+ @apply bg-main-view-fg/6 text-main-view-fg px-0!;overflow-x: auto;- border-radius: 8px;+ /* border-radius: 8px; */margin-bottom: 8px;}pre code {background-color: transparent;- padding: 8px;+ padding: 2px;@apply !text-sm;display: inline-block;}