KyleAMathews / react-headroom

Hide your header until you need it
https://kyleamathews.github.io/react-headroom
MIT License
1.84k stars 149 forks source link

feature: add "top" class for when header is back at top #43

Open lupinskij opened 8 years ago

lupinskij commented 8 years ago

It would be great to add a class .headroom--top for when the header is initially pinned, but at the top.

This is beneficial for instances that the header should have specific styles when pinned, but not at the initial top position.

KyleAMathews commented 8 years ago

I like the idea but that css name is a bit confusing as at first (and probably second) glance, it seems the same as the pinned class. Could you think up a different class name?

In the meantime, you can use onPin to set a custom class for this.

lupinskij commented 8 years ago

What if it were initially set to headroom--unfixed, opposed to only setting unfixed after it has been pinned. That way one could style strictly the pinned state

KyleAMathews commented 8 years ago

Perhaps headroom--repinned would work. On Tue, Dec 1, 2015 at 9:18 AM Jeff Lupinski notifications@github.com wrote:

What if it were initially set to headroom--unfixed, opposed to only setting unfixed after it has been pinned. That way one could style strictly the pinned state

— Reply to this email directly or view it on GitHub https://github.com/KyleAMathews/react-headroom/issues/43#issuecomment-161037808 .

PHaroZ commented 8 years ago

To unfix component when scrolling to initial position I just had to do some small modifications, see the attached patch. (I've done it on dist version because I don't know how to modify/compile coffescript and make a pull request, sorry) headroom.patch.zip

payner35 commented 8 years ago

would like to see this +1