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: User defined filters are ignored if the name matches theme origin filters. #35650

Open
scruffian opened this issue Oct 14, 2021 · 0 comments
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Comments

@scruffian
Copy link
Contributor

Description

If a user creates a setting in the user origin in theme.json, we override the value in the core and theme origins.

However with duotone filters, the filter SVG itself is created using value_func which calls gutenberg_render_duotone_filter_preset, which hooks the SVG to the wp_footer action. When a user has the same duotone filter defined in both the theme and user origins, both SVGs are output.

Because the theme origin one is output first, the CSS filter users that one, so the user origin one is ignored.

I'm not sure how to solve this. Ideally only one SVG would be output per filter.

To see this in action you can try this PR:
Automattic/themes#4740

Step-by-step reproduction instructions

  1. Switch to Skatepark
  2. Go to the customizer
  3. Go to the colors panel
  4. Select a new color palette
  5. Save your changes
  6. Notice that the default filter hasn't changed
  7. Find the SVG for the default filter in your console and remove it
  8. Notice that the new default filter is now applied

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@scruffian scruffian added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Oct 14, 2021
@jordesign jordesign added the [Type] Enhancement A suggestion for improvement. label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants