Skip to content

Commit

Permalink
Fix HTML preview for themes applying global margins (#13416)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored and talldan committed Jan 23, 2019
1 parent 7ae5b0a commit 659f8e8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/block-library/src/html/edit.js
Expand Up @@ -20,7 +20,22 @@ class HTMLEdit extends Component {

componentDidMount() {
const { styles } = this.props;
this.setState( { styles: transformStyles( styles ) } );

// Default styles used to unset some of the styles
// that might be inherited from the editor style.
const defaultStyles = `
html,body,:root {
margin: 0 !important;
padding: 0 !important;
overflow: visible !important;
min-height: auto !important;
}
`;

this.setState( { styles: [
defaultStyles,
...transformStyles( styles ),
] } );
}

switchToPreview() {
Expand Down

0 comments on commit 659f8e8

Please sign in to comment.