Skip to content

App Integration - Styling your Task Management App

Let's continue to refine the styling of our Task Management App using Tailwind CSS. We'll ensure our main page.tsx and the basic layout components look good and are responsive. We'll also remove the temporary SpecialButton from app/page.tsx as we'll primarily use Tailwind for consistency.

  1. Remove SpecialButton from app/page.tsx: Since we'll rely on Tailwind for most styling, let's remove the temporary CSS Module button.

    app/page.tsx (Update this file)

    // app/page.tsx
    // This file defines the content for the homepage ('/') of the application.
    // Removed SpecialButton component as we focus on Tailwind CSS.
    
    export default function HomePage() {
      return (
        <div className="flex flex-col items-center justify-center min-h-[calc(100vh-250px)] text-center px-4 py-8">
          <h2 className="text-4xl md:text-5xl font-bold text-blue-700 mb-4 animate-fade-in">
            Welcome to My TaskFlow!
          </h2>
          <p className="text-xl text-gray-600 mb-8 max-w-2xl animate-slide-up">
            Your simple solution for organizing tasks and boosting productivity.
          </p>
          <p className="text-md text-gray-500">
            Get started by logging in or signing up to manage your daily tasks with ease.
          </p>
        </div>
      );
    }
    

    You can also delete the components/SpecialButton.tsx file and the components/styles/SpecialButton.module.css file as they are no longer needed.

  2. Refine Header.tsx and Footer.tsx (already well-styled with Tailwind): Our Header and Footer components already use Tailwind CSS extensively. They have gradients, shadows, responsive padding, and text styling. This is a good example of how to combine multiple utility classes to create a visually appealing element.

    No further changes are needed for these files at this point, but review their classes to see how Tailwind is applied.

  3. Refine app/dashboard/page.tsx: Let's add some more Tailwind classes to make the dashboard page look a bit more polished, even with placeholder content.

    app/dashboard/page.tsx (Update this file)

    // app/dashboard/page.tsx
    // This file defines the content for the /dashboard route.
    // Enhanced with more Tailwind CSS classes for better presentation.
    
    export default function DashboardPage() {
      return (
        <div className="flex flex-col items-center justify-center p-8 bg-white rounded-xl shadow-lg border border-gray-200">
          <h2 className="text-4xl font-extrabold text-indigo-700 mb-6">
            <span className="block text-center mb-2">🚀</span>
            Your Productive Dashboard
          </h2>
          <p className="text-lg text-gray-700 mb-8 max-w-xl text-center">
            This is your central hub for managing all your tasks. As we progress, your tasks will appear here, beautifully organized.
          </p>
          <div className="bg-blue-50 text-blue-700 p-4 rounded-md shadow-inner text-sm">
            <p>Ready to add your first task? We'll build that functionality soon!</p>
          </div>
          {/* We will later add task list components here */}
        </div>
      );
    }
    
  4. Refine app/tasks/[id]/page.tsx: Let's also enhance the styling for our dynamic task detail page.

    app/tasks/[id]/page.tsx (Update this file)

    export default async function SingleTaskPage({
      params,
    }: {
      params: { id: string };
    }) {
      const { id } = await params; // Destructure the 'id' from params
    
      return (
        <div className="flex flex-col items-center justify-center p-8 bg-gradient-to-br from-green-50 to-blue-50 rounded-xl shadow-2xl border border-gray-200">
          <h2 className="text-4xl font-extrabold text-purple-700 mb-4">
            Viewing Task Details
          </h2>
          <p className="text-xl text-gray-800 mb-6">
            You are currently focused on task ID:{" "}
            <span className="font-black text-indigo-800 break-words">{id}</span>
          </p>
          <div className="bg-white p-6 rounded-lg shadow-md border border-gray-100 max-w-lg w-full text-left">
            <h3 className="text-2xl font-bold text-gray-700 mb-3">
              Task Placeholder Title
            </h3>
            <p className="text-gray-600 mb-4">
              This is a placeholder for the task description. In upcoming modules,
              we'll fetch real task data and display all its details here, including
              due dates, priorities, and status.
            </p>
            <ul className="text-sm text-gray-500 space-y-1">
              <li>
                **Status:**{" "}
                <span className="font-semibold text-orange-500">Pending</span>
              </li>
              <li>
                **Due Date:**{" "}
                <span className="font-semibold text-gray-600">N/A</span>
              </li>
              <li>
                **Priority:**{" "}
                <span className="font-semibold text-gray-600">Medium</span>
              </li>
            </ul>
          </div>
          <p className="mt-8 text-md text-gray-500 italic">
            This content is dynamic! The ID in the URL determines what you see here.
          </p>
        </div>
      );
    }
    

To see your styled app:

  1. Ensure your development server is running (npm run dev).
  2. Open your browser and navigate to http://localhost:3000.
  3. Navigate to /dashboard and /tasks/any-id-you-like to see the updated styling.

You should now have a much more visually appealing Task Management App, primarily styled with Tailwind CSS. You've learned about global CSS for overarching styles, CSS Modules for highly scoped component styles, and the utility-first approach of Tailwind CSS for rapid and consistent design. This foundation will be essential as we move on to adding more interactive features and handling data in our application!