<p>I'm not 100% sure, but I think you just need to point Tailwind to the directories/files where it should scan for class names - in your case this might be simply <code>templates</code>. Add this in tailwind.config.js:</p>
<pre class="lang-js prettyprint-override"><code>/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ['templates/**/*.twig'],
  ...
}
</code></pre>

CC BY-SA 4.0
2023-02-15T15:28:13.907Z
Idk how you feel about it, but I could quite literally kiss you right now. Thanks mate!
Jorge Anzola
CC BY-SA 4.0
2023-02-20T08:34:21.913Z
ha ha, glad it helped!
James Smith
CC BY-SA 4.0
2023-02-15T15:04:14.560Z
2023-02-15T15:04:14.560Z
James Smith
<p>There is an existing Craft / Vite / Docker / Tailwind boilerplate out there.</p>
<p><a href="https://github.com/nystudio107/craft" rel="nofollow noreferrer">https://github.com/nystudio107/craft</a></p>
<p>You can have a look here.</p>

CC BY-SA 4.0
2023-02-20T12:24:24.653Z
2023-02-20T12:24:24.653Z
Michael Thomas
<p>I'm working on a CraftCMS 4 + Vite + TailwindCSS + Docker Boilerplate. And it's almost working, except for the fact that I'm importing</p>
<pre><code>@import &quot;tailwindcss/base&quot;;
@import &quot;tailwindcss/components&quot;;
@import &quot;tailwindcss/utilities&quot;;
</code></pre>
<p>but in my frontend there are no styles. There is something imported there, but I don't think it's the correct stuff. I'm very new to Tailwind (and Vite) so I'm not sure if I'm doing something wrong.</p>
<p>Here you can see more details <a href="https://github.com/JorgeAnzola/craft-4-boilerplate/issues/1" rel="nofollow noreferrer">https://github.com/JorgeAnzola/craft-4-boilerplate/issues/1</a></p>

<frontend>
Help with Tailwind import
# Help with Tailwind import

(Asked by: username_0 on 2023-02-15)

I'm working on a CraftCMS 4 + Vite + TailwindCSS + Docker Boilerplate. And it's almost working, except for the fact that I'm importing
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";

but in my frontend there are no styles. There is something imported there, but I don't think it's the correct stuff. I'm very new to Tailwind (and Vite) so I'm not sure if I'm doing something wrong.
Here you can see more details https://github.com/JorgeAnzola/craft-4-boilerplate/issues/1

**Tags:** frontend


---

## 2 answers

### Answer by username_1 on 2023-02-15. Score: 3 | Accepted answer

I'm not 100% sure, but I think you just need to point Tailwind to the directories/files where it should scan for class names - in your case this might be simply templates. Add this in tailwind.config.js:
/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ['templates/**/*.twig'],
  ...
}

> **Comments:**
> **username_0**: Idk how you feel about it, but I could quite literally kiss you right now. Thanks mate!  
> **username_1**: ha ha, glad it helped!  

---

### Answer by username_2 on 2023-02-20. Score: 1

There is an existing Craft / Vite / Docker / Tailwind boilerplate out there.

<https://github.com/nystudio107/craft>

You can have a look here.


---

