PostCSS and @import with postcss-import? #1761
jenstornell
started this conversation in
General
Replies: 2 comments 5 replies
-
I was looking at the wrong place, I was looking in https://tailwindcss.com/docs/installation but the solution to the problem is in https://tailwindcss.com/docs/using-with-preprocessors/. In short, the import needs to be placed first in both files. postcss.config.jsmodule.exports = {
plugins: [
require('postcss-import'), // postcss-import needs to be first
require('tailwindcss'),
require('postcss-nesting'),
require('autoprefixer')
]
} tailwind.config.js@import "testing.css";
@tailwind base;
@tailwind components;
@tailwind utilities; |
Beta Was this translation helpful? Give feedback.
1 reply
-
After looking for last 3 days this help me a lots. Thanks man. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To have my imported css to be inlined in the same file as the rest, I tried to install
postcss-import
. The reason for a file import in my case is to drag in some old css from a previous version of my site.postcss.config.js
I have
postcss-import
installed.tailwind.config.js
Error message
So it wants me to place the
@import
first in the file. Moving the file first will break thenpm run build
process.Question
Is there a good way around this? With
postcss-import
or anything else?Beta Was this translation helpful? Give feedback.
All reactions