Created
November 14, 2023 18:44
-
-
Save ajvillegas/ff499ea7bf10eb17829f5e2bae6d5171 to your computer and use it in GitHub Desktop.
Wide and Full-Width Alignment in WP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Break out of a container in a WP site. */ | |
/* Exclude blocks in the editor. */ | |
.alignfull:not(.wp-block) { | |
margin-left: calc( 50% - 50vw ); | |
margin-right: calc( 50% - 50vw ); | |
max-width: 100vw; | |
} | |
.alignwide { | |
margin-left: max( | |
( 50% - 50vw ) + var( --wp--style--root--padding-left ), | |
( var( --wp--style--global--wide-size ) - var( --wp--style--global--content-size ) ) / -2 | |
); | |
margin-right: max( | |
( 50% - 50vw ) + var( --wp--style--root--padding-right ), | |
( var( --wp--style--global--wide-size ) - var( --wp--style--global--content-size ) ) / -2 | |
); | |
max-width: 100vw; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment