-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: migrate to tailwind v3 #407
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are some explaining notes.
@@ -16,8 +16,6 @@ | |||
## Features | |||
|
|||
- 👌 Zero configuration to start *([see video](https://tailwindcss.nuxtjs.org/#quick-start))* | |||
- 🗜 PurgeCSS included for minimal CSS ⚡️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not included now anymore.
@@ -16,8 +16,6 @@ | |||
## Features | |||
|
|||
- 👌 Zero configuration to start *([see video](https://tailwindcss.nuxtjs.org/#quick-start))* | |||
- 🗜 PurgeCSS included for minimal CSS ⚡️ | |||
- ⚡️ Supports [Tailwind Just-In-Time](https://github.com/tailwindlabs/tailwindcss-jit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the default engine now.
@@ -77,26 +77,6 @@ Discover your color palette based on your Tailwind config with the [Tailwind vie | |||
|
|||
</d-alert> | |||
|
|||
|
|||
## Tailwind Just-In-Time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default now, as mentioned above.
@@ -113,11 +113,9 @@ export default { | |||
tailwindcss: { | |||
config: { | |||
/* Extend the Tailwind config here */ | |||
purge: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new content syntax.
@@ -5,6 +5,7 @@ csb_link: https://codesandbox.io/embed/nuxt-dark-tailwindcss-17g2j | |||
fullscreen: true | |||
--- | |||
|
|||
<!-- TODO: Replace with tailwind's native dark mode support. --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for a plugin demo.
} | ||
} | ||
// Whitelisting some classes to avoid content purge | ||
safelist: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new way to do safelists.
@@ -11,9 +11,10 @@ | |||
"license": "MIT", | |||
"homepage": "https://tailwindcss.nuxtjs.org", | |||
"devDependencies": { | |||
"autoprefixer": "^10.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall be a dev dependency according to tailwind's installation instructions.
@@ -6,7 +6,7 @@ | |||
<span class="block">Ready to dive in?</span> | |||
<span class="block text-indigo-600">Start your free trial today.</span> | |||
</h2> | |||
<div class="flex mt-8 lg:mt-0 lg:flex-shrink-0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now a recommended shorthand.
@@ -1,3 +1 @@ | |||
export default { | |||
mode: 'jit' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default now, you get it ;)
@@ -56,7 +56,7 @@ async function tailwindCSSModule (moduleOptions) { | |||
logger.info(`Merging Tailwind config from ~/${relative(this.options.srcDir, configPath)}`) | |||
// Transform purge option from Array to object with { content } | |||
if (Array.isArray(tailwindConfig.purge)) { | |||
tailwindConfig.purge = { content: tailwindConfig.purge } | |||
tailwindConfig.content = tailwindConfig.purge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check this part especially for mistakes on my end! The tests run fine, tough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good on my end! 🎊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this whole clause of transforming the purge option from Array to object is no longer required, the users should change this in their tailwind config according to the tailwind guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick comment:
if (tailwindConfig.mode === 'jit') { | ||
logger.info('Tailwind JIT activated') | ||
if (options.mode === 'jit') { | ||
logger.warn('`tailwindcss.mode: \'jit\'` option is unnecessary as it\'s now the default') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you want to warn for using the "mode" anyway?
As iirc there's no other modes now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand you correctly in that you propose for it to show a warning whenever a mode is set, that would mean any upcoming mode - if there will be any - will throw a warning unless accounted for again in this repo's code. I'd stay at warning only for the default mode.
bb7709b
to
cd9de71
Compare
FYI @dargmuesli, a rebase is required for tailwind 3.0.1 from |
I've updated the PR to v3.0.1 and changed the base branch, I mistakenly set to the renovate branch, to main. |
Any updates here? Can i use this already? |
Let's go go go |
Please react with a 👍 or ❤️ to the original PR comment instead of adding more encouraging comments, which trigger notifications for everyone. |
Can we deploy this for a good start to new year. |
Let's goooo! |
@dargmuesli could you please clarify what is blocking you from merging this pull request? Is something still missing? |
My permissions for this repository. |
Anyone looking to upgrade without having to wait should check out Tailwind's integration docs for Nuxt: https://tailwindcss.com/docs/guides/nuxtjs Reduces a dependency and works absolutely perfectly. |
this kind of passiveness IMO is killing the nuxt module ecosystem. In any case my patience 😓 |
Why would I use this tailwindcss-module then? |
I'm not sure either - it's literally just a matter of minutes to install & configure Tailwind CSS with Nuxt.js. |
Well, it is more convinient to use the module because literally it is just
adding one word to the nuxt-config build modules. It also brings the style
guide for example, and in principle it could be customized as much as they
wanted.
The big problem on the contrary is the maintenance and the dependencies.
When it works, it is very good, but when it doesn't, or gets dated it stays
in the middle creating more problems than solving.
I wish the nuxt modules, somehow, would implement an interface that
supplements the official things, in this case tailwindcss, rather than
wrapping it, so the updates could be much easier
…On Wed, Dec 29, 2021, 17:58 Zsolt Gomori ***@***.***> wrote:
Anyone looking to upgrade without having to wait should check out
Tailwind's integration docs for Nuxt:
https://tailwindcss.com/docs/guides/nuxtjs
Reduces a dependency and works absolutely perfectly.
Why would I use this tailwindcss-module then?
I'm not sure either - it's literally just a matter of minutes to install &
configure Tailwind CSS with Nuxt.js.
—
Reply to this email directly, view it on GitHub
<#407 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABAAJXRFMLFR53GVPSL5TZ3UTM4ZTANCNFSM5JX2QIZA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I have the integration with the raw tailwindcss and nuxt 3 here https://github.com/ctwhome/top-nuxt3 |
Temporary solution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this PR in a project and it works great! Anyone who can get this PR forward? @atinux maybe? 🙏🏻
Hi @btkostner @sasial-dev @medairbit @7ochem @atinux @pi0 , could you PLEASE merge this PR? this would help greatly all of us.. thanks! |
Thanks @eliyas5044! Your NPM module worked for me. Hopefully full v3 support rolls out soon. |
Thank you @dargmuesli for your efforts on this PR 💚 Sorry it took long we had to wait for proper Nuxt3 module tooling. Will throw an alpha release in few hours. |
Alpha version released as |
Supersedes #405. Closes #406. I did all updates necessary I could think of.
Besides my update to
jit
& co I'd like to propose having this Nuxt plugin's documentation only include configuration specific to itself and not having it duplicate tailwindcss documentation which might get outdated here. But that's for another day.