Skip to content

Instantly share code, notes, and snippets.

@itsdavidmorgan
Last active November 19, 2018 17:17
Show Gist options
  • Save itsdavidmorgan/7fdc7384abd90117baeb6624b81136fb to your computer and use it in GitHub Desktop.
Save itsdavidmorgan/7fdc7384abd90117baeb6624b81136fb to your computer and use it in GitHub Desktop.
Gutenberg Conditional Block Alignment Styles
/* Global Wide And Full Alignment Styles */
.alignwide, .alignfull {
position: relative;
width: 100%;
margin-left: 0px;
margin-right: 0px;
}
/* Full Block Alignment If Sidebar Is Not Present */
.origin-sidebar-inactive.origin-singular .alignfull {
width: 100vw;
left: calc(-50vw + 50%);
margin-left: 0px;
margin-right: 0px;
}
/* Wide Block Alignment If Sidebar Is Not Present */
.origin-sidebar-inactive.origin-singular .alignwide {
width: calc(100% + 120px);
left: -60px;
margin-left: 0px;
margin-right: 0px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment