Skip to content

Commit 70c4769

Browse files
Merge pull request #169 from anandgupta193/features/tailwindcss
Added tailwind css support
2 parents d594077 + a5e4b12 commit 70c4769

File tree

7 files changed

+45
-0
lines changed

7 files changed

+45
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137
"style-loader": "^3.3.2",
138138
"stylelint": "^15.6.0",
139139
"stylelint-webpack-plugin": "^4.1.1",
140+
"tailwindcss": "^3.3.1",
140141
"webpack": "^5.80.0",
141142
"webpack-bundle-analyzer": "^4.6.1",
142143
"webpack-cli": "^5.0.2",

postcss.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const autoprefixer = require('autoprefixer');
2+
const tailwindcss = require('tailwindcss');
23

34
module.exports = {
45
plugins: [
6+
tailwindcss('./tailwind.config.js'),
57
autoprefixer,
68
],
79
};

src/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

src/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { createRoot } from 'react-dom/client';
44
import { Provider } from 'react-redux';
55
import Routes from './routes/Routes';
66
import Store from './redux/store';
7+
import './index.css';
78

89
const container = document.getElementById('root');
910
const root = createRoot(container);

tailwind.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
content: ['./src/**/*.{js,jsx}', './public/index.html'],
3+
theme: {
4+
extend: {
5+
colors: {
6+
// define all the base colors
7+
primary: '#1B73E8',
8+
},
9+
},
10+
},
11+
plugins: [],
12+
};

webpack/client/webpack.common.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ module.exports = {
4646
loader: 'babel-loader',
4747
},
4848
},
49+
{
50+
test: /\.css$/i,
51+
use: [
52+
'style-loader',
53+
'css-loader',
54+
{
55+
loader: 'postcss-loader',
56+
options: {
57+
sourceMap: isDevEnv,
58+
},
59+
}
60+
],
61+
},
4962
{
5063
test: /\.scss$/,
5164
use: [

webpack/server/webpack.common.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ module.exports = {
2727
loader: 'babel-loader',
2828
},
2929
},
30+
{
31+
test: /\.css$/i,
32+
use: [
33+
'style-loader',
34+
'css-loader',
35+
{
36+
loader: 'postcss-loader',
37+
options: {
38+
sourceMap: isDevEnv,
39+
},
40+
}
41+
],
42+
},
3043
{
3144
test: /\.scss$/,
3245
use: [

0 commit comments

Comments
 (0)