documentcloud / document-viewer

The NYTimes Document Viewer
http://open.blogs.nytimes.com/2010/03/27/a-new-view-introducing-doc-viewer-2-0/
Apache License 2.0
691 stars 120 forks source link

Range of z-indexes for viewer is very large #21

Open knowtheory opened 12 years ago

knowtheory commented 12 years ago

The fellows over at the New Jersey Star-Ledger have indicated that the viewer CSS is messing with their headers, since our z-indexes range from 0 all the way up to 20000.

Someone needs to go through all the z-index declarations in our CSS files and bump them down in a manner that keeps all of our declarations proportional, but reduces the values by either an order of magnitude (20000 to 2000, 15999 to 1599, and 1 to 1) or into simple increments of 5.

samuelclay commented 12 years ago

And they would do well to go even higher to deal with some of the sky-high z-indexes on some publisher sites. Where do we draw the line? They probably have a fixed header. And there's no one answer that makes every site happy, is there?

knowtheory commented 12 years ago

yes, that's true. That said, the viewer's behavior is a bit inconsistent (the header, scrolling pane, and footer are a lot higher than the side bar).

Embedding 3rd party styles is always going to be a fraught endeavor. I'm not sure what else we can do other than provide folks with a list of where our z-indexes are set, and making sure that there aren't any !important declarations.

jashkenas commented 12 years ago

Or hang on a sec -- I thought that z-indexes were relative to the nearest positioned parent with a z-index?

http://jsfiddle.net/xAX5R/

All we have to do is make the viewer wrapper (which should already be position:relative), z-index: 0 also. Ted -- go for it.

samuelclay commented 12 years ago

In this case, sure, we'd want to be under their header. But in other cases, parts of their page was obstructing the viewer/search-embed, so we didn't have a z-index:0 parent.