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 duotone support to Media & Text block #32984

Closed

Conversation

thisissandip
Copy link
Contributor

Fixes #32972

Description

Add duotone filters support to Media and Text block

How has this been tested?

  1. Select Media and Text Block
  2. Add Image
  3. Duotone filters should be available for Image

Screenshots

image

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@annezazu
Copy link
Contributor

@ajlende perhaps you can take a look at this :)

@ajlende
Copy link
Contributor

ajlende commented Jun 25, 2021

The media and text block doesn't support duotone because it allows for video elements with controls, and the SVG filter applies to the video controls as well causing contrast accessibility issues. (See #26361 (comment))

If you want to have a duotone image next to text, I'd suggest using columns to arrange the image and text side-by-side.

#31373 includes conditionally enabling duotone for a block which would allow us to disable duotone when the video is shown and preventing the accessibility issue. It can also be applied to the video block when controls are disabled once that is in place.

Longer-term I've been experimenting with rendering out videos with the duotone effect on the server so the effect is only applied to the video. There's also the suggestion from #26361 (comment) that could be explored if the server-side rendering doesn't work out.

So for now, we'll have to wait for conditional duotone to land. I hope you understand. Thanks! 🙂

@ajlende ajlende closed this Jun 25, 2021
@thisissandip thisissandip deleted the add/duotone-to-media-text branch June 25, 2021 20:08
@jasmussen
Copy link
Contributor

Thanks for exploring this. Another solution to enabling soft-duotone (as opposed to video baked-in) on videos, is to create a custom set of overlay video controls, which would arguably be a customization benefit for the video block overall. This would allow the SVG to target just the video, without affecting the controls.

@thisissandip
Copy link
Contributor Author

@jasmussen I would love to give this a try. Are there any design mockups or styles that I should be aware of?

@jasmussen
Copy link
Contributor

No mockups that I'm aware of, no. I'm unsure of how big of an effort it would be, my instinct tells me it's quite an undertaking to make sure such JS-based overlay controls work correctly with all the accessibility that entails. If you find a good path forward, I'd be happy to take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Media & Text Affects the Media & Text Block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duotone doesn't work with Media & Text block
4 participants