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

Theme provided duotone preset is not displayed in the post editor #48586

Closed
draganescu opened this issue Feb 28, 2023 · 2 comments · Fixed by #49239
Closed

Theme provided duotone preset is not displayed in the post editor #48586

draganescu opened this issue Feb 28, 2023 · 2 comments · Fixed by #49239
Assignees
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended

Comments

@draganescu
Copy link
Contributor

Description

Duotone applied at the level of theme is not visible in the post editor.

Step-by-step reproduction instructions

  1. Install the Skatepark theme
  2. Go to the site editor
  3. Open a template part
  4. Insert an image block
  5. Choose an image from your media library
  6. Notice the image has a duotone filter applied
  7. Go to wordpress admin
  8. Create a new post
    1. Insert an image block
  9. Choose an image from your media library
  10. Notice the image does not a duotone filter applied

The image in the post editor should have a duotone filter applied by the current theme.

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

@draganescu draganescu added [Type] Bug An existing feature does not function as intended [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels Feb 28, 2023
@draganescu draganescu self-assigned this Feb 28, 2023
@draganescu
Copy link
Contributor Author

Notes on investigating this issue:

  • the filter definitions do not load in the edit post iframe because they have to be manually added in the iframe’s rendering
  • in the site editor they are manually added but they come from this global styles hook which depends on a global styles provider which the edit post editor does not have/need

@draganescu
Copy link
Contributor Author

Ways to fix this issue:

  1. add these filters to a new key in the styles that we pass to the iframe via EditorStyles suggested by @youknowriad
  • the problem here is that we'll need to polyfill for a Safari bug which does not use SVGs if they're in the head of a HTML document, which complicates things
  1. export a function that returns the SVG presets which is independent of any global styles hooks and providers, because all we need is the presets which we know without any special processing required, then use this function to add presets to post editor iframe.

I am workiing on (2) and will explore (1) with @ajlende once a fix exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant