Skip to content

Commit

Permalink
feat: setup TailwindCSS (#934)
Browse files Browse the repository at this point in the history
* Install TailwindCSS dependencies

* Initialize TailwindCSS

* Pointing PostCSS to our tailwind config files

* Apply configuration to libraries and configure paths

* Import TailwindCSS styles

* Add Nx utility function for TailwindCSS purging
  • Loading branch information
katamatata authored Jul 16, 2024
1 parent 2d8f0a9 commit 61b5b8d
Show file tree
Hide file tree
Showing 9 changed files with 403 additions and 7 deletions.
10 changes: 10 additions & 0 deletions apps/redi-connect/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { join } = require('path')

module.exports = {
plugins: {
tailwindcss: {
config: join(__dirname, 'tailwind.config.js'),
},
autoprefixer: {},
},
}
13 changes: 13 additions & 0 deletions apps/redi-connect/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind')
const { join } = require('path')

module.exports = {
content: [
join(__dirname, './src/**/*!(*.stories|*.spec).{js,ts,jsx,tsx,html}'),
...createGlobPatternsForDependencies(__dirname),
],
theme: {
extend: {},
},
plugins: [],
}
10 changes: 10 additions & 0 deletions apps/redi-talent-pool/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { join } = require('path')

module.exports = {
plugins: {
tailwindcss: {
config: join(__dirname, 'tailwind.config.js'),
},
autoprefixer: {},
},
}
13 changes: 13 additions & 0 deletions apps/redi-talent-pool/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind')
const { join } = require('path')

module.exports = {
content: [
join(__dirname, './src/**/*!(*.stories|*.spec).{js,ts,jsx,tsx,html}'),
...createGlobPatternsForDependencies(__dirname),
],
theme: {
extend: {},
},
plugins: [],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
@import '_fonts';
@import '_forms';

// directives for Tailwind’s layers
@import '_tailwind';

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
"@types/yup": "0.26.24",
"@typescript-eslint/eslint-plugin": "5.10.2",
"@typescript-eslint/parser": "5.10.2",
"autoprefixer": "^10.4.19",
"babel-jest": "27.2.3",
"babel-loader": "8.1.0",
"css-loader": "4.3.0",
Expand All @@ -196,12 +197,14 @@
"eslint-plugin-react-hooks": "4.3.0",
"jest": "27.2.3",
"nx": "13.9.7",
"postcss": "^8.4.39",
"prettier": "2.6.2",
"prettier-eslint": "^12.0.0",
"react-test-renderer": "17.0.2",
"rimraf": "^5.0.5",
"sass-loader": "10.1.1",
"style-loader": "2.0.0",
"tailwindcss": "^3.4.4",
"ts-jest": "27.0.5",
"ts-node": "~9.1.1",
"typescript": "4.6.3",
Expand Down
6 changes: 4 additions & 2 deletions workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@
},
"extractCss": true,
"scripts": [],
"webpackConfig": "@nrwl/react/plugins/webpack"
"webpackConfig": "@nrwl/react/plugins/webpack",
"postcssConfig": "apps/redi-connect/postcss.config.js"
},
"configurations": {
"production": {
Expand Down Expand Up @@ -259,7 +260,8 @@
},
"extractCss": true,
"scripts": [],
"webpackConfig": "apps/redi-talent-pool/custom-webpack-config.js"
"webpackConfig": "apps/redi-talent-pool/custom-webpack-config.js",
"postcssConfig": "apps/redi-connect/postcss.config.js"
},
"configurations": {
"production": {
Expand Down
Loading

0 comments on commit 61b5b8d

Please sign in to comment.