« Tailwind CSS » : différence entre les versions
De Banane Atomic
Aller à la navigationAller à la recherche
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 1 : | Ligne 1 : | ||
[[Category:Web]] | [[Category:Web]] | ||
= Links = | |||
* [] | |||
= Integration with Blazor = | = Integration with Blazor = | ||
== Installation == | == Installation == | ||
Ligne 8 : | Ligne 11 : | ||
</kode> | </kode> | ||
== Configuration == | == [https://tailwindcss.com/docs/configuration Configuration] == | ||
<filebox fn='tailwind.config.js'> | <filebox fn='tailwind.config.js'> | ||
/** @type {import('tailwindcss').Config} */ | /** @type {import('tailwindcss').Config} */ |
Version du 9 janvier 2025 à 22:44
Links
- []
Integration with Blazor
Installation
# from the root of your blazor project npx tailwindcss init -p # it will create the files tailwind.config.js and postcss.config.js |
Configuration
tailwind.config.js |
/** @type {import('tailwindcss').Config} */ module.exports = { prefix: 'tw-', // prefix Tailwind classes to avoid conflicts with MudBlazor content: [ './**/*.{razor,html}' './**/*.razor', // Scan all Razor components './wwwroot/index.html', // Include the entry point for Blazor './**/*.cshtml', // If you use cshtml files './**/*.html', // Include any static HTML './**/*.js', // For JavaScript files './**/*.cs', // If you dynamically generate classes './node_modules/mudblazor/**/*.js', // MudBlazor components ], theme: { extend: {}, }, plugins: [], } |
postcss.config.js |
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {}, }, } |
Build
wwwroot/css/tailwind.css |
@tailwind base; @tailwind components; @tailwind utilities; |
npx tailwindcss -i ./wwwroot/css/tailwind.css -o ./wwwroot/css/tailwind.generated.css --watch |
Integration
Pages/_Host.cshtml |
<head> <link href="css/tailwind.generated.css" rel="stylesheet" /> |