[TAILWIND CSS] output.css not rebuilding after making changes in my main html file

Whenever I make changes and save those changes in my main HTML file, windtail does not automatically rebuild the output.css file to adapt to the changes and build the new classes. Is there something I am missing? I am pretty sure everything is setup the right way. If you know what could cause this issue please let me know, thanks!
118 Replies
Jones
Jones12mo ago
In the screenshots above you can see the 'rebuilding' but this only happened after I re-saved the tailwind.config.js file or when i stopped the command and executed it again npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
Shadow Amitendu
Shadow Amitendu12mo ago
content:["*.html", "*/index.html", "*/**/index.html"], use this @jonasvl
Jones
Jones12mo ago
alright It still refuses to rebuild by itself Im really confused what could cause this, i googled it and some were kinda having the same issue and it had something to do with it not being able to 'watch' the html file cause of some limitations? Is there some other thing i should need for this to work propperly?
Shadow Amitendu
Shadow Amitendu12mo ago
try to add this in the beginning "*" @jonasvl can you show the Package.json and input.css and output.css and the Whole File Structure This happened to me before i solved it by doing this I want to check them
Jones
Jones12mo ago
alright give me a sec
Jones
Jones12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
html content:["*", "*.html", "*/*.html", "*/**/*.html"],
html content:["*", "*.html", "*/*.html", "*/**/*.html"],
try this once
Jones
Jones12mo ago
did u mean to put 'html' in front of it?
Shadow Amitendu
Shadow Amitendu12mo ago
no no
Jones
Jones12mo ago
content:["*", "*.html", "*/*.html", "*/**/*.html"], i did this now and it is only building the css file when i save or re execute the cmd could this be a conflict with some kind of extension i have perhaps?
Shadow Amitendu
Shadow Amitendu12mo ago
yews and also do this npm init -y in the package.json file you will see a script named test inside that paste this npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch and in terminal use this npm run test
Shadow Amitendu
Shadow Amitendu12mo ago
Jones
Jones12mo ago
this just runs the command as an alias and npm init -y added a lot more dependencies in my package.json file
Shadow Amitendu
Shadow Amitendu12mo ago
yes thats right
Jones
Jones12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
it might be needed below dependncies
Jones
Jones12mo ago
but it's still not 'looking over' the file and update it by itself
Shadow Amitendu
Shadow Amitendu12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
Jones
Jones12mo ago
ye i have it there
Jones
Jones12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
show me what your browser showing
Jones
Jones12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
its working
Jones
Jones12mo ago
it only applies the 'tailwindcss' if i manually rebuild it but it should auto rebuild right? or am i just dumb and do you actually have to rebuild it every time
Shadow Amitendu
Shadow Amitendu12mo ago
<div class="px-8 py-2 dark:bg-gray-900 dark:text-gray-100">
<div class="flex items-center mx-auto container justify-center md:justify-between py-2">
<div>
<span>CET and JEMAT 2023 Admissions are open</span>
<a href="#" rel="noopener noreferrer" class="underline">Book your seat</a> today!
</div>
<a href="#" rel="noopener noreferrer" class="items-center gap-2 hidden md:flex">
<svg role="img" viewBox="0 0 22 22" class="fill-current h-4 w-4">
<path clip-rule="evenodd"
d="M6.5 1.75a1.75 1.75 0 100 3.5h3.51a8.785 8.785 0 00-.605-1.389C8.762 2.691 7.833 1.75 6.5 1.75zm5.49 3.5h3.51a1.75 1.75 0 000-3.5c-1.333 0-2.262.941-2.905 2.111a8.778 8.778 0 00-.605 1.389zM1.75 6.75v3.5h18.5v-3.5H1.75zm18 5H21a.75.75 0 00.75-.75V6a.75.75 0 00-.75-.75h-2.761a3.25 3.25 0 00-2.739-5c-2.167 0-3.488 1.559-4.22 2.889a9.32 9.32 0 00-.28.553 9.32 9.32 0 00-.28-.553C9.988 1.809 8.667.25 6.5.25a3.25 3.25 0 00-2.739 5H1A.75.75 0 00.25 6v5c0 .414.336.75.75.75h1.25V21c0 .414.336.75.75.75h16a.75.75 0 00.75-.75v-9.25zm-1.5 0H3.75v8.5h14.5v-8.5z"
fill-rule="evenodd"></path>
</svg>
<span class="hover:underline focus-visible:underline">Gift Cards</span>
</a>
</div>
</div>
<div class="px-8 py-2 dark:bg-gray-900 dark:text-gray-100">
<div class="flex items-center mx-auto container justify-center md:justify-between py-2">
<div>
<span>CET and JEMAT 2023 Admissions are open</span>
<a href="#" rel="noopener noreferrer" class="underline">Book your seat</a> today!
</div>
<a href="#" rel="noopener noreferrer" class="items-center gap-2 hidden md:flex">
<svg role="img" viewBox="0 0 22 22" class="fill-current h-4 w-4">
<path clip-rule="evenodd"
d="M6.5 1.75a1.75 1.75 0 100 3.5h3.51a8.785 8.785 0 00-.605-1.389C8.762 2.691 7.833 1.75 6.5 1.75zm5.49 3.5h3.51a1.75 1.75 0 000-3.5c-1.333 0-2.262.941-2.905 2.111a8.778 8.778 0 00-.605 1.389zM1.75 6.75v3.5h18.5v-3.5H1.75zm18 5H21a.75.75 0 00.75-.75V6a.75.75 0 00-.75-.75h-2.761a3.25 3.25 0 00-2.739-5c-2.167 0-3.488 1.559-4.22 2.889a9.32 9.32 0 00-.28.553 9.32 9.32 0 00-.28-.553C9.988 1.809 8.667.25 6.5.25a3.25 3.25 0 00-2.739 5H1A.75.75 0 00.25 6v5c0 .414.336.75.75.75h1.25V21c0 .414.336.75.75.75h16a.75.75 0 00.75-.75v-9.25zm-1.5 0H3.75v8.5h14.5v-8.5z"
fill-rule="evenodd"></path>
</svg>
<span class="hover:underline focus-visible:underline">Gift Cards</span>
</a>
</div>
</div>
paste this and check
Jones
Jones12mo ago
okay so i will just add this to my html and not rerun the cmd to rebuild
Jones
Jones12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
can you make a new project just for once
Jones
Jones12mo ago
wym? just make a new folder and try everything again?
Shadow Amitendu
Shadow Amitendu12mo ago
npm install -D tailwindcss
npx tailwindcss init
npm install -D tailwindcss
npx tailwindcss init
paste this first yeah
Jones
Jones12mo ago
alright
Shadow Amitendu
Shadow Amitendu12mo ago
then this
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./**/*.html", "*.html", "*"],
theme: {
extend: {},
},
plugins: [],
}
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["./**/*.html", "*.html", "*"],
theme: {
extend: {},
},
plugins: [],
}
Jones
Jones12mo ago
Jones
Jones12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
then npx init -y inside the test script use this npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
Jones
Jones12mo ago
u meant npm right in the first one
Shadow Amitendu
Shadow Amitendu12mo ago
yes both works right ?
Jones
Jones12mo ago
npx init -y didn't work only npm did
Shadow Amitendu
Shadow Amitendu12mo ago
okay np
Jones
Jones12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
we both are learning lmao
Jones
Jones12mo ago
yea all good before this command i'll make a input css file right
Shadow Amitendu
Shadow Amitendu12mo ago
create SRC folder and input.css
Jones
Jones12mo ago
yea
Shadow Amitendu
Shadow Amitendu12mo ago
yea the output one will be auto created when you run the script then just link it with html link:css one and just tab
Shadow Amitendu
Shadow Amitendu12mo ago
damn you are playing with VS Code
Jones
Jones12mo ago
yes but it still refuses to auto build
Shadow Amitendu
Shadow Amitendu12mo ago
wait bro
Jones
Jones12mo ago
yes
Shadow Amitendu
Shadow Amitendu12mo ago
it is not recognising the path thats why its not working
Jones
Jones12mo ago
are u sure? bcs if that would be the case it couldn't build it in the first place right?
Shadow Amitendu
Shadow Amitendu12mo ago
check the css link by cliking on ctrl and left click
Jones
Jones12mo ago
that works
Shadow Amitendu
Shadow Amitendu12mo ago
on the css path okay whats inside the css file then?
Jones
Jones12mo ago
the output?
Shadow Amitendu
Shadow Amitendu12mo ago
yes show a pic of the project (pls make it bigger)
Shadow Amitendu
Shadow Amitendu12mo ago
did you put this
Jones
Jones12mo ago
so it's the basic output file + this bcs i added <h1 class="text-teal-600">Hello</h1> in the index.html file and did ctrl+s in tailwind.config.js to rerun the command so i manually built it and that works
Jones
Jones12mo ago
yes everything works except for the fact that it's not rebuilding on it's own
Shadow Amitendu
Shadow Amitendu12mo ago
use --watch or vite
Jones
Jones12mo ago
what are those
Shadow Amitendu
Shadow Amitendu12mo ago
by npm install vite
Jones
Jones12mo ago
okay
Shadow Amitendu
Shadow Amitendu12mo ago
--watch to watch the file for changes put in the script
Jones
Jones12mo ago
yes just --watch? i installed vite btw
Jones
Jones12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
if this works then no need of vite
Jones
Jones12mo ago
"scripts": {
"test": "--watch"
}
"scripts": {
"test": "--watch"
}
i have this
Shadow Amitendu
Shadow Amitendu12mo ago
lmao have this instead bro npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
Jones
Jones12mo ago
ahh i see
Shadow Amitendu
Shadow Amitendu12mo ago
then npm run test
Jones
Jones12mo ago
yes that's the command that we have been using the whole time
Shadow Amitendu
Shadow Amitendu12mo ago
npm run test did you do this??
Jones
Jones12mo ago
i did run it now and it perfectly rebuilds the css file which is great but it's not rebuilding it automatically
Shadow Amitendu
Shadow Amitendu12mo ago
what show the conole
Jones
Jones12mo ago
Jones
Jones12mo ago
and i never runs again after making changes to my html file
Shadow Amitendu
Shadow Amitendu12mo ago
it should show this
Jones
Jones12mo ago
does yours rebuild after making changes?
Shadow Amitendu
Shadow Amitendu12mo ago
yes
Jones
Jones12mo ago
well
Shadow Amitendu
Shadow Amitendu12mo ago
then and there after saving
Jones
Jones12mo ago
idk what the hell i am doing wrong i have the latest version of nodejs i have everything done like the guide and it still does not work
Shadow Amitendu
Shadow Amitendu12mo ago
Thirus
YouTube
Install Tailwind CSS v3 - CDN vs CLI vs PostCSS
Tailwind CSS released it’s major version 3.0 on December 9th. If you’re new to Tailwind or front end development, you might wonder how to install and start working with this latest version of Tailwind CSS in simple projects that don’t use any of the frameworks listed in the documentation. In this video I’ll show you three ways - via CDN, using ...
Shadow Amitendu
Shadow Amitendu12mo ago
all three ways did you restart you computer after npm install ?
Jones
Jones12mo ago
i'll check that vid out and no haven't restarted my pc after doing npm install -D tailwindcss
Shadow Amitendu
Shadow Amitendu12mo ago
Shadow Amitendu
Shadow Amitendu12mo ago
check this have some fresh memes
Jones
Jones12mo ago
wtf lmao hahahaa it's good ngl
Shadow Amitendu
Shadow Amitendu12mo ago
yeah
Jones
Jones12mo ago
okay i now what im gonna do so i will use the cdn and when i am done to publish i will build the css so i don't have to use the link in my html file in production tyvm for all your help have a nice rest of your day
Shadow Amitendu
Shadow Amitendu12mo ago
Np @jonasvl Does every thing works okay?
Shadow Amitendu
Shadow Amitendu12mo ago
DEV Community
Free Tailwind Components For Your Next Project.
Tailwind UI is a beautiful UI component library that you can use, to make beautiful websites in just...
Jones
Jones12mo ago
ah okay well on my laptop it does everything normal, haven't gotten back on my main pc
Shadow Amitendu
Shadow Amitendu12mo ago
oh okay
nickymicky
nickymicky12mo ago
Are you still having tailwind issues @jonasvl ?
Jones
Jones12mo ago
on my main pc yes can't do anything on it rn tho
nickymicky
nickymicky12mo ago
Ohhh..okay Can you please let me know when you have access to it?
Jones
Jones12mo ago
yes, once i get back to my main pc i will let you know everything
Shadow Amitendu
Shadow Amitendu12mo ago
n
n5mo ago
Please I'm having the same problem rn Did you ever fix the problem?
Jones
Jones5mo ago
nope i forgot about it tbh
n
n5mo ago
aww man like you just moved pass it or did you forget how to fix it?
Jones
Jones5mo ago
moved pass it i looked it up and it probably was some small internal thingy but i had no clue how to get it fixed
n
n5mo ago
im still tryna fix it rn im in the tailwind server lookin in forums
Jones
Jones5mo ago
good luck
n
n5mo ago
thx
darshil__25
darshil__254mo ago
hey, this issue resolved?
n
n4mo ago
yea
n
n4mo ago
im using the Live Preview extension with these settings
No description
darshil__25
darshil__254mo ago
so you are not facing rebuilding problem after this setting? i have applied same but still i have to build it manually
n
n4mo ago
and you're using --watch?
darshil__25
darshil__254mo ago
yeah
darshil__25
darshil__254mo ago
No description
darshil__25
darshil__254mo ago
doesn't rebuild by itself
n
n4mo ago
im guessing its the tailwimd comfig idk im not a pro