Follow the bellow steps to compile your own version of Tailwindcss to our specs.
mkdir tailwindcss-project
cd tailwindcss-project
echo "" > package.json
touch package.json
{
"name": "tailwindcss-project",
"version": "1.1.0",
"private": true,
"dependencies": {
"autoprefixer": "10.2.5",
"postcss": "8.2.8",
"tailwindcss": "2.0.4"
},
"devDependencies": {
"@tailwindcss/forms": "0.2.1"
}
"scripts": {
"build:tailwind": "NODE_ENV=production tailwind build index.css -o tailwind.css"
}
}
We will use the build:tailwind
script for compiling Tailwind CSS.index.css
and tailwind.css
to your own path where these two files are found, for example path/to/index.css
and path/to/tailwind.css
.echo "" > tailwind.config.js
touch tailwind.config.js
const colors = require("tailwindcss/colors");
module.exports = {
purge: {
enabled: false,
// in the content prop you should put all the files
// that are using tailwindcss classes, for example:
// content: ["./src/**/*.js", "./public/index.html"],
// or
// content: ["./src/**/*.vue", "./public/index.html"],
// or
// content: ["./src/**/*.jsx", "./public/index.html"],
content: [],
options: {
safelist: [],
},
},
theme: {
colors: {
...colors,
"current": "current",
"transparent": "transparent",
},
},
variants: [
"responsive",
"group-hover",
"focus-within",
"first",
"last",
"odd",
"even",
"hover",
"focus",
"active",
"visited",
"disabled",
],
plugins: [require("@tailwindcss/forms")],
};
echo "" > index.css
touch index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
npm install
npm run build:tailwind
tailwindcss-project
folder, a new tailwind.css
file has been created. You will only need to import/include that file inside your project.