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

cssLoaderOptions.localIdentName changes antd styles #11

Open
sdli opened this issue Jan 9, 2019 · 7 comments
Open

cssLoaderOptions.localIdentName changes antd styles #11

sdli opened this issue Jan 9, 2019 · 7 comments

Comments

@sdli
Copy link

sdli commented Jan 9, 2019

image

Antd styles changes too

"@craco/craco": "^3.2.3", "antd": "^3.11.6", "react-scripts": "2.1.1", "craco-antd": "^1.9.3",

@ndbroadbent
Copy link
Member

I think this is the expected behavior. cssLoaderOptions is passed to the Less loader, so this will change all of the CSS class names.

If you want to turn it off just for the antd styles, then I think you might need to add your own custom webpack rules with an exclude or test regex. Or maybe I can add something in craco-antd to support this.

Can you please explain a bit more about what you are trying to do?

@sdli
Copy link
Author

sdli commented Jan 10, 2019

I think this is the expected behavior. cssLoaderOptions is passed to the Less loader, so this will change all of the CSS class names.

If you want to turn it off just for the antd styles, then I think you might need to add your own custom webpack rules with an exclude or test regex. Or maybe I can add something in craco-antd to support this.

Can you please explain a bit more about what you are trying to do?

Thank you, I wrote a webpack configuration file , and I have fixed it.

@ndbroadbent
Copy link
Member

Ok great! I will leave this issue open for now, and I might add an easier way to solve this in the future. It would be good if you could apply some options to your own Less files without affecting the antd Less.

@tikkichan4
Copy link

Just having the same problem, i would like to use babel-plugin-react-css-modules + craco-antd to rename all of the customized classes excluding antd classes. But currently it seems not worked if not changing the webpack config directly.

@ndbroadbent
Copy link
Member

@tikkichan4 Sorry about that!

I think I just need to exclude the antd Less files with a regex, or even exclude everything in /node_modules/. I have added this to my todo list and should be able to get it fixed soon,

@ndbroadbent
Copy link
Member

Sorry for the delay on this issue. Unfortunately I don't have much time to spend on craco-antd, but it would be great if someone could help with a PR for this issue. Thanks!

@Arrow66
Copy link

Arrow66 commented Dec 4, 2020

I think this is the expected behavior. cssLoaderOptions is passed to the Less loader, so this will change all of the CSS class names.
If you want to turn it off just for the antd styles, then I think you might need to add your own custom webpack rules with an exclude or test regex. Or maybe I can add something in craco-antd to support this.
Can you please explain a bit more about what you are trying to do?

Thank you, I wrote a webpack configuration file , and I have fixed it.

Hi ,
Can you please share the fix here . i am also facing the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants