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

Apply visibility: hidden to carousel spacers in amp-carousel 0.2 #33279

Merged
merged 3 commits into from
Mar 22, 2021

Conversation

caroqliu
Copy link
Contributor

@caroqliu caroqliu commented Mar 15, 2021

Spacer elements are used to establish scroll width / scroll momentum but should not themselves be seen. This change should also save some work in the rendering engine without impacting end user experience.

Impacts amp-carousel-0.2 and amp-base-carousel-0.1.

Notes:

  • Preferred to content-visibility: hidden as we will never switch between hidden and visible states
  • Preferred to display: none as these elements should still have size (hence the name "spacer"!)

@micajuine-ho
Copy link
Contributor

Thanks for this!

Preferred to content-visibility: hidden as we will never switch between hidden and visible states
Preferred to display: none as these elements should still have size (hence the name "spacer"!)

I only see the addition of visibility: hidden;, am I misunderstanding the description?

@caroqliu
Copy link
Contributor Author

Thanks for this!

Preferred to content-visibility: hidden as we will never switch between hidden and visible states
Preferred to display: none as these elements should still have size (hence the name "spacer"!)

I only see the addition of visibility: hidden;, am I misunderstanding the description?

Nope. The description is saying that visibility: hidden is applied instead of content-visibility: hidden or display: none for the respective reasons.

Copy link
Contributor

@kristoferbaxter kristoferbaxter left a comment

Choose a reason for hiding this comment

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

LGTM, two small questions.

@@ -57,17 +57,17 @@
* calculating the 100% height (or width) of the slide.
*/
/* Firefox */
.i-amphtml-carousel-scroll[hide-scrollbar="true"] {
scrollbar-width: none;
.i-amphtml-carousel-scroll[hide-scrollbar='true'] {
Copy link
Contributor

Choose a reason for hiding this comment

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

This change appears unrelated, was this from prettier formatting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea this whole file was formatted in 11b3b3a

overflow: hidden;
}

.i-amphtml-carousel-spacer {
z-index: -1;
visibility: hidden;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this carry an accessibility concern? I can't imagine it does, but just want to verify.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Confirming there is no impact on accessibility with this change.

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

Successfully merging this pull request may close these issues.

None yet

4 participants