Utilize the new selectors API for duotone #49342
Labels
[Type] Code Quality
Issues or PRs that relate to code quality
[Type] Enhancement
A suggestion for improvement.
Duotone filter support has been added in block.json under the
supports.color.__experimentalDuotone
since it was introduced. It was marked as experimental because it required a special selector different from thesupports.color.__experimentalSelector
.With the selectors API stabilized in #46496, the duotone supports can now utilize it.
Duotone filters were initially added under
color
support when they were only part of block supports and theme.json presets. Then, when global styles support was added, that functionality was nested underfilter
instead. #34667 (comment)The new stabilized duotone block supports should be nested under
filter
following that reasoning.Two changes to block.json (including the schema) are required:
supports.filter.duotone
that enables/disables the feature. It was previously handled bysupports.color.__experimentalDuotone
being set totrue
to use the default block selector orsupports.__experimentalSelector
or set to a string if a custom selector was needed.selectors.filter.duotone
that specifies the custom selector previously nested undersupports.color.__experimentalDuotone
for the case mentioned in 1.Duotone uses the block.json metadata directly, unlike some of the other supports. And there were special cases added for
__experimentalDuotone
throughout the code. So anywhere that was using that should provide an upgrade path by providing a migration or continuing to support it if a migration isn't possible.The text was updated successfully, but these errors were encountered: