Skip to content

Add ASP.NET Web App Core support #2043

Open
@Marko97IT

Description

@Marko97IT

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 "http://github.com/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="http://github.com/~/css/tailwind.css" asp-append-version="true" />

Step 6.
Build and try.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions