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

Vite change the style order in production that cause the overwrite issue #11760

Closed
7 tasks done
alokVishu opened this issue Jan 20, 2023 · 5 comments · Fixed by #11763 or #11818
Closed
7 tasks done

Vite change the style order in production that cause the overwrite issue #11760

alokVishu opened this issue Jan 20, 2023 · 5 comments · Fixed by #11763 or #11818
Labels
feat: css inconsistency Inconsistency between dev & build p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@alokVishu
Copy link

Describe the bug

I am experiencing an issue with the Full calendar plugin in my Vuejs + Vite project where my custom styles are not being applied in production mode. This is due to Vite changing the order of the component's default styles and my custom styles, causing a conflict.

Reproduction

https://github.com/alokVishu/vite-style-overwrite-issue

Steps to reproduce

Run the project in development
yarn && yarn dev

run the project in production
yarn build && yarn preview

System Info

macOS: Ventura
google chrome

Used Package Manager

yarn

Logs

In Development Mode

Screenshot 2023-01-20 at 12 23 52 PM

In Production Mode

Screenshot 2023-01-20 at 12 24 43 PM

Validations

@alokVishu
Copy link
Author

I am also facing a similar issue with the apex chart in my Vuejs + Vite project. If you require a reproduction demo to demonstrate this issue, please let me know.

@sapphi-red sapphi-red added feat: css p3-minor-bug An edge case that only affects very specific usage (priority) inconsistency Inconsistency between dev & build and removed pending triage labels Jan 20, 2023
@alokVishu
Copy link
Author

Hello @sapphi-red,

I have tried your latest release but the above issue is not solved yet. You can get this issue in the production build.

Screenshot 2023-02-02 at 5 03 22 PM
Screenshot 2023-02-02 at 5 04 18 PM

@sapphi-red
Copy link
Member

sapphi-red commented Feb 2, 2023

The order now has consistency. You'll see the same thing happening during dev.

The reason why your style gets overridden is because the library injects style tags.
image

@alokVishu
Copy link
Author

The order now has consistency. You'll see the same thing happening during dev.

The reason why your style gets overridden is that the library injects style tags. image

What should I have to do now?

@sapphi-red
Copy link
Member

sapphi-red commented Feb 2, 2023

You'd need to increase your style's specificity (e.g. adding !important).

@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: css inconsistency Inconsistency between dev & build p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
2 participants