An open API service indexing awesome lists of open source software.

https://github.com/fritzthecat9/tailwindblazor

How to add Tailwind CSS to Blazor WASM project
https://github.com/fritzthecat9/tailwindblazor

blazor blazor-webassembly c-sharp csharp css tailwind-css tailwindcss

Last synced: 3 months ago
JSON representation

How to add Tailwind CSS to Blazor WASM project

Awesome Lists containing this project

README

          

## How to install tailwindcss to blazor project:
1. Go to ".\TailwindBlazor\TailwindBlazor" in CMD and run command:
```
npx tailwindcss init
```

2. The "tailwind.config.js" file will be created. Change it to:
```
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./**/*.{razor,html}'],
theme: {
extend: {},
},
plugins: [],
}
```

3. Create /Styles/tailwind.css file and change it to:
```
@tailwind base;
@tailwind components;
@tailwind utilities;
```

4. Add some tailwindcss classes to "Home.razor" component:
```
@page "/"
Home

Hello, world!


Welcome to your new app.
```

5. Add tailwind file to "index.html":
```

```

6. Comment out some code in "NavMenu.razor" that toogles nav menu (bug)
```


```

7. Run command to build tailwind and listen to changes:
```
npx tailwindcss -i .\Styles\tailwind.css -o .\wwwroot\css\tailwind.css --watch
```