Skip to content
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

Merged
merged 3 commits into from
Feb 7, 2022
Merged

feat: migrate to tailwind v3 #407

merged 3 commits into from
Feb 7, 2022

Conversation

dargmuesli
Copy link
Contributor

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.

Copy link
Contributor Author

@dargmuesli dargmuesli left a 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 ⚡️
Copy link
Contributor Author

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)
Copy link
Contributor Author

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
Copy link
Contributor Author

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: {
Copy link
Contributor Author

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. -->
Copy link
Contributor Author

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: [
Copy link
Contributor Author

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",
Copy link
Contributor Author

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">
Copy link
Contributor Author

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'
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

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! 🎊

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.

Copy link
Contributor

@sasial-dev sasial-dev left a 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')
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@sasial-dev
Copy link
Contributor

FYI @dargmuesli, a rebase is required for tailwind 3.0.1 from nuxt-community:renovate/tailwindcss-3.x.
You'll be able to rebase it from the branch, as nuxt-community:renovate/tailwindcss-3.x has already been pushed by @renovate-bot.

@dargmuesli dargmuesli changed the base branch from renovate/tailwindcss-3.x to main December 11, 2021 11:47
@dargmuesli
Copy link
Contributor Author

I've updated the PR to v3.0.1 and changed the base branch, I mistakenly set to the renovate branch, to main.

@RKAN
Copy link

RKAN commented Dec 13, 2021

Any updates here? Can i use this already?

@mklueh
Copy link

mklueh commented Dec 14, 2021

Let's go go go

@dargmuesli
Copy link
Contributor Author

Please react with a 👍 or ❤️ to the original PR comment instead of adding more encouraging comments, which trigger notifications for everyone.

@hoektoe
Copy link

hoektoe commented Dec 28, 2021

Can we deploy this for a good start to new year.

@davidurco
Copy link

Let's goooo!

@mklueh
Copy link

mklueh commented Dec 28, 2021

@dargmuesli could you please clarify what is blocking you from merging this pull request? Is something still missing?

@dargmuesli
Copy link
Contributor Author

what is blocking you from merging this pull request?

My permissions for this repository.

@christopher4lis
Copy link

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.

@ctwhome
Copy link

ctwhome commented Dec 29, 2021

this kind of passiveness IMO is killing the nuxt module ecosystem. In any case my patience 😓

@davidurco
Copy link

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?

@gomorizsolt
Copy link

gomorizsolt commented Dec 29, 2021

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.

@ctwhome
Copy link

ctwhome commented Dec 29, 2021 via email

@ctwhome
Copy link

ctwhome commented Dec 30, 2021

I have the integration with the raw tailwindcss and nuxt 3 here https://github.com/ctwhome/top-nuxt3

@eliyas5044
Copy link

Temporary solution
Forked and merged this PR and created a separate package.
@eliyas5044/tailwindcss

Copy link

@7ochem 7ochem left a 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? 🙏🏻

@aviramaz
Copy link

@atinux @pi0 will be extremely thankful for this PR to be published 🙏🏻

@KaduMoura
Copy link

KaduMoura commented Feb 3, 2022

Hi @btkostner @sasial-dev @medairbit @7ochem @atinux @pi0 ,

could you PLEASE merge this PR? this would help greatly all of us..

thanks!

@doostinharrell
Copy link

Temporary solution Forked and merged this PR and created a separate package. @eliyas5044/tailwindcss

Thanks @eliyas5044! Your NPM module worked for me. Hopefully full v3 support rolls out soon.

@pi0
Copy link
Contributor

pi0 commented Feb 7, 2022

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.

@pi0 pi0 changed the title feat(tailwind): migrate to v3 feat: migrate to tailwind v3 Feb 7, 2022
@pi0 pi0 merged commit eacaa5e into nuxt-modules:main Feb 7, 2022
@pi0
Copy link
Contributor

pi0 commented Feb 8, 2022

Alpha version released as 5.0.0-0. Release notes: https://github.com/nuxt-community/tailwindcss-module/releases/tag/v5.0.0-0

@dargmuesli dargmuesli deleted the renovate/tailwindcss-3.x branch February 8, 2022 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade to Tailwind CSS v3.0