Tailwind_Basic_Installation Tailwind Templates

Tailwind_basic_installation

Simple project to get to know about installation process of tailwind css

Tailwind_Basic_Installation

Simple project to get to know about installation process of tailwind css

Process to install and use it :--

  1. Install Tailwind CSS npm install -D tailwindcss npx tailwindcss init

  2. Configure your template paths Add the paths to all of your template files in your tailwind.config.js file.

    ```
    /** @type {import('tailwindcss').Config} */
    
    module.exports = {
    content: ["./src/**/*.{html,js}"],
    theme: {
    extend: {},
    },
    plugins: [],
    }
    
    ```
    
  3. Add the Tailwind directives to your CSS Add the @tailwind directives for each of Tailwind’s layers to your main CSS file.

    ```
    @tailwind base;
    @tailwind components;
    @tailwind utilities;
    ```
    
  4. Start the Tailwind CLI build process Run the CLI tool to scan your template files for classes and build your CSS.

    npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch

  5. Start using Tailwind in your HTML Add your compiled CSS file to the and start using Tailwind’s utility classes to style your content.

    <!doctype html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="/dist/output.css" rel="stylesheet">
    </head>
    <body>
    <h1 class="text-3xl font-bold underline">
        Hello world!
    </h1>
    </body>
    </html>
    

Top categories

Loading Svelte Themes