Skip to content

Commit

Permalink
Merge pull request #169 from anandgupta193/features/tailwindcss
Browse files Browse the repository at this point in the history
Added tailwind css support
  • Loading branch information
anandgupta193 authored Apr 24, 2023
2 parents d594077 + a5e4b12 commit 70c4769
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"style-loader": "^3.3.2",
"stylelint": "^15.6.0",
"stylelint-webpack-plugin": "^4.1.1",
"tailwindcss": "^3.3.1",
"webpack": "^5.80.0",
"webpack-bundle-analyzer": "^4.6.1",
"webpack-cli": "^5.0.2",
Expand Down
2 changes: 2 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const autoprefixer = require('autoprefixer');
const tailwindcss = require('tailwindcss');

module.exports = {
plugins: [
tailwindcss('./tailwind.config.js'),
autoprefixer,
],
};
3 changes: 3 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
1 change: 1 addition & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { createRoot } from 'react-dom/client';
import { Provider } from 'react-redux';
import Routes from './routes/Routes';
import Store from './redux/store';
import './index.css';

const container = document.getElementById('root');
const root = createRoot(container);
Expand Down
12 changes: 12 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
content: ['./src/**/*.{js,jsx}', './public/index.html'],
theme: {
extend: {
colors: {
// define all the base colors
primary: '#1B73E8',
},
},
},
plugins: [],
};
13 changes: 13 additions & 0 deletions webpack/client/webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ module.exports = {
loader: 'babel-loader',
},
},
{
test: /\.css$/i,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
sourceMap: isDevEnv,
},
}
],
},
{
test: /\.scss$/,
use: [
Expand Down
13 changes: 13 additions & 0 deletions webpack/server/webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ module.exports = {
loader: 'babel-loader',
},
},
{
test: /\.css$/i,
use: [
'style-loader',
'css-loader',
{
loader: 'postcss-loader',
options: {
sourceMap: isDevEnv,
},
}
],
},
{
test: /\.scss$/,
use: [
Expand Down

0 comments on commit 70c4769

Please sign in to comment.