Skip to content

Commit

Permalink
[Block Editor]: Inject useBlockPreview styles in iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Jan 12, 2023
1 parent 4f0e10a commit dd0fa73
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

0 comments on commit dd0fa73

Please sign in to comment.