« Tailwind CSS » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
Aucun résumé des modifications
Ligne 8 : Ligne 8 :
</kode>
</kode>


<filebox fn='tailwind.config.js' collapsed>
== Configuration ==
<filebox fn='tailwind.config.js'>
/** @type {import('tailwindcss').Config} */
/** @type {import('tailwindcss').Config} */
module.exports = {
module.exports = {
   content: [],
   content: [
    './**/*.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: {
   theme: {
     extend: {},
     extend: {},
Ligne 19 : Ligne 28 :
</filebox>
</filebox>


<filebox fn='postcss.config.js' collapsed>
<filebox fn='postcss.config.js'>
module.exports = {
module.exports = {
   plugins: {
   plugins: {

Version du 9 janvier 2025 à 18:46

Integration with Blazor

Installation

Ps.svg
# 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 = {
  content: [
    './**/*.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: {},
  },
}