Skip to content

Commit

Permalink
Remove top margin in preview
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Dec 5, 2024
1 parent 311af21 commit a5387c1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/edit-site/src/components/home-view-preview/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ export function HomeViewPreview() {
// Hide the admin bar in the front-end preview.
const document = event.target.contentDocument;
document.getElementById( 'wpadminbar' ).remove();
document
.getElementsByTagName( 'html' )[ 0 ]
.setAttribute( 'style', 'margin-top: 0 !important;' );
// Make links unclickable.
const links = document.getElementsByTagName( 'a' );
Array.from( links ).forEach( ( link ) => {
Expand Down

0 comments on commit a5387c1

Please sign in to comment.