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

inline styles ( wp_add_inline_style ) not working in iframed Full Site Editor #33333

Closed
leeshadle opened this issue Jul 9, 2021 · 0 comments · Fixed by #33389
Closed

inline styles ( wp_add_inline_style ) not working in iframed Full Site Editor #33333

leeshadle opened this issue Jul 9, 2021 · 0 comments · Fixed by #33389
Assignees
Labels
[Status] In Progress Tracking issues with work in progress

Comments

@leeshadle
Copy link

Description

Inline styles ( wp_add_inline_style / $wp_styles->add_inline_style ) aren't working in the iframed Full Site Editor.

@ellatrix is working on a fix for this but I wanted to create this issue in case anyone else ran into the same bug.

Step-by-step reproduction instructions

  1. Enqueue stylesheet for a plugin in the Full Site Editor and try adding inline styles using wp_add_inline_style:
function enqueue_editor_styles() {
  // Enqueue editor only styles.
  wp_enqueue_style(
    'my-plugin-block-editor',
    plugin_dir_url( __FILE__ ) . 'build/index.css',
    array(),
    '1.0.0'
  );
  // Add inline styles
  wp_add_inline_style( 'my-plugin-block-editor', 'p { font-size: 100px; }' );
}
add_action(  'enqueue_block_editor_assets', 'enqueue_editor_styles'  );

Expected behaviour

Here's what it looks like when this is working:
Screen Shot 2021-07-09 at 11 55 56 AM

Actual behaviour

Here's what's happening in the iframed Full Site Editor:
Screen Shot 2021-07-09 at 11 57 08 AM

WordPress information

  • WordPress version: 5.7.2
  • Gutenberg version: 10.9.1
  • Are all plugins except Gutenberg deactivated? No
  • Are you using a default theme (e.g. Twenty Twenty-One)? No

Device information

  • Device: Desktop
  • Operating system: macOS Catalina
  • Browser: Chrome 91.0.4472.114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants