Tailwind CSS
Tailwind CSS is a post CSS plugin that is used to style a webpage. This can be used with basic HTML or with front-end frameworks like React, Vue or Angular. Tailwind CSS has had rising popularity over the recent months and is being widely used to style websites.
According to the official website of tailwindcss, it is described as a utility first framework packed with classes. The main point of Tailwind CSS is that you can style your HTML website right in the HTML file. This is quite similar for the front-end frameworks as well. This can be done by using a class in the element you wish to style.
An example of a class that can be used to style a particular element can be:
The following HTML code would produce the image shown below as shown in the official tailwind CSS website. Furthermore, the classes used to style the components are shown in the image above and is quite similar to plain CSS.
This is an example shown in the tailwind CSS website and is not an example made by me.
How to get started with Tailwind CSS?
Setting up tailwind CSS can be a bit confusing, but it's worth the effort.
Firstly tailwind CSS must be installed using the command in the terminal :
npm install tailwindcss
After it is installed, create a CSS file and add the following code into it:
I have named my file tailwind.css, you can use any name.
Get Vikum Dabare’s stories in your inbox
Join Medium for free to get updates from this writer.
@tailwind base;
@tailwind components;
@tailwind utilities;
Once that is done run the following command in the terminal :
npx tailwind init
This will generate a file, nextly we should add the post CSS file. This can be done by using the following command in the terminal:
npm install postcss-cli autoprefixer
When the installation is completed run the following command in the terminal:
touch postcss.config.js
A file will be generated, add this code to the plugins:
Great, all the hard work is done. We just need to run the file.
In the terminal use, the following commands after the previous one is executed:
npx postcss tailwind.css -o public/style.css
npm run build









