TailBlazor icon indicating copy to clipboard operation
TailBlazor copied to clipboard

Tailwind standalone CLI

Open hugh-maaskant opened this issue 3 years ago • 3 comments

Hi

Thanks for the awesome TailBlazor explanations on the what, the how, and especially the why :-).

Have you seen this blog post: https://tailwindcss.com/blog/standalone-cli ? With it npm and all that jazz (which is outside of the normal .NET development workflow / know-how) is not needed anymore (at least for simple setups).

I wonder if you would want to include a version of the install with just the standalone CLI; it should simplify things quite a bit I think.

Thanks for reading and perhaps considering this suggestion!

hugh-maaskant avatar Dec 23 '21 17:12 hugh-maaskant

Yep, i was excited when i noticed it but was disappointed as i read on. I imagine it's a temporary limitation, but third-party plugins (either Tailwind or PostCSS) are a no-go with the new CLI. (from the blog post: "If Tailwind was the only reason you had a package.json file, this is probably going to feel like a nicer solution.")

(edit for clarification: got mixed up, worded as if i were replying to an issue on tailblazor-templates) I touch on it in the template itself and go into it a bit more here (scroll down a bit to 'Tailwind CSS scaffolding') - the 'postcss-import' PostCSS plugin is how i pull in Blazor's CSS Isolation bundle, and it has to be installed via NPM. That one's essential, but there are other handy third-party plugins as well: debug-screens is great.

I assume future versions of the standalone CLI will have a way to pull in third-party PostCSS and Tailwind plugins, but not yet... I'm going to pin this issue because the new CLI is important and i will be keeping my eye on it, but also going to apply a "wontfix" label - for now !

McNerdius avatar Dec 23 '21 17:12 McNerdius

A bit of brainstorming, in context of tailblazor-templates:

  • Ideal case would be their new CLI adds third party plugin support. The CLI is 35MB - would it be bundled or user installed ?; plugins would still have to be installed somehow. The current templates require node.js itself to be installed, but the plugins installation is taken care of in the csproj/targets file. What would the steps look like using standalone CLI ?
  • If it becomes apparent that third-party plugins won't be supported by the new CLI, a set of templates specific to that scenario could happen - but how would they support CSS Isolation ? Or would they ? Too early to tell if support will/won't happen.
  • TailwindCSS can HOG some memory. This is a big reason i'm keeping my eye on the new CLI... Fingers crossed.
  • ...

McNerdius avatar Dec 23 '21 18:12 McNerdius

Hi

Thanks for the ultra quick reply.

I imagine it's a temporary limitation, but third-party plugins (either Tailwind or PostCSS) are a no-go with the new CLI.

Note that they did include their own plugins:

We’ve even bundled the latest versions of all of our first-party plugins, so if you want to use them in your project, just require them in your tailwind.config.js file like you would in a Node-based project

From their description on how they do it, there is no fundamental reason why they could not bundle other plugins (licenses permitting), but that would quickly become a “select which ones to include and maintenance nightmare. So I doubt they will do so soon.

but also going to apply a "wontfix" label - for now !

That is fine, is your prerogative of course,, I just wanted to make sure you were aware of this CLI,, that all.

Thanks again for the write-up. I will start experimenting with it very soon :-)

Best regards, Hugh

—— Hugh Maaskant The Netherlands

On Dec 23, 2021, at 18:49, McNerdius @.***> wrote:

Yep, i was excited when i noticed it but was disappointed as i read on. I imagine it's a temporary limitation, but third-party plugins (either Tailwind or PostCSS) are a no-go with the new CLI. (from the blog post: "If Tailwind was the only reason you had a package.json file, this is probably going to feel like a nicer solution.")

I touch on it in the template itself and go into it a bit more here https://www.tailblazor.dev/setup#scaffold (scroll down a bit to 'Tailwind CSS scaffolding') - the 'postcss-import' PostCSS plugin is how i pull in Blazor's CSS Isolation bundle, and it has to be installed via NPM. That one's essential, but there are other handy third-party plugins as well: debug-screens https://github.com/jorenvanhee/tailwindcss-debug-screens is great.

I assume future versions of the standalone CLI will have a way to pull in third-party PostCSS and Tailwind plugins, but not yet... I'm going to pin this issue because the new CLI is important and i will be keeping my eye on it, but also going to apply a "wontfix" label - for now !

— Reply to this email directly, view it on GitHub https://github.com/McNerdius/TailBlazor/issues/99#issuecomment-1000448261, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABOUXQHWDTPPT7ZUEHCY35LUSNOJHANCNFSM5KVFU6WQ. You are receiving this because you authored the thread.

hugh-maaskant avatar Dec 23 '21 18:12 hugh-maaskant