Skip to content

Instantly share code, notes, and snippets.

@SimonPadbury
Created January 16, 2020 09:28
Show Gist options
  • Save SimonPadbury/3d2dc69eecfeea998ddb60cb21d70d95 to your computer and use it in GitHub Desktop.
Save SimonPadbury/3d2dc69eecfeea998ddb60cb21d70d95 to your computer and use it in GitHub Desktop.
CSS partial bleed utility
/**
* 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