Created
January 16, 2020 09:28
-
-
Save SimonPadbury/3d2dc69eecfeea998ddb60cb21d70d95 to your computer and use it in GitHub Desktop.
CSS partial bleed utility
This file contains hidden or 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
/** | |
* Iterating from Andy Bell's full-bleed CSS utility (https://hankchizljaw.com/wrote/creating-a-full-bleed-css-utility/) | |
* simply set a max-width for those blocks you want to be wider than your centered prose column. | |
* Useful if you have an image (or background image) that doesn't look good on massively wide viewports. | |
*/ | |
.partial-bleed { | |
width: 100vh; | |
max-width: 1200px; /* example assumes your main prose max-width is e.g. 800px */ | |
margin-left: 50%; | |
transform: translateX(-50%); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment