Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[postcss] Config postcss-pxtorem dosen't work #505

Closed
kivenli opened this issue Apr 19, 2023 · 2 comments · Fixed by #513
Closed

[postcss] Config postcss-pxtorem dosen't work #505

kivenli opened this issue Apr 19, 2023 · 2 comments · Fixed by #513
Labels
bug Something isn't working

Comments

@kivenli
Copy link

kivenli commented Apr 19, 2023

What's happening
I want to add a postcss plugin named "postcss-pxtorem“ in config file to convert px unit to rem, but it donsen't work
What should happen
Should make the px unit convert to rem.

To reproduce
Config list below:
const CracoLessPlugin = require("craco-less");
module.exports = {
plugins: [{ plugin: CracoLessPlugin }],
style: {
postcss: {
mode: "extends",
loaderOptions: {
postcssOptions: {
ident: "postcss",
plugins: [
[
"postcss-pxtorem",
{
rootValue: 375 / 10,
},
],
],
},
},
},
},
};

and I also test other config:
module.exports = {
plugins: [{ plugin: CracoLessPlugin }],
style: {
postcss: {
mode: "extends",
plugins: [
require("postcss-pxtorem")({
rootValue: 375 / 10,
propList: ["*"],
}),
],
},
},
};

Also dosen't work, I can confirm the CracoLessPlugin works, but i realy dont' know why the postcss-pxtorem dosen't work,

CRACO version
"@craco/craco": "^7.0.0",
"postcss": "^8.4.22",
"postcss-pxtorem": "^5.1.1",

Additional information
(anything else that could be useful for us to help you solve your problem)

@kivenli kivenli added the bug Something isn't working label Apr 19, 2023
@lvchenyang
Copy link

Postcss plugin not working too!

@vlad-elagin
Copy link

@lvchenyang
I've provided possible workaround here #506

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants