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

fix(scrollable): fix CSS shadow effect #381

Merged
merged 1 commit into from Oct 28, 2022
Merged

Conversation

gregtyler
Copy link
Contributor

The .scrollable-pane class is supposed to add shadows to indicate that its contents are scrollable, but it is not suitably dynamic.

This CSS uses scroll shadows to make the shadows dynamically appear on the left and right when there's overflow content there.

If there's no overflow content, or the container is scrolled all the way to one side, the shadows are hidden.

I removed the .moj-scrollable-pane__wrapper class because it's unnecessary.

The `.moj-scrollable-pane` class is supposed to add shadows to indicate that its contents are
scrollable, but it is not suitably dynamic.

This CSS uses [scroll shadows][scroll-shadows] to make the shadows dynamically appear on the left
and right when there's overflow content there.

If there's no overflow content, or the container is scrolled all the way to one side, the shadows
are hidden.

I removed the `.moj-scrollable-pane__wrapper` class because it's unnecessary.

[scroll-shadows]: https://www.bram.us/2019/10/24/pure-css-scroll-shadows-vertical-horizontal/
@gregtyler gregtyler requested a review from a team as a code owner October 21, 2022 11:52
@gregtyler
Copy link
Contributor Author

This PR is just to fix the existing CSS. Next week I'll add documentation so that people can use it independently.

You can see it in action on the preview environment: open the "Filter a list" pattern and click "Show Filter" and you'll see the shadows appear as you scroll left and right.

Copy link

@rwk-moj rwk-moj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

@gregtyler gregtyler merged commit dce18d4 into main Oct 28, 2022
@gregtyler gregtyler deleted the fix-scrollable-pane-css branch October 28, 2022 08:53
gregtyler pushed a commit that referenced this pull request Oct 28, 2022
## [1.6.1](v1.6.0...v1.6.1) (2022-10-28)

### Bug Fixes

* **scrollable:** fix CSS shadow effect ([#381](#381)) ([dce18d4](dce18d4))
@gregtyler
Copy link
Contributor Author

🎉 This PR is included in version 1.6.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

2 participants