Tailwind v1.4 with Next.js purging my entire CSS #1678
deadcoder0904
started this conversation in
General
Replies: 2 comments 2 replies
-
Added module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
} & it worked. But unfortunately, it drops
For example, const Item = (color = 'yellow') => {
return <div className={`text-${color}-500`}>...</div>
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
Did the following & it worked: module.exports = {
purge: {
content: ['./components/**/*.js', './pages/**/*.js'],
options: {
whitelist: ['text-pink-500', 'text-yellow-500'],
},
},
theme: {
extend: {},
},
variants: {},
plugins: [],
} @adamwathan Is this the way of doing it for dynamic props? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
My earlier setup was working but had 1 issue. It was purging some text-utilities like
text-pink-500
my website was using. So I decided to upgrade it. I followed https://statickit.com/guides/next-js-tailwind to add Tailwind support to Next.jsNow I deleted
postcss.config.js
& added thepurge
property totailwind.config.js
:For reference my
styles.css
is as follows:as the above guide mentioned. Rest is also same as the Statickit guide. Not sure why it isn't working?
process.env.NODE_ENV
is also set toproduction
when I doyarn build
which triggersnext build
Beta Was this translation helpful? Give feedback.
All reactions