Skip to content

Commit b772394

Browse files
naufulngxson
andauthored
server : webui : Upgrade daisyui, tailwindcss. (#12735)
* Upgrade daisyui, tailwindcss. * Switch to all themes. * Revert a change. * Update formatting. * Install packages before npm build. * Revert "Install packages before npm build." This reverts commit 336c514. * Add index.html.gz * run build --------- Co-authored-by: Xuan Son Nguyen <[email protected]>
1 parent 23106f9 commit b772394

File tree

8 files changed

+575
-930
lines changed

8 files changed

+575
-930
lines changed

examples/server/public/index.html.gz

2.45 KB
Binary file not shown.

examples/server/webui/package-lock.json

Lines changed: 559 additions & 919 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/server/webui/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
"dependencies": {
1414
"@heroicons/react": "^2.2.0",
1515
"@sec-ant/readable-stream": "^0.6.0",
16+
"@tailwindcss/postcss": "^4.1.1",
17+
"@tailwindcss/vite": "^4.1.1",
1618
"@vscode/markdown-it-katex": "^1.1.1",
1719
"autoprefixer": "^10.4.20",
18-
"daisyui": "^4.12.14",
20+
"daisyui": "^5.0.12",
1921
"dexie": "^4.0.11",
2022
"highlight.js": "^11.10.0",
2123
"katex": "^0.16.15",
@@ -29,7 +31,7 @@
2931
"remark-breaks": "^4.0.0",
3032
"remark-gfm": "^4.0.0",
3133
"remark-math": "^6.0.0",
32-
"tailwindcss": "^3.4.15",
34+
"tailwindcss": "^4.1.1",
3335
"textlinestream": "^1.1.1",
3436
"vite-plugin-singlefile": "^2.0.3"
3537
},
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export default {
22
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
3+
"@tailwindcss/postcss": {},
54
},
65
}

examples/server/webui/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function AppLayout() {
2828
<>
2929
<Sidebar />
3030
<div
31-
className="drawer-content grow flex flex-col h-screen w-screen mx-auto px-4 overflow-auto"
31+
className="drawer-content grow flex flex-col h-screen w-screen mx-auto px-4 overflow-auto bg-base-100"
3232
id="main-scroll"
3333
>
3434
<Header />

examples/server/webui/src/Config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import daisyuiThemes from 'daisyui/src/theming/themes';
1+
import daisyuiThemes from 'daisyui/theme/object';
22
import { isNumeric } from './utils/misc';
33

44
export const isDev = import.meta.env.MODE === 'development';

examples/server/webui/src/components/Header.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
22
import StorageUtils from '../utils/storage';
33
import { useAppContext } from '../utils/app.context';
44
import { classNames } from '../utils/misc';
5-
import daisyuiThemes from 'daisyui/src/theming/themes';
5+
import daisyuiThemes from 'daisyui/theme/object';
66
import { THEMES } from '../Config';
77
import { useNavigate } from 'react-router';
88

@@ -20,7 +20,6 @@ export default function Header() {
2020
document.body.setAttribute('data-theme', selectedTheme);
2121
document.body.setAttribute(
2222
'data-color-scheme',
23-
// @ts-expect-error daisyuiThemes complains about index type, but it should work
2423
daisyuiThemes[selectedTheme]?.['color-scheme'] ?? 'auto'
2524
);
2625
}, [selectedTheme]);

examples/server/webui/src/index.scss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
@use 'sass:meta';
2+
@use 'tailwindcss';
23

3-
@tailwind base;
4-
@tailwind components;
5-
@tailwind utilities;
4+
@plugin 'daisyui' {
5+
themes: all;
6+
}
7+
8+
html {
9+
scrollbar-gutter: auto;
10+
}
611

712
.markdown {
813
h1,

0 commit comments

Comments
 (0)