tailwindlabs / tailwindcss-setup-examples

674 stars 173 forks source link

Tailwinds not working #52

Closed Parables closed 4 years ago

Parables commented 4 years ago

I followed the steps on the README to add Tailwinds. But I don't see any effect on my elements when I add Tailwind classes. What am I doing wrong?

Here's my template: https://github.com/Parables/svelte-tailwindcss-template.

Someone please check it out for me and point out what am missing

adamwathan commented 4 years ago

You missed the step where you add your compiled Tailwind CSS file to your index.html file:

https://github.com/tailwindcss/setup-examples/blob/master/examples/svelte/public/index.html#L13

Parables commented 4 years ago

Thanks very much Mr. Adam Wathan, I have added <link rel="stylesheet" href="index.css"> to the public/index.html .

When I run npm run start:dev I get this:

  - Local:      http://localhost:5000

────────────────── LOGS ──────────────────

  [15:05:19] 200 ─ 8.32ms ─ /
  [15:05:19] 404 ─ 1.29ms ─ /bundle.css
  [15:05:19] 404 ─ 0.36ms ─ /bundle.js

404 means its missing right?

But I have it in my public/build directory... What do I do?

Parables commented 4 years ago

Yep, I figured I had to change: <link rel='stylesheet' href='bundle.css'>
to
<link rel='stylesheet' href='build/bundle.css'>

and

<script src='bundle.js'></script>
to
<script src='build/bundle.js'></script>

Works perfectly now :100: :+1: :smile:

Tailwind is simply amazing.

Parables commented 4 years ago

Am closing this issue now since it's been resolved