In this exercise, you will explore what Tailwind CSS is and set up a development environment for using Tailwind CSS in your web projects.
Ok, we're going to work with TailwindCSS but... what is exactly TailwindCSS? Let's see what the official website says about it:
Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the building blocks you need to build bespoke designs without any annoying opinionated styles you have to fight to override. Tailwind CSS is a utility-first CSS framework for rapidly building custom user interfaces.
Utility-first means that TailwindCSS is a CSS framework that provides you with a set of ready-to-use classes that you can use to style your HTML elements. It's a great tool to use when you want to quickly prototype a web page or application. It's also a great tool to use when you want to build a custom design without having to write a lot of CSS code.
Let's do some steps so that we understand the importance of the TailwindCSS website and understanding how to create the environment:
Introduction to Tailwind CSS:
Installation Guide:
HTML Page:
Using Tailwind Classes:
div
for example, and try to apply the following classes: bg-blue-500
, text-white
, p-4
... can you see any differences?Publish to Netlify
- Github offers us ghpages to deploy our projects, but we are going to use Netlify, which is a platform that allows us to deploy our projects in a very simple way and allows dynamic pages. To do this, we must follow the following steps:
- If your previous setup is correct, you should get a /dist folder in your project. This folder contains the index.html file and the css file that we have generated with TailwindCSS. Parcel is responsible for generating this folder and its content. It's all what we need to deploy our project.
- Check out the Netlify website: [Netlify](https://www.netlify.com/).
- Create an account on Netlify.
- Have a look at the following guide to learn how to deploy your site to Netlify: [Netlify Guide](https://www.netlify.com/blog/2016/09/29/a-step-by-step-guide-deploying-on-netlify/).
Share your Netlify Link in Moodle