I'm trying to install Tailwind to practice some basic stuff to learn how this framework works. I followed every step that Adam Wathan the creator of the framework provided and when it comes to running I face command line error: You must pass a valid list of files to parse. Also I faced a an error while defining tailwind custom markers
@tailwind base;
@tailwind components;
@tailwind utilities;
first it says unknown at rule @tailwind, then after installing stylelint and following @hasusuf answer

another error showing up!

and the same command error is still there.
Any help ?
Today I tried installing Tailwind in the most basic way and it worked. I took most information from https://tailwindcss.com/docs/installation/ but if you're not experienced with build tools you can get lost in the last part.
Here are the steps:
index.html and styles.css filesindex.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="output.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="flex container mx-auto justify-center">
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded mt-8">
Button
</button>
</div>
</body>
</html>
Note that the link tag is pointing to output.css and not styles.css (we'll see why in a minute).
styles.css
@tailwind base;
@tailwind components;
@tailwind utilities;
npm init -y or npm init and answer to all the questions.
npm install tailwindcss
npx tailwindcss init
npx tailwindcss build styles.css -o output.css
Here the code you have written in styles.css will output in output.css.
Open index.html from your browser and edit the html or css file. Note that every change you make on the css file needs a new build (#5).
This is not the better configuration but it's a start.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With