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

Add CSS fix for 33580. #36759

Merged
merged 1 commit into from
Nov 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions packages/widgets/src/blocks/legacy-widget/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,33 @@ function handle_legacy_widget_preview_iframe() {
padding: 0 !important;
margin: 0 !important;
}

/* Hide root level text nodes */
body {
font-size: 0 !important;
}

/* Hide non-widget elements */
body *:not(#page):not(#content):not(.widget):not(.widget *) {
display: none !important;
font-size: 0 !important;
height: 0 !important;
left: -9999px !important;
max-height: 0 !important;
max-width: 0 !important;
opacity: 0 !important;
pointer-events: none !important;
position: absolute !important;
top: -9999px !important;
transform: translate(-9999px, -9999px) !important;
visibility: hidden !important;
z-index: -999 !important;
}

/* Restore widget font-size */
.widget {
font-size: var(--global--font-size-base);
}
</style>
</head>
<body <?php body_class(); ?>>
Expand Down