tailwindlabs / tailwindcss

A utility-first CSS framework for rapid UI development.
https://tailwindcss.com/
MIT License
83.05k stars 4.21k forks source link

config file doesnt work if its in a sub directory #4479

Closed Dania99dev closed 3 years ago

Dania99dev commented 3 years ago

What version of Tailwind CSS are you using?

v2.1.2

What build tool (or framework if it abstracts the build tool) are you using?

Vue.js 3.0.5, Vite 2.3.4

What version of Node.js are you using?

v14.17.0

What browser are you using?

Chrome

What operating system are you using?

Windows

Reproduction repository

https://github.com/Dania99dev/mevn-boilerplate/tree/tailwind

Describe your issue

I wanna work with MEVN stack in this structure:

root
|__ node_modules
|__ Client
    |__ Vite + Vue + TS files
|__ Backend
    |__ Express + TS files

and my tailwind.config.js is inside the Client directory. it works if I put it in the root dir, but it doesn't work inside the Client dir

Dania99dev commented 3 years ago

I guess we need a root option in config file to specify the directory of node_modules folder

danilokorber commented 3 years ago

4355

bradlc commented 3 years ago

Hey @Dania99dev. If your config file is not at the project root then you need to specify the path in your PostCSS config, like so:

module.exports = {
  plugins: {
    tailwindcss: { config: './client/tailwind.config.js' },
    autoprefixer: {},
  },
}