Skip to content

transformStyles not working correctly #16408

@pascalknecht

Description

@pascalknecht

Describe the bug
When loading custom css via add_editor_styles not every style is applied when any element has an svg background encoded as a data:image/svg.

To reproduce
Steps to reproduce the behavior:

  1. Enter the following code into the console
    wp.editor.transformStyles([{css: ".navbar-light .navbar-toggler-icon {↵background-image: url(\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\")}"}], '.editor-styles-wrapper');

Expected behavior
The styles should be transformed with .editor-styles-wrapper in front.

Additional context

  • Gutenberg 6.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Package] Editor/packages/editor[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions