Project Setup
In this guide, we will not cover the initial setup of the project. But we followed the same steps as those covered in our other course.
We have created a GitHub repository with the initial setup to make it easier for you. You can fork or clone the repository and start working on the project. The branch should be 0-start
.
Then run the following commands:
If you want to do this manually, check out the project setup in the course: Todo App with React, TypeScript, and TDD
Tailwind CSS
We will use Tailwind CSS to style our application. This course is not a Tailwind CSS course, so I will not cover the basics of Tailwind CSS. We recommend checking out the official documentation if you are new to Tailwind CSS.
However, we will cover the setup and usage of Tailwind CSS for our project. The setup is straightforward, and we follow the official documentation's install steps for Vite.
Installing Tailwind CSS
This step will create a tailwind.config.js
and a postcss.config.js
file at the root of our project.
Next, we need to update our tailwind.config.js
file with the following content:
We must set up the Tailwind directives in our global CSS file, src/index.css
Let us run the dev server.
Make a slight change in the src/App.tsx
file to see if Tailwind CSS works.
We should see the following output in the browser.
Editor Setup for Tailwind CSS
We recommend setting up a few editor extensions to make working with Tailwind CSS easier.
-
Tailwind CSS IntelliSense: This extension provides IntelliSense for Tailwind CSS in your editor. A must-have extension for working with Tailwind CSS.
-
Inline-fold (Optional): This extension allows you to fold the Tailwind CSS classes in your editor. This helps to avoid bloating the editor with a lot of classes.
Prettier Plugin to sort Tailwind CSS classes
We recommend using the Official Prettier Plugin to sort the Tailwind CSS classes in your editor. This plugin dramatically reduces the cognitive load of working with the classes.
Install the plugin:
Add the plugin to your .prettierrc
file:
Great, this wraps up this section. We have a decent project setup to start working on our application.
At this point, our code should match the code in the branch 1-project-setup
.