Closed MaluNoPeleke closed 3 years ago
Working fine for me without tailwind; please post the version numbers of postcss, postcss-import, etc. and your postcss.config.js
PostCSS version 8.3.6 PostCSS-Import version 14.0.2
package.json
{
"name": "kirbytest",
"version": "1.0.0",
"description": "My Kirby project",
"main": "index.js",
"scripts": {
"build": "postcss site/postcss/tailwind.css -o assets/css/style.css",
"watch": "postcss site/postcss/tailwind.css -o assets/css/style.css --watch",
"prod": "cross-env NODE_ENV=production postcss site/postcss/tailwind.css -o assets/css/style.css"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@tailwindcss/typography": "^0.4.1",
"autoprefixer": "^10.3.1",
"cross-env": "^7.0.3",
"cssnano": "^5.0.7",
"postcss-cli": "^8.3.1",
"postcss-import": "^14.0.2",
"postcss-nesting": "^8.0.1",
"tailwindcss": "^2.2.7"
}
}
postcss.config.js
const cssnano = require('cssnano');
module.exports = {
plugins: [
require('postcss-import')({ path: "site/postcss/", root: "site/postcss/", from: "site/postcss/" }),
require('tailwindcss'),
require('postcss-nesting'),
require('autoprefixer'),
...process.env.NODE_ENV === 'production'
? [cssnano({
preset: 'default',
})]
: []
]
}
tailwind.config.js
module.exports = {
purge: {
preserveHtmlElements: true,
mode: 'all',
enabled: true,
content: [
'./site/templates/*.php',
'./site/snippets/*.php',
'./site/tailwind/*.css',
],
},
darkMode: false, // or 'media' or 'class'
theme: {
extend: {},
},
variants: {
extend: {},
},
plugins: [
require('@tailwindcss/typography'),
],
}
From looking at your setup; I don't think you should need to pass any options to postcss-import in your config. Does removing them make any difference?
No and I also just discovered that the following styles also don't get imported (they are put above the figure one) but I cannot find the styles within the styles.css:
.current-link {
color: #F78104!important;
font-weight: bold;
}
.pure-menu-active>.pure-menu-link, .pure-menu-link:focus, .pure-menu-link:hover {
background-color: #F78104;
background-color: #005F60;
background-color: #008083;
}
You'll need to create a reduced test case to debug this. Remove things one-by-one until you get down to the smallest setup that will reproduce the problem.
It works if I enable Tailwinds JIT mode so it seems to be an issue with Tailwind...
As described in #466 not all content gets imported in the production ready css. These are the two css files:
tailwind.css
custom.css
Everything from this line downwards isn't included from the custom.css:
img[data-sizes="auto"] { display: block; width: 100%; }