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

Add color and other style options to the Audio Block #56837

Open
docpop opened this issue Dec 6, 2023 · 20 comments
Open

Add color and other style options to the Audio Block #56837

docpop opened this issue Dec 6, 2023 · 20 comments
Labels
[Block] Audio Affects the Audio Block Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@docpop
Copy link

docpop commented Dec 6, 2023

What problem does this address?

There is no option for customizing the Audio Block. It should have style options, like other blocks.

What is your proposed solution?

The proposal you’ll see below aims to:

  1. Work with each theme’s default color scheme and typography styles
  2. Allow audio title and audio description customization
  3. Let writers add a custom cover for each

Here's the prototype:

audio-block-lettre.mp4

Based on feedback, here's a slightly adjusted version of that:

audio block test

This one uses a completely vanilla/unstyled audio player, similar to how the video block uses an unstyled video player. Title, description, and poster image, are taken from the media file's metadata in the media library, though can also be edited in the inspector.

Figma.

Props @docpop @crisbusquets for the work.

Issue updated Jun 20th.

Previous version of this issue

What problem does this address?

There is no option for customizing the Audio Block in WordPress. Most blocks offer the ability to customize that block by changing it's color, or the color of the font, or rounding the edges, or aligning within the block, but these are missing from the Audio Block's style tab.

What is your proposed solution?

Add the following options to the Audio Block and put them in the block's Style Tab.

  • Change the background color of the block
  • Change the color of the font
  • Select the types of corners you'd like the block to have (rounded or default)
  • Modify the text using the same typography options in a normal Paragraph Block

As an example, I've created a mockup of how the Audio Block Styles tab could appear:
mockup-of-audio-block-options-style

@docpop docpop added the [Type] Enhancement A suggestion for improvement. label Dec 6, 2023
@skorasaurus skorasaurus added the [Block] Audio Affects the Audio Block label Dec 6, 2023
@ramonjd

This comment was marked as outdated.

@crisbusquets
Copy link
Contributor

Hi there,

I've been working on a design proposal to solve what is mentioned in this issue and also this #55715 (allow adding a featured image).

The proposal you’ll see below aims to:

  1. Work with each theme’s default color scheme and typography styles
  2. Allow audio title and audio description customization
  3. Let writers add a custom cover for each

Here's the prototype:

audio-block-lettre.mp4

I'd love to hear your feedback :)

@jasmussen
Copy link
Contributor

Nice, that looks great! I appreciate how you've used existing design tools like border and text color, making it work on any set of colors, but with additional customization options, presumably available both locally and globally. As far as I'm concerned, this is ready for a dev.

Nevertheless, let me ping a bit more broadly so we can get some visibility. CC: @WordPress/gutenberg-design

Thank you for the contribution!

@jasmussen jasmussen added the Needs Design Feedback Needs general design feedback. label Jun 17, 2024
@jarekmorawski
Copy link
Contributor

jarekmorawski commented Jun 17, 2024

Looks good to me! About the featured image, does it appear in the List View as a separate block? Could I move it to the left or right or rearrange the block's content in any way? If so, perhaps it'd be a Cover image block (or a variation of it) that'd inherit all of its awesome customization options?

@docpop
Copy link
Author

docpop commented Jun 17, 2024

This looks fantastic. Great job, @crisbusquets!

@crisbusquets
Copy link
Contributor

Looks good to me! About the featured image, does it appear in the List View as a separate block? Could I move it to the left or right or rearrange the block's content in any way? If so, perhaps it'd be a Cover image block (or a variation of it) that'd inherit all of its awesome customization options?

Hi @jarekmorawski !

I envisioned it behaving as the Site Logo block, because it has the right ratio (usually audio covers are squares).
For alignment, I imagined we could keep it on the left side for the first iteration.

What do you think?

@jasmussen
Copy link
Contributor

I wonder if technically it could have the aspect ratio control, but default to 1:1? Cris makes a great point that square is pretty uniformly standard for audio metadata images, but if you could optionally set a portrait orientation, it might be neat for audiobooks?

@jarekmorawski
Copy link
Contributor

but if you could optionally set a portrait orientation, it might be neat for audiobooks?

Or author portraits for podcasts. 🤔 Does that mean it should be an inner block or a section in the parent block?

@jasmussen
Copy link
Contributor

It can be built-in, just like it is in Media & Text. Though it would need a custom aspect ratio control on the parent block, "Thumbnail aspect ratio". That's likely still simpler than an inner-block you'd have to select. They're already hard to select since the whole clickable area is a button to upload.

@crisbusquets
Copy link
Contributor

I've checked the Figma file and realized that I already had the Aspect Ration inside Settings, but for some reason I didn't include it on the prototype I shared above 😅

Would something like this work, @jasmussen @jarekmorawski ?

11_d_lettre_pixl-block_uploaded-cover

@jasmussen

This comment was marked as resolved.

@docpop
Copy link
Author

docpop commented Jun 20, 2024 via email

@jasmussen jasmussen added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels Jun 20, 2024
@jasmussen
Copy link
Contributor

I've gone ahead and updated this issue to ideally woo a dev to take on the task. Design feedback is still entirely welcome, but the issue should now be more actionable. Thanks for all the work!

@jameskoster
Copy link
Contributor

Please correct me if I'm wrong, but I believe media files like audio and video accept a Featured Image (like posts and pages). With that in mind I'd consider omitting the cover image initially, or at least working out how to connect it with the featured image.

Given we have a dedicated Featured Image block, I wonder if we should lean more on patterns for its inclusion here.

It's not clear from the mockup, but ideally it would be possible to directly manipulate the title/description on the canvas, similar to Image captions. There may even be an argument for these to also be separate blocks (bits?), for greater design expression.

@docpop
Copy link
Author

docpop commented Jun 21, 2024 via email

@jameskoster
Copy link
Contributor

I don't think the current audio block allows you to add an image. If it
does, I can't find it.

Sorry, I should have been more specific. I'm referring to featured images attached to media files:

Screenshot 2024-06-21 at 16 19 59

My point is; if you insert an audio file from the media library, and that file has a featured image, that should probably be connected to the 'cover' option somehow.

@dhanson-wp
Copy link

one for using an image from the library and the other for selecting the featured image of that particular post

This would be my expectation as a user. That gives you flexibility to have a custom image or reuse the featured image.

I find the player controls to be too small, especially on mobile. What if there were some settings to control the size of the play/pause icon?

@jasmussen
Copy link
Contributor

jasmussen commented Jul 10, 2024

My point is; if you insert an audio file from the media library, and that file has a featured image, that should probably be connected to the 'cover' option somehow.

Good point. Here's an updated mockup to address that:

audio block test

Note how, in order to make this issue more immediately actionable, this one also uses a completely vanilla/unstyled audio player, similar to how the video block uses an unstyled video player. I also slightly updated the inspector to orient itself similarly to the video player. If no-one objects, I'll update this issue to reflect this one!

Figma.

@jameskoster
Copy link
Contributor

The 'Metadata' panel seems like a good idea, and will conceptually align with any future inspector-based media file editing UI (#55238).

On that note I wonder if it would make sense to re-use the featured image UI from the page inspector?

Screenshot 2024-07-10 at 11 50 27

@jasmussen
Copy link
Contributor

It could! For now I took inspiration from the existing Video block UI, ideally improvements we could apply to both:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Audio Affects the Audio Block Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

8 participants