ai on main
Update dependencies (compare)
ai on main
increase test coverage Merge pull request #1813 from r… (compare)
Hello everyone! Asking here because I found nothing on stack/github for days. Summary: Postcss is working when I use postcss-cli, but not when I run it as a flask-assets plugin.
So, if I run postcss static/src/main.css -o static/dist/main.css
my CSS is correctly processed
But if I run my flask app, that uses postcss as a filter (css = Bundle("src/main.css", output="dist/main.css", filters="postcss")
) my CSS is not correctly processed. I used this tutorial as reference: https://testdriven.io/blog/flask-htmx-tailwind/
Thank you in advance!
Hey Guys,
I've just join to this chat, so I'm not sure if here is the right place to get help...
I am facing the following problem when trying to import a css file from node_modules:
C:/myapp/node_modules/swiper/swiper-bundle.min.css
Error: No PostCSS Config found in: C:myapp\node_modules\swiper
my postcss.config.js is:
module.exports = {
options: {
ident: 'postcss',
import: true,
},
plugins: {
'postcss-flexbugs-fixes': {},
'postcss-normalize': {},
'postcss-preset-env':
{
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
},
},
}
It's located like:
|-config
|---webpack.config.js
|
|-postcss.config.js
I've tried to inform the postcss.config.js path on webpack like:
{
loader: require.resolve('postcss-loader'),
options: {
path:"../postcss.config.js"
}
}
But when I do that, I receive a console message saying:You did not set any plugins, parser, or stringifier. Right now, PostCSS does nothing. Pick plugins for your case on https://www.postcss.parts/ and use them in postcss.config.js.
Does anyone have a clue? Thank you guys
Hey, I've made a private plugin according to this: https://github.com/postcss/postcss/blob/main/docs/writing-a-plugin.md
But when I try and load it in the postcss.config.js I get the following error:
Error: Loading PostCSS Plugin failed: Cannot find module 'postcss-wide-gamut-color'
Is there something else I need to do to use it?
Unknown error from PostCSS plugin. Your current PostCSS version is 8.4.12, but cssnano uses 7.0.35. Perhaps this is the source of the error below.
node:internal/modules/cjs/loader:933
const err = new Error(message);
^
Error: Cannot find module 'caniuse-lite/dist/unpacker/feature'
Hello,
I created a css minifier that works off of the commandline using a tutorial at DO last year. It has been brought to my attention that when the css files are combined and ran through using the following command that custom properties completely disappear.
example:
:root {
/* Site Colors are HSL values */
--black: 0, 0%, 0%;
}
There is no reference to --black inside the output of the following command so we get black not defined errors in chrome css tab
The Command:
postcss --config /var/www/minify.server/html/postcss-config.json --use postcss-cssnext --use cssnano --no-map --output /tmp/AE6ED53C-2303-4260-B4FD463925159A22-output.txt /tmp/AE6ED53C-2303-4260-B4FD463925159A22.txt
Here is postcss.config.js (Which now that I am typing this I do not think it is used via the command unless it is auto-included)
module.exports = {
plugins: [
require('cssnano')({
preset: 'default',
}),
postcssCustomProperties({
preserve: true
})
],
};
Here is package.json
{
"devDependencies": {
"cssnano": "^5.0.15",
"postcss": "^8.4.5",
"postcss-cli": "^9.1.0",
"postcss-cssnext": "^3.1.1",
"postcss-custom-properties": "^12.1.8",
"postcss-import": "^14.0.2"
}
}
Here is postcss.config.json
{
"use": ["postcss-cssnext", "cssnano"]
}
I am a bit over my head here and would appreciate some guidance on why the custom properties disappear and what I need to look into to get the custom properties back.
I have seen a few posts mention: postcss-custom-properties and postcss-preset-env but I am not 100% if those would solve the problem I am having.
Thank You.
Hello! I want to use postcss to compile scss to css at my React project. Currently getting the error: CssSyntaxError: postcss-advanced-variables: C:....\node_modules\bootstrap\scss_functions.scss: Could not resolve the variable... I attach error from terminal (with package.json script underlined) and config file.
Could you please help me, what is happenning? Thanks in advance!
dead
" when i try to build my project.@layer
would be appreciated: https://github.com/postcss/postcss-import/pull/496#issuecomment-1214216740
TLDR: I'm trying to use postcss-scss
to resolve a SyntaxError related to // backslash comments
, but it doesn't seem to be working.
Here's my postcss.config.js
module.exports = {
syntax: 'postcss-scss',
plugins: [
require('tailwindcss'),
require('autoprefixer'),
require('postcss-flexbugs-fixes'),
require('postcss-preset-env')({
autoprefixer: {
flexbox: 'no-2009'
},
stage: 3
})
]
}
When I run yarn run tailwindcss -i ./app/assets/packs/styles/application.scss -o ./tailwind-output.css
, I get the following error:
/Users/me/Workspace/project/node_modules/postcss/lib/input.js:148
result = new CssSyntaxError(
^
CssSyntaxError: /Users/me/Workspace/project/app/assets/packs/styles/application.scss:8:1: Unknown word
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser
The line it's referring to is a // comment
.
tailwind
doesn't look at it. I just added a bunch of non-sense code that would produce an error and it wasnt reported
--postcss
option on the command line and point directly to the config file
hey, I'm trying to write a custom plugin to rename any class, but I can't see any changes when I'm looking at the result.css property. This is my code:
const postcss = require('postcss');
const selectorParser = require('postcss-selector-parser');
const cssContent = readFileSync(cssFileName, 'utf-8');
const transform = (selectors) => {
selectors.walkClasses((node) => {
node.value = `foo_${node.value}`
})
};
const selectorProcessor = selectorParser(transform);
const postCssPlugin = () => ({
postcssPlugin: 'bar',
Rule (rule) {
selectorProcessor.processSync(rule);
},
});
postCssPlugin.postcss = true;
const result = postcss([postCssPlugin()]).process(cssContent, { from: undefined }).css;
Does anyone knows why my plugin does nothing?
Does anyone know how to solve this problem? italia/design-react-kit#862, I'm facing the same issue
Anyone can help me? I'm still stuck here