Skip to content

Commit

Permalink
Add CSS fix. (#36759)
Browse files Browse the repository at this point in the history
  • Loading branch information
costdev authored and noisysocks committed Nov 30, 2021
1 parent f782308 commit e2a3658
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/widgets/src/blocks/legacy-widget/index.php
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

0 comments on commit e2a3658

Please sign in to comment.