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

Antd reset.css is not imported when using as layer #48762

Closed
AsuraKev opened this issue May 3, 2024 · 4 comments
Closed

Antd reset.css is not imported when using as layer #48762

AsuraKev opened this issue May 3, 2024 · 4 comments

Comments

@AsuraKev
Copy link

AsuraKev commented May 3, 2024

Reproduction link

https://ant.design/docs/react/compatible-style#layer-downgrade

Steps to reproduce

following the doc and added the following code:

Order of style precedence Tailwind -> reset css -> antd

@layer tailwind-base,
reset,
antd;
@layer tailwind-base {
@tailwind base;
}

@import url('antd/dist/reset.css') layer(reset);
@tailwind components;
@tailwind utilities;

What is expected?

Expect that style layer are applied and style overwrite appropriately

What is actually happening?

Reset css style is not being applied at all

Environment Info
antd 5.17.0
React 18.2
System web
Browser chrome
@AsuraKev
Copy link
Author

AsuraKev commented May 3, 2024

Able to see Layer tailwind and antd being applied but Layer reset is missing

image

@AsuraKev
Copy link
Author

AsuraKev commented May 3, 2024

Or tried import reset css first but antd styles are being overwritten by reset even the order specified is correct

image
image

@AsuraKev AsuraKev changed the title Antd reset style is not imported when using as layer Antd reset.css is not imported when using as layer May 6, 2024
@AsuraKev AsuraKev closed this as completed May 7, 2024
@afc163
Copy link
Member

afc163 commented May 7, 2024

@AsuraKev Did you resolve it? Why did you close this issue?

@AsuraKev
Copy link
Author

AsuraKev commented May 7, 2024

Hi. Yes, after restarting the solution it worked as expected. The reset css import has to come last otherwise tailwind still overrides even if you defined the order as @layer tailwind-base, reset, antd

thanks

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

No branches or pull requests

2 participants