Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix(ui): restore toast styling on Windows; tint toast with accent color

Akarshan Biswasdd9086542315
diff --git a/web-app/src/components/ui/sonner.tsx b/web-app/src/components/ui/sonner.tsx
index 3d96d674f..6f7ebc2ff 100644
--- a/web-app/src/components/ui/sonner.tsx
+++ b/web-app/src/components/ui/sonner.tsx
@@ -10,9 +10,13 @@ const Toaster = ({ ...props }: ToasterProps) => {
className="toaster group"
style={
{
- '--normal-bg': 'var(--popover)',
+ // Neutral toasts pick up the accent tint (Appearance > Accent color,
+ // exposed as --primary). richColors typed toasts keep their semantics.
+ '--normal-bg':
+ 'color-mix(in oklch, var(--popover) 92%, var(--primary))',
'--normal-text': 'var(--popover-foreground)',
- '--normal-border': 'var(--border)',
+ '--normal-border':
+ 'color-mix(in oklch, var(--border) 55%, var(--primary))',
} as React.CSSProperties
}
{...props}
diff --git a/web-app/src/index.css b/web-app/src/index.css
index fdc84c014..512df0523 100644
--- a/web-app/src/index.css
+++ b/web-app/src/index.css
@@ -1,6 +1,9 @@
@import 'tailwindcss';
@import 'tw-animate-css';
@import 'katex/dist/katex.min.css';
+/* Linked from 'self' so CSP keeps it: WebView2 drops sonner's runtime <style>
+ once index.html's inline <style> makes Tauri hash style-src (voids unsafe-inline). */
+@import 'sonner/dist/styles.css';
@import '@/styles/font.css';
@import '@/styles/markdown.css';
@source '../node_modules/streamdown/dist/**/*.js';