Skip to content

Add ASP.NET Web App Core support #2043

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

Open
Marko97IT opened this issue Jan 31, 2025 · 3 comments
Open

Add ASP.NET Web App Core support #2043

Marko97IT opened this issue Jan 31, 2025 · 3 comments

Comments

@Marko97IT
Copy link

Marko97IT commented Jan 31, 2025

Please, in the documentation add the support for ASP.NET Web App Core in Framework Guides. I tried it and works good.

Step 1.
Run this comand in the project folder.

npm install tailwindcss @tailwindcss/cli

Step 2.
In wwwroot/css/site.css add this row in the first line.

@import "tailwindcss";

Step 3.
Edit the package.json file and paste it after dependencies.

"scripts": {
  "tailwindcss:build": "npx @tailwindcss/cli -i ./wwwroot/css/site.css -o ./wwwroot/css/tailwind.css"
}

Step 4.
Edit the .csproj file and add this.

<Target Name="Build Tailwind CSS" BeforeTargets="Build">
  <Exec Command="npm run tailwindcss:build"/>
</Target>

Step 5.
In the _Layout.cshtml file add the reference of Tailwind.

<link rel="stylesheet" href="~/css/tailwind.css" asp-append-version="true" />

Step 6.
Build and try.

@philipp-spiess
Copy link
Member

@Marko97IT This doesn't seem to include a dev mode setup. How does development work with ASP.NET Core? Do you always need a full build of your website for every local change?

@Marko97IT
Copy link
Author

@Marko97IT This doesn't seem to include a dev mode setup. How does development work with ASP.NET Core? Do you always need a full build of your website for every local change?

Simply, every time I make a change to the project and build, the css is recompiled. This is useful when you work on cshtml files because it is a dynamic update and takes just a few seconds.

@philipp-spiess
Copy link
Member

Hm, I see. Doing a full build from scratch is super wasteful though, if we are able to use the CLI --watch mode instead things would take milliseconds at most. Let me find some time next week to look into it 👍

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

No branches or pull requests

2 participants