r/tailwindcss • u/fred_from_earth • Apr 11 '22
tailwind: no simple way to get started
I give up on tailwind css, have been using it on other projects successfully before but now, I'm trying to install it on a new project and this seems impossible, constant incomprehensible and misleading errors and warnings, and even when getting rid of all warnings and errors the classes just don't take effect, even when copying the entire tailwind installation from an old project: no effect after running build.
Is there just no simple way to get started with tailwind? They claim that there is but there isn't. You npm install tailwindcss but then you have to create the files on your own and copy the text from there in that file and put that here and this there and change that and this and check dependencies yourself and yada yada... what's so hard to make this an out-of-the-box framework? I'm a web designer and want to get start working soon, I like being geeky alright, enjoy a little shell script to feel smart but this is just too much and seems so random, the errors are misleading and laconic and it's boring and frustrating and time wasting – it's been days – the whole thing defeats the purpose.
Here's my post from yesterday on the issues I'm encountering anyway…
https://www.reddit.com/r/webdevelopment/comments/u0eroc/tailwind_css_classes_not_taking_effect/
2
u/grumblingdeveloper Apr 11 '22
Otherwise, upload your project to GitHub. I guarantee you your problems are fixed within 30 mins.
If its private, just remove all private stuff. You only need one component.
1
u/fred_from_earth Apr 12 '22
I just pushed it to github, see my other recent comment here on this thread. Still working on getting the repository to work.
what is twind.dev?
1
u/grumblingdeveloper Apr 12 '22
Not accessible -> https://github.com/bbblgmsp/tailwind_stuff
1
0
u/fred_from_earth Apr 11 '22
I never done this before so now I need to install git on mac first but also my internet went tits up so download takes 44 hourse :D need to fix this first
1
2
u/GriceTurrble Apr 11 '22 edited Apr 11 '22
As a first step, use the Play CDN (https://tailwindcss.com/docs/installation/play-cdn). Throw one line into your HTML and you're using Tailwind. Start adding classes and go from there. Once you have something you want to productionize, you can retrace your steps through the installation instructions to get a real build chain going (and for starters there, I'd recommend only using the Tailwind CLI; no need for the complication of PostCSS or other frameworks until you know you need them).
That, or go the Playground site to create components with markup in the browser from scratch. That site uses the Monaco editor, the same one that powers VS Code; so even in the browser you can use some VS Code features, like hovering on class names to see their CSS output.
And as for:
and check dependencies yourself
...upload your project to GitHub (a private repo, if you want) and use Dependabot to check dependencies for you. I log into work in the morning to automatic Pull Requests that update one dep each, I double-check that tests ran properly and read release notes, and then I approve and merge them. Done deal.
1
u/fred_from_earth Apr 12 '22
CLI? Post CSS? what' the difference?
I'm reluctant to use Playground site or something like that, since I've used tailwind for other projects before and it worked fine. I wonder if I made the wrong installation back then and I don't know which one it was and why one would be better than another.
I tried to push the project to github, see my other recent answer to this thread. Doesn't work though, working on it…
1
u/GriceTurrble Apr 12 '22
what' the difference?
Tailwind includes a CLI (command line interface) for creating builds.
PostCSS is a whole other package. Tailwind can integrate with PostCSS.
If you take the time to read through the links I'm including in these comments, you can learn how these things work.
1
13
u/OrionPrimeX Apr 11 '22
Not sure what is going on with you, but I recently followed their docs for starting Tailwind and i was up and running in ACTUALLY 3 minutes. No copying files, nothing.
Dont blame Tailwind for this, it’s you.
2
Nov 11 '23
my head is spinning for like 4 days how you guys are installing in 3min. teach me this superpower
2
2
u/machinetranslator Jun 09 '24
Yeah no. Even after two years, nothing has changed. Cant get the thing working while following the simple instructions. If something this easy doesnt work, its on them
7
u/TheWarDoctor Apr 11 '22
Tailwind is a little more involved on the config side at first, but the benefits far outweigh that initial time. 9 times out of 10 if my styles aren't applying, I usually forgot to add it to the content array in the config file.
However without a public project it might be hard for other to diagnose the issue.
1
1
u/replayjpn Apr 12 '22
What framework are you coding for? Also which Code Editor? VSCode with the Tailwind Snippets works well together.
I started with Vuejs & found Nuxt to not be compatible with Tailwind at the time so I started to learn React.
Also for some reason in React after typing className="" I have to write a space before the tailwind options show up.
1
1
u/rksmartus Apr 11 '22
You can check tutorial how to install and use it. https://www.youtube.com/watch?v=DYPpergnlVg
1
u/braedenf Apr 11 '22
https://tailwindcss.com/docs/installation I find this guide works in most cases, I use it with the Vite build tool though.
1
u/oh_jaimito Apr 12 '22
Are you trying to get this started on a simple HTML/CSS project or Vue, Vite? Something else?
I made this months ago, no longer use it and haven't really made any attempt to update it since January.
https://github.com/jjaimealeman/my-static-boilerplate2.git
live here https://my-static-boilerplate2.netlify.app/
Decent Lighthouse scores 93-97-100-92.
git clone
npm i
npm run devYou should be good to go. This was for older projects and if it helps you - I'm glad!
2
Nov 23 '24
This is so useful. You've actually confirmed that something is horribly wrong with my setup haha - can't see any styling from Tailwind even with all this!
2
u/fred_from_earth Apr 12 '22
OK, now trying to "push" the project to github (first time doing this).
Holy cow, what a hassle to get this done and still no success… because why make it easy if you can make it complicated, right?
here's the repository, which i reckon is not accessible
https://github.com/bbblgmsp/tailwind_stuff.git
also, the tailwindcss folder, which is the most important one, is wrong, somehow, with all my trial and error of pushing my project to git, it put the entire project into that folder again. Why? I know not. Deleting that folder seems impossible, the UI is super unusual and all seems to be done via shell script :(
it's ironic, feels like moving backwards. Yesterday troubleshooting tailwind, now troubleshooting github…