Skip to content

Commit 8cc9651

Browse files
committed
feat: upgrade Tailwind CSS and refactor UI components
- Updated Tailwind CSS to version 4.0.0 and adjusted related configurations. - Replaced the Tailwind configuration file with a PostCSS plugin integration. - Enhanced global styles with custom theme variables for better design consistency. - Refactored UI components to utilize new Tailwind styles and improve responsiveness. - Cleaned up unused styles and optimized component classes for better performance.
1 parent ea6f279 commit 8cc9651

File tree

9 files changed

+486
-429
lines changed

9 files changed

+486
-429
lines changed

packages/ui/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
"devDependencies": {
4040
"@devtools/kit": "workspace:*",
4141
"@qwikest/icons": "^0.0.13",
42+
"@tailwindcss/postcss": "^4.0.0",
43+
"@tailwindcss/vite": "^4.0.0",
4244
"@types/eslint": "8.56.10",
4345
"@types/node": "20.14.11",
4446
"@types/react": "^18.2.28",
@@ -61,7 +63,7 @@
6163
"react-dom": "18.2.0",
6264
"shiki": "^3.8.1",
6365
"superjson": "^2.2.2",
64-
"tailwindcss": "^3.4.6",
66+
"tailwindcss": "^4.0.0",
6567
"typescript": "5.4.5",
6668
"vite": "7.1.3",
6769
"vite-hot-client": "2.0.4",

packages/ui/postcss.config.cjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module.exports = {
22
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
3+
'@tailwindcss/postcss': { preflight: false },
54
},
65
};

packages/ui/src/components/Tab/Tab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const Tab = component$<TabProps>(({ state, id, title }) => {
1515
class={{
1616
'flex h-10 w-10 items-center justify-center rounded-lg p-2.5 transition-all duration-200':
1717
true,
18-
'bg-foreground/5 hover:bg-foreground/10 text-muted-foreground hover:bg-primary-hover hover:text-foreground':
18+
'bg-transparent hover:bg-foreground/5 text-muted-foreground hover:text-foreground':
1919
state.activeTab !== id,
2020
'shadow-accent/35 bg-accent text-white shadow-lg':
2121
state.activeTab === id,

packages/ui/src/features/Overview/Overview.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const Overview = component$(({ state }: OverviewProps) => {
1919
<div class="grid grid-cols-1 gap-5 md:grid-cols-3">
2020
<div
2121
onClick$={[$(() => pageJump('routes')), stopPropagation]}
22-
class="flex cursor-pointer items-center gap-5 rounded-xl border border-border bg-card-item-bg p-5 transition-all duration-200 hover:-translate-y-0.5 hover:bg-card-item-hover-bg"
22+
class="flex cursor-pointer items-center gap-5 rounded-xl border border-border bg-card-item-bg p-5 transition-all duration-200 hover:-translate-y-0.5 hover:bg-card-item-hover-bg"
2323
>
2424
<div class="bg-foreground/5 rounded-lg border border-border p-3.5">
2525
<LuFolderTree class="h-6 w-6 text-accent" />
@@ -59,7 +59,7 @@ export const Overview = component$(({ state }: OverviewProps) => {
5959

6060
<div
6161
onClick$={[$(() => pageJump('packages')), stopPropagation]}
62-
class="cursor-pointer space-y-4 rounded-xl border border-border bg-card-item-bg p-5 hover:-translate-y-0.5 hover:bg-card-item-hover-bg"
62+
class="cursor-pointer space-y-4 rounded-xl border border-border bg-card-item-bg p-5 hover:-translate-y-0.5 hover:bg-card-item-hover-bg mt-6 md:mt-6"
6363
>
6464
<h3 class="text-lg font-semibold">Installed Packages</h3>
6565
<div class="grid grid-cols-1 gap-3 md:grid-cols-2">
@@ -77,7 +77,7 @@ export const Overview = component$(({ state }: OverviewProps) => {
7777
</div>
7878
</div>
7979

80-
<div class="space-y-4 rounded-xl border border-border bg-card-item-bg p-5">
80+
<div class="space-y-4 rounded-xl border border-border bg-card-item-bg p-5 mt-6 md:mt-6">
8181
<h3 class="text-lg font-semibold">Performance</h3>
8282
<div class="space-y-3">
8383
<div class="flex justify-between border-b border-border py-2">

packages/ui/src/features/Packages/components/DependencyCard/DependencyCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const DependencyCard = component$(({ pkg }: { pkg: Package }) => {
7979
</p>
8080

8181
{/* Divider */}
82-
<div class="border-border/30 border-t" />
82+
<div class="border-border border-t" />
8383

8484
{/* Footer with author and links */}
8585
<div class="flex items-center justify-between gap-3">

packages/ui/src/global.css

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,29 @@
11
/**
2-
* Tailwind CSS imports
2+
* Tailwind CSS imports (v4)
33
* View the full documentation at https://tailwindcss.com
44
*/
5-
@tailwind base;
6-
@tailwind components;
7-
@tailwind utilities;
5+
@import "tailwindcss";
6+
7+
@custom-variant dark (&:where(:root[data-theme="dark"] &));
8+
9+
@theme {
10+
/* default (light) tokens; can be overridden by :root rules below */
11+
--color-background: #ffffff;
12+
--color-foreground: #000000;
13+
--color-primary: #10b981;
14+
--color-primary-hover: #f2f2f2;
15+
--color-primary-active: #047857;
16+
--color-secondary: #6b7280;
17+
--color-muted: #9ca3af;
18+
--color-muted-foreground: #6b7280;
19+
--color-accent: #10b981;
20+
--color-border: #e5e7eb;
21+
--color-input: #e5e7eb;
22+
--color-ring: #10b981;
23+
--color-card: #f2f2f2;
24+
--color-card-item-bg: rgba(0, 0, 0, 0.02);
25+
--color-card-item-hover-bg: rgba(0, 0, 0, 0.03);
26+
}
827

928
:root {
1029
--theme-name: 'light';
@@ -15,7 +34,7 @@
1534
--color-primary-active: #047857; /* green-700 */
1635
--color-secondary: #6b7280; /* Tailwind's secondary.light */
1736
--color-border: #e5e7eb;
18-
--color-card: #f3f4f6;
37+
--color-card: #f2f2f2;
1938

2039
/* Specific variables based on existing CSS (light theme equivalents) */
2140

@@ -33,6 +52,7 @@
3352

3453
/* Tailwind semantic variables */
3554
--color-muted: #9ca3af; /* Similar to existing --color-text-subtle */
55+
--color-muted-foreground: #6b7280;
3656
--color-accent: #10b981; /* Green accent */
3757
--color-input: var(--color-border); /* Alias to border */
3858
--color-ring: var(--color-primary); /* Alias to primary */

packages/ui/tailwind.config.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

packages/ui/vite.config.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import tsconfigPaths from 'vite-tsconfig-paths';
44
import pkg from './package.json';
55
import { qwikDevtools } from '@devtools/plugin';
66
import { createRequire } from 'module';
7+
import tailwindcss from '@tailwindcss/vite';
78
const { dependencies = {}, peerDependencies = {} } = pkg as any;
89
const makeRegex = (dep) => new RegExp(`^${dep}(/.*)?$`);
910
const excludeAll = (obj) => Object.keys(obj).map(makeRegex);
@@ -45,6 +46,6 @@ export default defineConfig(() => {
4546
],
4647
},
4748
},
48-
plugins: [qwikVite(), tsconfigPaths(), qwikDevtools()],
49+
plugins: [qwikVite(), tsconfigPaths(), qwikDevtools(), tailwindcss()],
4950
};
5051
});

0 commit comments

Comments
 (0)