postcss, tailwind config, autoprefixer and cssnano plugins and package.json file with scripts

This commit is contained in:
Thomas Chartron 2021-11-06 15:03:40 +01:00
parent 46bb6effee
commit f917bc40f3
6 changed files with 47 additions and 7 deletions

2
.gitignore vendored
View file

@ -1,3 +1 @@
node_modules/
src/
postcss.config.js

View file

@ -1,8 +1,30 @@
{
"name": "zola-tailwind",
"version": "0.1.0",
"description": "A theme for Zola SSG built with tailwind css",
"scripts": {
"dev": "NODE_ENV=development npx tailwindcss -i ./src/css/main.css -o ./static/css/main.css",
"prod": "NODE_ENV=production npx tailwindcss -i ./src/css/main.css -o ./static/css/main.css --minify"
"dev": "NODE_ENV=development postcss ./src/css/main.css -o ./static/css/main.css --verbose ",
"watch": "NODE_ENV=development postcss ./src/css/main.css -o ./static/css/main.css -w --verbose",
"prod": "NODE_ENV=production postcss ./src/css/main.css -o ./static/css/main.css --verbose"
},
"repository": {
"type": "git",
"url": "git+https://github.com/tchartron/zola-tailwind.git"
},
"keywords": [
"zola",
"ssg",
"theme",
"tailwindcss",
"tailwind",
"tchartron"
],
"author": "Thomas Chartron",
"license": "MIT",
"bugs": {
"url": "https://github.com/tchartron/zola-tailwind/issues"
},
"homepage": "https://github.com/tchartron/zola-tailwind#readme",
"devDependencies": {
"autoprefixer": "^10.4.0",
"cssnano": "^5.0.9",

15
postcss.config.js Normal file
View file

@ -0,0 +1,15 @@
const postcssConfig = {
plugins: [
require('autoprefixer'),
require('tailwindcss')
],
};
if (process.env.NODE_ENV === 'production') {
postcssConfig.plugins.push(
require('cssnano')({
preset: 'default',
})
);
}
module.exports = postcssConfig;

3
src/css/main.css Normal file
View file

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

File diff suppressed because one or more lines are too long

View file

@ -1,7 +1,7 @@
module.exports = {
purge: [
'./templates/**/*.html',
'./static/js/**/*.js',
'./templates/**/*.html',
'./static/js/**/*.js',
],
darkMode: 'class', // or 'media' or 'class'
theme: {