open-amdocs / webrix

Powerful building blocks for React-based web applications
https://webrix.amdocs.com
Apache License 2.0
431 stars 31 forks source link

Scrollbar Shadow should be positioned by default #111

Open yairEO opened 1 year ago

yairEO commented 1 year ago

Currently, Shadow.jsx does not come with CSS that has position

<Scrollable.Shadow>
    <Scrollable>
        ...
    </Scrollable>
</Scrollable.Shadow>

And so, whoever is using the Scrollable Shadow must position it themselves (in their app):

.scroll-shadow {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

And it begs the question why does the above CSS not come out-of-the-box inside the <Shadow> component SCSS file.

ykadosh commented 1 year ago

That's a good question 😁 I remember there was a reason, but can't remember what it was...

One thing I can say is that you may not always want inset to be 0. For example, if you have a sticky element inside your scrollable element.

yairEO commented 1 year ago

Yes I thought about that, but the usual use-case is most likely simple - just scrollable content, so it makes sense to add these default styles.

For the more esoteric cases (like your example above), developers can make CSS modifications, since they anyway would need to write CSS (it will override the one from Webrix's <Shadow> anyway)