-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[amp-story] ♿ Make pause/play buttons keyboard focusable #33214
Conversation
Hey @gmajoulet, @newmuis! These files were changed:
|
There is no shift if the content is rendered with the correct width, are you saying there's a layout shift with your implementation? We need to get the initial render right. Deferring to @processprocess for the review |
Let's also check I think using |
@processprocess thanks for the suggestion on using I did have to add some code in order for the system layer to be able to read that CSS class in the shadow DOM:
PTAL |
Looks good to me. As we discussed, with @newmuis, if we find that we need to pass other classes to the shadow dom element, having a helper that appends classes from an allow list could work. For now I think this is implementation is good though! |
Can the play/pause button be focused by a screen reader? If not, can you re-open the ticket please? |
Closes #32508
Makes pause/play buttons in the system layer focusable via keyboard.
It uses the
amp-mode-keyboard-active
AMP CSS class to display the button when the keyboard is active.Outdated comments before 87fed97:
display: none
orvisibility: hidden
, so we have to render them and hide them another way.opacity
orwidth
. I tried usingopacity: 0
initially, but it would create an empty space between the other buttons in the system layer.width
is usually frowned upon since it causes CLS and negatively impacts performance. Alternative would be to use atransform: scaleX(0)
, but it would still create the space between the other buttons.