"create react app and tailwind" Code Answer's
You're definitely familiar with the best coding language Javascript that developers use to develop their projects and they get all their queries like "create react app and tailwind" answered properly. Developers are finding an appropriate answer about create react app and tailwind related to the Javascript coding language. By visiting this online portal developers get answers concerning Javascript codes question like create react app and tailwind. Enter your desired code related query in the search bar and get every piece of information about Javascript code related question on create react app and tailwind.
create react app and tailwind
1. npx create-react-app .
2. npm i -D tailwindcss postcss-cli autoprefixer
or
npm install tailwindcss@latest postcss@latest autoprefixer@latest
//postcss - transform our compile css
// autoprefixer - set vendor prefixes within our css automatically when needed
//Generate npc config file
3.npx tailwind init tailwind.js --full
// Create post css config file
4. touch postcss.config.js
//open postcss.config.js
//add this to the file
__________________________________________
const tailwindcss = require('tailwindcss');
module.exports = {
plugins: [
tailwindcss('./tailwind.js'),
require('autoprefixer')
]
}
__________________________________________
5. inside scr, create assets folder src/assets
- create tailwind.css and main.css
in tailwind, add this code
//this will compile to the main css that will include in our app
___________________________________________
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
___________________________________________
6. Open package.json and add this iside the scripts
___________________________________________
"start": "npm run watch:css && react-scripts start",
"build": "npm run build:css && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"build:css": "postcss src/assets/tailwind.css -o src/assets/main.css",
"watch:css": "postcss src/assets/tailwind.css -o src/assets/main.css"
____________________________________________
7. run 'npm start'
add this to index.js
_____________________________________
import React from 'react';
import ReactDOM from 'react-dom';
import './assets/main.css';
import App from './App';
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
_________________________________
install router
1. npm i --save react-router-dom
Source: www.smashingmagazine.com
how to properly install tailwind css in react
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
Source: www.smashingmagazine.com
how to properly install tailwind css in react
"scripts": {
"start": "npm run watch:css && react-scripts start",
"build": "npm run watch:css && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"watch:css": "postcss src/assets/tailwind.css -o src/assets/main.css"
}
Source: www.smashingmagazine.com
All those coders who are working on the Javascript based application and are stuck on create react app and tailwind can get a collection of related answers to their query. Programmers need to enter their query on create react app and tailwind related to Javascript code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about create react app and tailwind for the programmers working on Javascript code while coding their module. Coders are also allowed to rectify already present answers of create react app and tailwind while working on the Javascript language code. Developers can add up suggestions if they deem fit any other answer relating to "create react app and tailwind". Visit this developer's friendly online web community, CodeProZone, and get your queries like create react app and tailwind resolved professionally and stay updated to the latest Javascript updates.