Skip to content

Commit 272d95d

Browse files
refactor: update Tailwind CSS configuration and styles
- Replaced autoprefixer with @tailwindcss/postcss in package.json and postcss.config.js. - Upgraded Tailwind CSS to version 4.1.5. - Updated various class names in components to align with new Tailwind CSS utility classes. - Removed tailwind.config.js and migrated theme colors and styles to index.css. - Adjusted input and button styles across components for consistency with new utility classes.
1 parent 70eb6f1 commit 272d95d

File tree

11 files changed

+946
-1948
lines changed

11 files changed

+946
-1948
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"dependencies": {
66
"@headlessui/react": "^2.2.2",
77
"@heroicons/react": "^2.2.0",
8-
"autoprefixer": "^10.4.7",
8+
"@tailwindcss/postcss": "^4.1.5",
99
"framer-motion": "^12.10.4",
1010
"postcss": "^8.4.31",
1111
"react": "^19.1.0",
1212
"react-dom": "^19.1.0",
13-
"tailwindcss": "^3.1.8",
13+
"tailwindcss": "^4.1.5",
1414
"web-vitals": "^5.0.0"
1515
},
1616
"overrides": {

postcss.config.js

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': {},
54
},
65
}

src/App.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function App() {
1616
<TaskProvider>
1717
<TagProvider>
1818
<ListProvider>
19-
<div className="App min-h-screen bg-gradient-to-br from-primary-50 to-secondary-50 flex flex-col items-center py-12 px-4" data-testid="app">
19+
<div className="App min-h-screen bg-linear-to-br from-primary-50 to-secondary-50 flex flex-col items-center py-12 px-4" data-testid="app">
2020
<div className="w-full max-w-6xl">
2121
<motion.div
2222
className="mb-6 bg-white rounded-2xl shadow-soft p-6"

src/features/lists/components/ListAddTask.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function ListAddTask({ onCancel, listFilters }) {
4848
placeholder="Add a task to this list..."
4949
value={text}
5050
onChange={(e) => setText(e.target.value)}
51-
className="w-full py-2 px-4 pr-20 text-sm text-neutral-800 rounded-lg border border-neutral-200 focus:border-primary-400 focus:ring-1 focus:ring-primary-200 outline-none transition-all"
51+
className="w-full py-2 px-4 pr-20 text-sm text-neutral-800 rounded-lg border border-neutral-200 focus:border-primary-400 focus:ring-1 focus:ring-primary-200 outline-hidden transition-all"
5252
autoComplete="off"
5353
data-testid="list-task-input"
5454
/>

src/features/lists/components/TaskBoard.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function TaskBoard() {
120120
return (
121121
<div
122122
key={list.id}
123-
className="task-list-container bg-white rounded-xl shadow-soft w-full md:w-[calc(50%-0.5rem)] lg:w-80 flex-shrink-0 flex flex-col"
123+
className="task-list-container bg-white rounded-xl shadow-soft w-full md:w-[calc(50%-0.5rem)] lg:w-80 shrink-0 flex flex-col"
124124
data-testid={`task-list-${list.id}`}
125125
>
126126
{editingListId === list.id ? (
@@ -135,14 +135,14 @@ function TaskBoard() {
135135
<h2 className="font-medium text-lg" data-testid={`list-title-${list.id}`}>{list.title}</h2>
136136
<div className="flex items-center gap-2">
137137
<span
138-
className="text-xs font-medium text-neutral-500 bg-neutral-100 px-2 py-0.5 rounded"
138+
className="text-xs font-medium text-neutral-500 bg-neutral-100 px-2 py-0.5 rounded-sm"
139139
data-testid={`task-count-${list.id}`}
140140
>
141141
{completedTasksCount}/{filteredTasks.length}
142142
</span>
143143
<button
144144
type="button"
145-
className="text-sm text-neutral-500 hover:text-neutral-700 px-2 py-1 hover:bg-neutral-100 rounded"
145+
className="text-sm text-neutral-500 hover:text-neutral-700 px-2 py-1 hover:bg-neutral-100 rounded-sm"
146146
onClick={() => handleEditTaskList(list.id)}
147147
data-testid={`edit-list-${list.id}`}
148148
>
@@ -151,7 +151,7 @@ function TaskBoard() {
151151
{list.id !== 'default' && (
152152
<button
153153
type="button"
154-
className="text-sm text-rose-500 hover:text-rose-700 px-2 py-1 hover:bg-rose-50 rounded"
154+
className="text-sm text-rose-500 hover:text-rose-700 px-2 py-1 hover:bg-rose-50 rounded-sm"
155155
onClick={() => deleteTaskList(list.id)}
156156
data-testid={`delete-list-${list.id}`}
157157
>
@@ -161,7 +161,7 @@ function TaskBoard() {
161161
</div>
162162
</div>
163163

164-
<div className="list-body p-4 flex-grow overflow-y-auto max-h-[50vh]">
164+
<div className="list-body p-4 grow overflow-y-auto max-h-[50vh]">
165165
{/* Show add task form when adding to this list */}
166166
{addingTaskToListId === list.id ? (
167167
<div className="mb-3">

src/features/lists/components/TaskListConfig.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function TaskListConfig({ taskList, onSave, onCancel }) {
4646
type="text"
4747
value={title}
4848
onChange={(e) => setTitle(e.target.value)}
49-
className="w-full px-3 py-2 border border-neutral-300 rounded-md focus:outline-none focus:ring-1 focus:ring-primary-500"
49+
className="w-full px-3 py-2 border border-neutral-300 rounded-md focus:outline-hidden focus:ring-1 focus:ring-primary-500"
5050
placeholder="Enter list title"
5151
data-testid="list-title-input"
5252
/>

src/features/tags/components/TagManager.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function TagManager({ onClose }) {
5757
{/* Add new tag */}
5858
<div className="mb-5">
5959
<div className="flex gap-2">
60-
<div className="relative flex-grow">
60+
<div className="relative grow">
6161
<div className="absolute left-3 top-1/2 -translate-y-1/2">
6262
<TagIcon className="h-4 w-4 text-neutral-500" />
6363
</div>
@@ -66,7 +66,7 @@ function TagManager({ onClose }) {
6666
placeholder="Add a new tag"
6767
value={newTagName}
6868
onChange={(e) => setNewTagName(e.target.value)}
69-
className="w-full py-2 px-4 pl-9 text-sm text-neutral-800 rounded-lg border border-neutral-300 focus:border-primary-400 focus:ring-1 focus:ring-primary-200 outline-none transition-all"
69+
className="w-full py-2 px-4 pl-9 text-sm text-neutral-800 rounded-lg border border-neutral-300 focus:border-primary-400 focus:ring-1 focus:ring-primary-200 outline-hidden transition-all"
7070
data-testid="new-tag-input"
7171
/>
7272
</div>
@@ -102,7 +102,7 @@ function TagManager({ onClose }) {
102102
type="text"
103103
value={editedTagName}
104104
onChange={(e) => setEditedTagName(e.target.value)}
105-
className="w-full py-1 px-2 text-sm border border-primary-300 rounded focus:outline-none focus:ring-1 focus:ring-primary-500"
105+
className="w-full py-1 px-2 text-sm border border-primary-300 rounded-sm focus:outline-hidden focus:ring-1 focus:ring-primary-500"
106106
autoFocus
107107
data-testid="edit-tag-input"
108108
/>

src/features/tasks/components/GlobalTaskForm.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function GlobalTaskForm({ onCancel }) {
8080
placeholder="What needs to be done?"
8181
value={text}
8282
onChange={(e) => setText(e.target.value)}
83-
className="w-full py-3 px-4 pr-24 text-neutral-800 rounded-lg border border-neutral-200 focus:border-primary-400 focus:ring-2 focus:ring-primary-200 outline-none transition-all"
83+
className="w-full py-3 px-4 pr-24 text-neutral-800 rounded-lg border border-neutral-200 focus:border-primary-400 focus:ring-2 focus:ring-primary-200 outline-hidden transition-all"
8484
autoComplete="off"
8585
data-testid="task-input"
8686
/>
@@ -122,7 +122,7 @@ function GlobalTaskForm({ onCancel }) {
122122
value={newTagInput}
123123
onChange={(e) => setNewTagInput(e.target.value)}
124124
onKeyDown={handleTagKeyDown}
125-
className="w-full py-3 px-4 pl-9 text-sm text-neutral-800 rounded-lg border border-neutral-200 focus:border-primary-400 focus:ring-1 focus:ring-primary-200 outline-none transition-all"
125+
className="w-full py-3 px-4 pl-9 text-sm text-neutral-800 rounded-lg border border-neutral-200 focus:border-primary-400 focus:ring-1 focus:ring-primary-200 outline-hidden transition-all"
126126
autoComplete="off"
127127
data-testid="tag-input"
128128
/>

src/index.css

Lines changed: 67 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,70 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import 'tailwindcss';
42

5-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
3+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap')
4+
layer(utilities);
5+
6+
@theme {
7+
--color-primary-50: #f0f9ff;
8+
--color-primary-100: #e0f2fe;
9+
--color-primary-200: #bae6fd;
10+
--color-primary-300: #7dd3fc;
11+
--color-primary-400: #38bdf8;
12+
--color-primary-500: #0ea5e9;
13+
--color-primary-600: #0284c7;
14+
--color-primary-700: #0369a1;
15+
--color-primary-800: #075985;
16+
--color-primary-900: #0c4a6e;
17+
--color-primary-950: #082f49;
18+
19+
--color-secondary-50: #fdf4ff;
20+
--color-secondary-100: #fae8ff;
21+
--color-secondary-200: #f5d0fe;
22+
--color-secondary-300: #f0abfc;
23+
--color-secondary-400: #e879f9;
24+
--color-secondary-500: #d946ef;
25+
--color-secondary-600: #c026d3;
26+
--color-secondary-700: #a21caf;
27+
--color-secondary-800: #86198f;
28+
--color-secondary-900: #701a75;
29+
--color-secondary-950: #4a044e;
30+
31+
--color-neutral-50: #fafafa;
32+
--color-neutral-100: #f4f4f5;
33+
--color-neutral-200: #e4e4e7;
34+
--color-neutral-300: #d4d4d8;
35+
--color-neutral-400: #a1a1aa;
36+
--color-neutral-500: #71717a;
37+
--color-neutral-600: #52525b;
38+
--color-neutral-700: #3f3f46;
39+
--color-neutral-800: #27272a;
40+
--color-neutral-900: #18181b;
41+
--color-neutral-950: #09090b;
42+
43+
--font-sans:
44+
Inter var, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
45+
Segoe UI, Roboto, Helvetica Neue, Arial, sans-serif;
46+
47+
--shadow-soft:
48+
0 2px 15px -3px rgba(0, 0, 0, 0.07), 0 10px 20px -2px rgba(0, 0, 0, 0.04);
49+
}
50+
51+
/*
52+
The default border color has changed to `currentcolor` in Tailwind CSS v4,
53+
so we've added these compatibility styles to make sure everything still
54+
looks the same as it did with Tailwind CSS v3.
55+
56+
If we ever want to remove these styles, we need to add an explicit border
57+
color utility to any element that depends on these defaults.
58+
*/
59+
@layer base {
60+
*,
61+
::after,
62+
::before,
63+
::backdrop,
64+
::file-selector-button {
65+
border-color: var(--color-gray-200, currentcolor);
66+
}
67+
}
668

769
body {
870
margin: 0;
@@ -51,7 +113,7 @@ code {
51113

52114
.checkbox-container input[type="checkbox"] {
53115
@apply appearance-none h-5 w-5 rounded-md border border-gray-300 checked:bg-primary-500
54-
checked:border-transparent focus:outline-none transition-colors duration-200 ease-in-out;
116+
checked:border-transparent focus:outline-hidden transition-colors duration-200 ease-in-out;
55117
}
56118

57119
.checkbox-container .checkmark {

0 commit comments

Comments
 (0)