Set up Tailwind and PostCSS

InstructorAdam Wathan

Share this video with your friends

Send Tweet

In this lesson we'll introduce Tailwind to a basic HTML project and see how it compiles into CSS with PostCSS. Tailwind can be configured in the tailwind.config.js file where you will define plugins for PostCSS to compile.

After that, we'll spin the project up with live-server and introduce styling with Tailwind utility classes.

~ 3 years ago

december 15 2021 (tailwindcss 3) - there is no .container anymore in the generated css file

~ 3 years ago

Found it easier to follow the course by using https://play.tailwindcss.com/

~ 3 years ago

.container class is not generated in css file, but it is generated later when you use it the html file Also, don't forget to add html file to content array in tailwind.config.js Basically, look up there https://tailwindcss.com/docs/installation

Leonardo
~ 9 months ago

This is what tailwind.config.js should look like:

/** @type {import('tailwindcss').Config} / module.exports = { content: [ './public/**/.html', ], theme: { extend: {}, }, plugins: [], }