-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Audio: Add border block support #64494
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
base: trunk
Are you sure you want to change the base?
Conversation
|
Size Change: +70 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
t-hamano
left a comment
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 for the PR!
I am concerned that when a thick border is applied, it will make the player less visible:
Is there any problem with applying a border to the block itself rather than the audio element?
Note: In the screenshot below, display:block has been applied to the audio element to prevent space from being displayed below the audio element.
However, I would like to hear the opinion of @aaronrobertshaw, who is knowledgeable about this initiative.
aaronrobertshaw
left a comment
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 for continuing these efforts @akasunil and the ping @t-hamano 👍
I am concerned that when a thick border is applied, it will make the player less visible:
Yeah, I agree. That doesn't look great in my opinion.
The current approach for applying border styles here conflicts with the application of padding on the wrapper as well. I think it only makes sense to apply them to the same location.
To be honest, I'm not even sure that padding should have been adopted on the audio block's wrapper. As it doesn't increase the size of the player at all, the best it could achieve visually is the same as margin (given no color support).
Applying padding and border to audio elements is pretty inconsistent/broken across browsers. I'm really not sure whether it's something we want to add if it can't be done consistently.
Here's the current state of this PR:
| Chrome | Safari | Firefox |
|---|---|---|
Screen.Recording.2024-09-27.at.11.10.58.am.mp4 |
Screen.Recording.2024-09-27.at.11.05.54.am.mp4 |
Screen.Recording.2024-09-27.at.11.06.50.am.mp4 |
It might be possible to achieve better results applying styling to various vendor prefixes to style the different browser audio players but I'm not convinced the complexity is worth it for what seems a very niche use case.
It might pay to get some design feedback on this one.
|
If the border is moved to the figure, it will not affect the size of the audio element, but it will wrap the caption. |




What?
Add border block support to the
Audioblock.Part of #43247
Why?
Audioblock is missing border support.How?
Adds the border block support in block.json
Testing Instructions
Audioblock's border is configurable via Global StylesAudioblock and Apply the border stylesWatch attached video for more information.
Screenshots or screencast
Blog-Home-.-Template-.-gutenberg-.-Editor-.-WordPress.webm