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

Duotone filter not rendering in some places #35331

Open
ajlende opened this issue Oct 4, 2021 · 2 comments
Open

Duotone filter not rendering in some places #35331

ajlende opened this issue Oct 4, 2021 · 2 comments

Comments

@ajlende
Copy link
Contributor

@ajlende ajlende commented Oct 4, 2021

Description

When applying duotone as a block style in theme.json, there are still a couple places the duotone filter doesn't get applied.

See #34667 (comment)

The thumbnail for block patterns that use duotone won't show the filter applied:
Screenshot 2021-09-29 at 17 22 27

The site editor shows the image without a filter but the frontend works fine. The post editor when I insert an image does work fine:
Screenshot 2021-09-29 at 17 22 51

To reproduce

You can test on Skatepark applying Automattic/themes#4740

Or by adding the following to your theme.json for testing the image and cover blocks.

{
	"styles": {
		"blocks": {
			"core/cover": {
				"filter": {
					"duotone": "var(--wp--preset--duotone--blue-red)"
				}
			},
			"core/image": {
				"filter": {
					"duotone": "var(--wp--preset--duotone--blue-red)"
				}
			}
		}
	}
}
@ajlende
Copy link
Contributor Author

@ajlende ajlende commented Oct 4, 2021

The SVG containing the filter is generated during the admin_footer hook which, I think, is causing the issue.

The assets for the site editor are generated during the admin_footer-toplevel_page_gutenberg-edit-site hook which is the last hook in admin-footer.php, so the SVG never gets rendered.

@carolinan
Copy link
Contributor

@carolinan carolinan commented Oct 5, 2021

Did you try without using a preset var?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants