Search
 
SCRIPT & CODE EXAMPLE
 

CSS

how to install tailwind css in html

    
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
    
Comment

tailwind install

Step 1:

npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9

Step 2:

npm install @craco/craco

Step 3:

package.json: 
{
    // ...
    "scripts": {

     "start": "craco start",

     "build": "craco build",

     "test": "craco test",

     "eject": "react-scripts eject"
    },
}

Step 4:

create craco.config.js at root

craco.config.js: 
module.exports = {
  style: {
    postcss: {
      plugins: [
        require('tailwindcss'),
        require('autoprefixer'),
      ],
    },
  },
}

Step 5:

npx tailwindcss-cli@latest init

Step 6:

// tailwind.config.js at root
  module.exports = {

   purge: [],

   purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],
    darkMode: false, // or 'media' or 'class'
    theme: {
      extend: {},
    },
    variants: {
      extend: {},
    },
    plugins: [],
  }

Step 7:

/* ./src/index.css */
@tailwind base;
@tailwind components;
@tailwind utilities;
Comment

install tailwind css

npm install -D tailwindcss postcss autoprefixer
npx tailwindcss init
Comment

tailwind css installation

   				  /*Follow the commands for Tailwind CLI*/
1. Initialize a node project in your directory:
           npm init -y
           
2. Install tailwindcss as a devDependency: 
           npm i -D tailwindcss
           
3. Install vs code plugin: Tailwind CSS IntelliSense (not for terminal)

4. Create a configuration file for tailwindcss: 
           npx tailwindcss init
           
5. Create src and output folder in root.

6. In src folder create a file named tailwind.css / (anyname).css

7. In src/tailwind.css write these : 
           @tailwind base;
           @tailwind components;
           @tailwind utilities
8. Create a folder named .vscode and ini this folder create a file 
   named settings.json. 
   
9. And paste this: 
           {
           	 "css.validate": false, 
             "tailwindCSS.emmetCompletions": true
           }
  this setting will help to not get erron after writing css

10. In scritps property in package.json file write a build property:

  "scripts": 
      "build": "tailwindcss -i ./src/tailwind.css -o ./output/tailwind.css -w"
      
11. Link tailwind in HTML like this href="./output/tailwind.css"

12. Now build tailwind: 
			npm run build 

13. Now you just have on task to complete which is content configuration: 
    See the configuration from here: 
         https://tailwindcss.com/docs/content-configuration
Comment

installation tailwind css in html

npx tailwindcss -i style.css -o tailwind.css
Comment

tailwindcss install

npm install tailwindcss --save-dev
Comment

tailwind installation

npx create-react-app app_name

npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9

npm install @craco/craco

Rimpiazza nel package.json:
  "start": "craco start",
  "build": "craco build",
  "test": "craco test",

Crea il file di configurazione:
// craco.config.js
module.exports = {
  style: {
    postcss: {
      plugins: [
        require('tailwindcss'),
        require('autoprefixer'),
      ],
    },
  },
}

Crea il file tailwind.config.js
	npx tailwindcss-cli@latest init
    
Ottimizzazioni:
// tailwind.config.js
mode: "jit",
purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'],

Includere tailwind:
  /* ./src/index.css */
  @tailwind base;
  @tailwind components;
  @tailwind utilities;
Comment

tailwind install

# using npm
npm i -D tailwind-styled-components

# using yarn
yarn add -D tailwind-styled-components
Comment

PREVIOUS NEXT
Code Example
Css :: how to center a div with position absolute 
Css :: css filters 
Css :: css scrollbar position to bottom 
Css :: how to make the header stay on the top of the page in html 
Css :: different measurements in css 
Css :: css border gradient 
Css :: css grid 1 row 2 columns 
Css :: reset div css 
Css :: scss ::after 
Css :: css focus change color 
Css :: css disabled 
Css :: css hide element 
Css :: css flex bottom 
Css :: css mauszeiger ändern 
Css :: background-attachment 
Css :: remove double quotes from string kotlin 
Css :: aligne center css 
Css :: closing modal on iframe movies still running 
Css :: how to put an element in front 
Css :: css h sizes 
Css :: primary hex code 
Css :: image to fill container size 
Css :: bootstrap mb 
Css :: login page design html css 
Css :: padding css shorthand 
Css :: text shadow css 
Css :: css properties in html 
Css :: cs cirlce 
Css :: Setting size for png icon in CSS 
Css :: scss darken color 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =