-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Duotone doesn't work with Media & Text block #32972
Comments
PR added: #32984 |
Copying over #32984 (comment) for easier reference as to why this hasn't been completed and the workaround that can be used.
|
I would like to nudge this issue now that doing this has become harder in recent versions of WP. Previous to 6.4 (or possibly 6.3?), I was registering a custom block style (e.g., I've switched to to inlining the SVG in the custom block style, but that is far from ideal. If it helps unblock this issue, I'd be quite happy if the duotone option was only available on Media & Text blocks using images rather than videos. I would think that can be detected, but I admittedly don't know. Example of workaround for nowregister_block_style(
'core/media-text',
array(
'name' => 'newspaper-duotone',
'label' => __( 'Newspaper Duotone', 'textdomain' ),
'inline_style' => '.wp-block-media-text.is-style-newspaper-duotone .wp-block-media-text__media { filter: url(\'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg"><defs><filter id="wp-duotone-newspaper"><feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix><feComponentTransfer color-interpolation-filters="sRGB"><feFuncR type="table" tableValues="0.1921568627451 0.89019607843137"></feFuncR><feFuncG type="table" tableValues="0.1921568627451 0.89019607843137"></feFuncG><feFuncB type="table" tableValues="0.1921568627451 0.89019607843137"></feFuncB><feFuncA type="table" tableValues="1 1"></feFuncA></feComponentTransfer><feComposite in2="SourceGraphic" operator="in"></feComposite></filter></defs></svg>#wp-duotone-newspaper\') }',
)
); |
I just had a client request this because it seemed obvious to them that if they could duotone an image, they should be able to duotone it with Media & Text. Given that Columns + Image wouldn't include the same responsive behavior or focal point picker, that's also not a viable workaround in many (most?) cases.
I want to first say that I ❤ the concern for accessibility. That is unambiguously good. To avoid the issue, maybe duotone support can only apply for the block with images? My gut says that wouldn't be that hard. |
Description
Duotone works with Image block but with Media & Text block it isn't working.
Expected behaviour
Duotone is supposed to work with all images (at least JPG and PNG).
Actual behaviour
WordPress information
The text was updated successfully, but these errors were encountered: