[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
JonesOP2y 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
content:["*.html", "*/index.html", "*/**/index.html"], use this @jonasvl
Jones
JonesOP2y 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
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
JonesOP2y ago
alright give me a sec
Jones
JonesOP2y ago
Shadow Amitendu
html content:["*", "*.html", "*/*.html", "*/**/*.html"],
html content:["*", "*.html", "*/*.html", "*/**/*.html"],
try this once
Jones
JonesOP2y ago
did u mean to put 'html' in front of it?
Shadow Amitendu
no no
Jones
JonesOP2y 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
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
Jones
JonesOP2y 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
yes thats right
Jones
JonesOP2y ago
Shadow Amitendu
it might be needed below dependncies
Jones
JonesOP2y ago
but it's still not 'looking over' the file and update it by itself
Jones
JonesOP2y ago
ye i have it there
Jones
JonesOP2y ago
Shadow Amitendu
show me what your browser showing
Jones
JonesOP2y ago
Shadow Amitendu
its working
Jones
JonesOP2y 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
<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
JonesOP2y ago
okay so i will just add this to my html and not rerun the cmd to rebuild
Jones
JonesOP2y ago
Shadow Amitendu
can you make a new project just for once
Jones
JonesOP2y ago
wym? just make a new folder and try everything again?
Shadow Amitendu
npm install -D tailwindcss
npx tailwindcss init
npm install -D tailwindcss
npx tailwindcss init
paste this first yeah
Jones
JonesOP2y ago
alright
Shadow Amitendu
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
JonesOP2y ago
Jones
JonesOP2y ago
Shadow Amitendu
then npx init -y inside the test script use this npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
Jones
JonesOP2y ago
u meant npm right in the first one
Shadow Amitendu
yes both works right ?
Jones
JonesOP2y ago
npx init -y didn't work only npm did
Shadow Amitendu
okay np
Jones
JonesOP2y ago
Shadow Amitendu
we both are learning lmao
Jones
JonesOP2y ago
yea all good before this command i'll make a input css file right
Shadow Amitendu
create SRC folder and input.css
Jones
JonesOP2y ago
yea
Shadow Amitendu
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
damn you are playing with VS Code
Jones
JonesOP2y ago
yes but it still refuses to auto build
Shadow Amitendu
wait bro
Jones
JonesOP2y ago
yes
Shadow Amitendu
it is not recognising the path thats why its not working
Jones
JonesOP2y ago
are u sure? bcs if that would be the case it couldn't build it in the first place right?
Shadow Amitendu
check the css link by cliking on ctrl and left click
Jones
JonesOP2y ago
that works
Shadow Amitendu
on the css path okay whats inside the css file then?
Jones
JonesOP2y ago
the output?
Shadow Amitendu
yes show a pic of the project (pls make it bigger)
Shadow Amitendu
did you put this
Jones
JonesOP2y 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
JonesOP2y ago
yes everything works except for the fact that it's not rebuilding on it's own
Shadow Amitendu
use --watch or vite
Jones
JonesOP2y ago
what are those
Shadow Amitendu
by npm install vite
Jones
JonesOP2y ago
okay
Shadow Amitendu
--watch to watch the file for changes put in the script
Jones
JonesOP2y ago
yes just --watch? i installed vite btw
Jones
JonesOP2y ago
Shadow Amitendu
if this works then no need of vite
Jones
JonesOP2y ago
"scripts": {
"test": "--watch"
}
"scripts": {
"test": "--watch"
}
i have this
Shadow Amitendu
lmao have this instead bro npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch
Jones
JonesOP2y ago
ahh i see
Shadow Amitendu
then npm run test
Jones
JonesOP2y ago
yes that's the command that we have been using the whole time
Shadow Amitendu
npm run test did you do this??
Jones
JonesOP2y 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
what show the conole
Jones
JonesOP2y ago
Jones
JonesOP2y ago
and i never runs again after making changes to my html file
Shadow Amitendu
it should show this
Jones
JonesOP2y ago
does yours rebuild after making changes?
Shadow Amitendu
yes
Jones
JonesOP2y ago
well
Shadow Amitendu
then and there after saving
Jones
JonesOP2y 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
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
all three ways did you restart you computer after npm install ?
Jones
JonesOP2y ago
i'll check that vid out and no haven't restarted my pc after doing npm install -D tailwindcss
Shadow Amitendu
check this have some fresh memes
Jones
JonesOP2y ago
wtf lmao hahahaa it's good ngl
Shadow Amitendu
yeah
Jones
JonesOP2y 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
Np @jonasvl Does every thing works okay?
Shadow Amitendu
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
JonesOP2y ago
ah okay well on my laptop it does everything normal, haven't gotten back on my main pc
Shadow Amitendu
oh okay
nickymicky
nickymicky2y ago
Are you still having tailwind issues @jonasvl ?
Jones
JonesOP2y ago
on my main pc yes can't do anything on it rn tho
nickymicky
nickymicky2y ago
Ohhh..okay Can you please let me know when you have access to it?
Jones
JonesOP2y ago
yes, once i get back to my main pc i will let you know everything
n
n11mo ago
Please I'm having the same problem rn Did you ever fix the problem?
Jones
JonesOP11mo ago
nope i forgot about it tbh
n
n11mo ago
aww man like you just moved pass it or did you forget how to fix it?
Jones
JonesOP11mo 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
n11mo ago
im still tryna fix it rn im in the tailwind server lookin in forums
Jones
JonesOP11mo ago
good luck
n
n11mo ago
thx
darshil__25
darshil__259mo ago
hey, this issue resolved?
n
n9mo ago
yea
n
n9mo ago
im using the Live Preview extension with these settings
No description
darshil__25
darshil__259mo ago
so you are not facing rebuilding problem after this setting? i have applied same but still i have to build it manually
n
n9mo ago
and you're using --watch?
darshil__25
darshil__259mo ago
yeah
darshil__25
darshil__259mo ago
No description
darshil__25
darshil__259mo ago
doesn't rebuild by itself
n
n9mo ago
im guessing its the tailwimd comfig idk im not a pro
Want results from more Discord servers?
Add your server