ASP.NET Core MVC 的 Tailwind CSS

Tailwind CSS for ASP.NET Core MVC

我浏览了各种教程,它们要么直接没用,要么使用的是以前版本的 VS and/or ASP.NET.

如何在 MVC project 安装 tailwind CSS

我希望他们已经将 lib 发布到 copypaste 的资源文件中供大家自由使用。

How do you install tailwind css on a MVC project? I wish they had published the lib for everyone to copy and paste in their resource file and use it freely.

您可以尝试从 CDN 中包含 tailwind css,如下所示。

<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">

此外,您可以尝试通过the Add Client-Side Library dialog.

查找客户端库并将所需文件添加到您的项目中

我创建了这个 package,它添加了一个新的构建操作。

您只需设置 PackageReference 并将样式表的构建操作设置为 TailwindCSS。在构建过程中,样式表将通过 PostCSS 进行转换。

更详细的可以看一下GitHub repo.