-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
After built the z-index changed #614
Comments
You likely set the same class somewhere else, with During production, all CSS is extracted in one file and minified, which also removes duplicate definitions - and in this case, the duplicate with z-index: 1 was the "survivor". |
No, absolutely not. |
This is exactly what I am talking about, though. If you override global styles in a component without using the If you still disagree, please provide a repository with a minimal reproduction for me to check out. |
I write a simple demo.
|
Just run into the same problem. In my single .vue file, I set the modal-mask 'z-index:999', and alert 'z-index:1000' (both in scoped style tag) After building, they are changed into 1 and 2. |
Ah I see, so at the root, this is an issue with css-loader / cssnano default settings. I think we should be able to fix this in the webpack config for css-loader. Thanks for investigating! :) |
Hm, I'm currently trying to test my fix, but I can't reproduce the problematic behaviour, even if I set |
I noticed that the So everything goes well. By the way, thanks. |
Oh, I missed that, thanks for the pointer! |
I was running into some issues on production builds with z-indexes as well as a few more advanced background gradients, etc. [This issue](vuejs-templates/webpack#614) linked to a solution I thought I should try which fixed it right away. By default I think this should be included in all builds.
@LinusBorg should this be added in the Readme.md file as well.
|
Version
latest[mybe not just]
zIndexBug.zip
Steps to reproduce
npm run dev
,everything fineI think the z-index value shouldn't be changed,because we may use the third party plugin like jQuery plugin which could use z-index. In this condition, the z-index calculation is unnecessary, and make mistakes.
What is expected?
keep my z-index value
What is actually happening?
my z-index changed
The text was updated successfully, but these errors were encountered: