Skip to content

Commit

Permalink
[Block Editor]: Inject useBlockPreview styles in iframe (#47110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Jan 13, 2023
1 parent e0f919c commit 7958a39
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
23 changes: 23 additions & 0 deletions packages/block-editor/src/components/block-preview/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,26 @@
.block-editor-block-preview__content-iframe .block-list-appender {
display: none;
}

.block-editor-block-preview__live-content {
* {
pointer-events: none;
}

// Hide the block appender, as the block is not editable in this context.
.block-list-appender {
display: none;
}

// Revert button disable styles to ensure that button styles render as they will on the
// front end of the site. For example, this ensures that Social Links icons display correctly.
.components-button:disabled {
opacity: initial;
}

// Hide placeholders.
.components-placeholder,
.block-editor-block-list__block[data-empty="true"] {
display: none;
}
}
23 changes: 0 additions & 23 deletions packages/block-editor/src/components/block-preview/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,6 @@
}
}

.block-editor-block-preview__live-content {
* {
pointer-events: none;
}

// Hide the block appender, as the block is not editable in this context.
.block-list-appender {
display: none;
}

// Revert button disable styles to ensure that button styles render as they will on the
// front end of the site. For example, this ensures that Social Links icons display correctly.
.components-button:disabled {
opacity: initial;
}

// Hide placeholders.
.components-placeholder,
.block-editor-block-list__block[data-empty="true"] {
display: none;
}
}

// The goal of this pseudo-element is to cover the iframe
// otherwise it won't be able to drag elements containing
// the preview iframe in Safari.
Expand Down

1 comment on commit 7958a39

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 7958a39.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3909566521
📝 Reported issues:

Please sign in to comment.