-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add CSS carousel examples #302
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
Add CSS carousel examples #302
Conversation
This pull request has merge conflicts that must be resolved before it can be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Though I found an issue with viewport units and scroll bars. It’s better to avoid using 100vw
at any cost, since it’s the viewport width, not the “window content apart from scrollbars” width. And the moment you have vertical scrollbars, you’ll get this:

You can check this by setting your scrollbars to be visible by default, not overlay content:

So I would suggest using 100% instead of 100vw. Unfortunately, with the full-width panels, it doesn’t play nicely with flexbox, so I used a grid layout instead:
display: grid;
grid-auto-flow: column;
grid-auto-columns: 100%;
gap: 4%;

css-carousels/scroll-button-scroll-marker-with-columns/styles.css
Outdated
Show resolved
Hide resolved
Co-authored-by: Vadim Makeev <[email protected]>
Co-authored-by: Vadim Makeev <[email protected]>
Makes sense; thanks @pepelsbey! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I am in the process of documenting the new CSS Carousels functionality on MDN (see mdn/content#38752).
I have included the examples as live examples in the guide, but I also want to link to standalone live examples and source code, as they are not as easy to follow in-page.