Skip to content
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

Support for box-shadow #10

Open
adrielklein opened this issue Oct 9, 2020 · 4 comments
Open

Support for box-shadow #10

adrielklein opened this issue Oct 9, 2020 · 4 comments

Comments

@adrielklein
Copy link

Hey @zzarcon love what you're doing here with this library.

Any chance there is a solution here that implements exactly what you have but for box-shadow instead of just a border?

@adrielklein
Copy link
Author

I'm working on building a solution for this now, but was wondering if you or anybody else has done this.

If not I'm happy to work on it and open up a pull request

@zzarcon
Copy link
Owner

zzarcon commented Oct 11, 2020

That would be amazing @adrielklein ! Please do so and let's see how can we get it merged here. Also, if you are interested I could make you maintainer afterwards 🤞

@adrielklein
Copy link
Author

Hey @zzarcon, so after doing some tinkering, I've determined that it's pretty hard to get the box-shadow showing up properly using this library.

The reason for this is that box-shadow must be applied to the elements above and below the scroll area, not by inserting elements before and after the scroll area using css like you do in this library with ::before and ::after selectors.

However, i was able to implement a solution by creating a scroll handler on the scrollable element, then keeping track of when the user is at the top or bottom of scroll area. Then using that state, I was able to either apply or not apply a box-shadow to the surrounding elements. Also I put a css transition on box-shadow so it shows up smoothly.

I will try to find some time to create a CodeSandbox of my solution to give you a more concrete example of what I'm rambling about. From there I can see if there would be an easy way to integrate that into this library.

@adrielklein
Copy link
Author

@zzarcon yes would be great to be a maintainer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants