Skip to content

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

Closed

Description

@draganescu

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

Activity

  1. added
    [Type] Bug
    [Feature] Themes
    on Feb 28, 2023
  2. self-assigned this
    on Feb 28, 2023
  3. draganescu commented on Feb 28, 2023

    @draganescu
    ContributorAuthor

    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
  4. draganescu commented on Feb 28, 2023

    @draganescu
    ContributorAuthor

    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

Metadata

Metadata

Assignees

Labels

[Feature] Themes[Type] Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions