CSS minification changes z-index
See original GitHub issueHave you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Description
Hey Docusaurus Team,
thanks for your amazing work 😃
We realized recently that docusaurus cleans up z-indices in our custom css that we are loading via customCss: require.resolve('./src/css/custom.css')
. My question is: How can I disable the z-index modification? This might be a good feature but can lead to bugs when you are using other third party that bring their own css. We are using '@docusaurus/preset-classic'
.
Self-service
- I’d be willing to address this documentation request myself.
Issue Analytics
- State:
- Created a year ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
minify css causes problem (or highlights bug) with calc() in ...
The CSS minification algorithm of SG Optimizer results in the alteration of a some of css statements in our code. Specifically. z-index: calc(var(…...
Read more >The Gulp cssnano z-index Bug and How to Fix It
This is a post about how to overcome the cssnano z-index bug and how to update your gulp build task to fix the...
Read more >When I added z-index: 999 value gets converted to an order
I never and cannot use 999 as a z-index . This is a project that was done by someone else and I'm doing...
Read more >z-index - CSS: Cascading Style Sheets - MDN Web Docs
The z-index CSS property sets the z-order of a positioned element and its descendants or flex items. ... Change my z-index. z-index: 6....
Read more >How does Z-index property work in CSS with Examples
The z-index property in CSS decides the stack order of the element like image or box or any character content or button etc....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, I see. I think we should find a way to configure it, then.
It works as intended but I think that it’s not a good default for a platform like docusaurus. As the zindex plugin docs point out it “is unsafe as it could potentially clash with other stylesheets, or JavaScript injected styles”. In our case we are using a third party library on the front page that brings its own CSS and we can’t set our z-indices properly because they get changed by the minification process.
Let’s say you want
.element-a
and.element-b
on top of an element that comes from another library with a realz-index: 1000
, you can’t achieve it, because:will be changed to: