From 57c646f919432b1e2d77970e49e0dfe952fa13f2 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 27 Sep 2025 22:23:19 -0500 Subject: [PATCH] Revert tailwindcss changes, @apply is fine actually Revert "Remove all @apply usage from index.css" This reverts commit 81fae13219dca4f13dd20947562e3b1c8cdcab84. Revert "Add TailwindCSS @apply guidelines" This reverts commit 3aedc574d7dfa3189b01bc56b122eae6657e3214. --- AGENTS.md | 38 -------------------------------------- src/index.css | 15 ++------------- 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index c68c392..f6e89c6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1077,44 +1077,6 @@ When users specify color schemes: - Implement responsive design with Tailwind breakpoints - Add hover and focus states for interactive elements -### TailwindCSS Guidelines - -**CRITICAL**: The `@apply` at-rule is completely forbidden in this project. Instead, create custom components with the desired className and wrap elements where that style should be applied. - -The `@apply` directive is non-standard CSS and goes against the component-driven design philosophy of Tailwind. It creates implicit dependencies and makes styles harder to trace and maintain. This project uses pure CSS with CSS custom properties for any global styles. - -**✅ Correct - Component-based approach:** -```tsx -// Create a custom component -function PrimaryButton({ children, className, ...props }: ButtonProps) { - return ( - - ); -} - -// Use the component -Click me -``` - -**❌ Wrong - Using @apply:** -```css -.primary-button { - @apply bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded; -} -``` - -This approach: -- Keeps styles co-located with components -- Makes styling explicit and traceable -- Follows React component patterns -- Enables better TypeScript integration -- Supports proper className composition with `cn()` - ## Writing Tests vs Running Tests There is an important distinction between **writing new tests** and **running existing tests**: diff --git a/src/index.css b/src/index.css index 889dad5..33fdf9d 100644 --- a/src/index.css +++ b/src/index.css @@ -2,16 +2,6 @@ @tailwind components; @tailwind utilities; -/* - * IMPORTANT: The use of @apply is forbidden in this project. - * - * @apply is non-standard CSS and goes against the component-driven design philosophy - * of Tailwind. Instead of using @apply, create custom React components with the - * desired className and wrap elements where that style should be applied. - * - * All styles in this file use pure CSS with CSS custom properties for theming. - */ - @layer base { :root { --background: 0 0% 100%; @@ -102,11 +92,10 @@ @layer base { * { - border-color: hsl(var(--border)); + @apply border-border; } body { - background-color: hsl(var(--background)); - color: hsl(var(--foreground)); + @apply bg-background text-foreground; } } \ No newline at end of file