I'm attempting to use the CSS clip
and clip-path
properties to display a floating pager nav for a single-page website layout. I'm trying to get the nav to change colors based on whether it's on a dark or light background. You can see the intended result in Firefox at http://dannymcgee.net/redesign. I've also duplicated the nav and containers with cleaner, lighter-weight code at http://dannymcgee.net/dev/clipnav-prototype/ for troubleshooting purposes.
This is the way the markup is structured for each section with a different background color:
<section>
<div class="clipper">
<ul class="nav">
...
</ul>
</div>
<article class="content">
...
</article>
</section>
This entire section
is repeated every time the background changes. Each section
is relatively positioned. The .clipper
is styled like so:
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 300px;
clip: rect(auto,auto,auto,auto);
clip-path: inset(0 0 0 0);
The .nav
inside the clipper is position: fixed
from the top of the page and has backface-visibility: hidden
.
The effect works basically exactly as I'd like it to in Firefox, but is buggy in Chrome and IE. In Chrome, the background images act strangely, and the nav isn't interactable past the first section. In IE, the nav simply doesn't appear at all past the first section. I've seen this exact same setup working correctly in Chrome and IE here (actually, I found the link on an old StackOverflow thread that I can't comment on), so I know it's possible, I just can't figure out what they're doing differently. I'd be pretty satisfied using some sort of shim Javascript or jQuery solution if I could find one, but this seems like a pretty unusual case scenario and I'm not even sure where to begin to look.