From 4638a8e42616891e05b1e38bad17da9e5daef19e Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 21 Sep 2022 11:28:21 +0000 Subject: [PATCH] =?UTF-8?q?Update=20Posts=20=E2=80=9Ca-post-with-code-samp?= =?UTF-8?q?les=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/posts/a-post-with-code-samples.md | 64 +++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/posts/a-post-with-code-samples.md diff --git a/src/posts/a-post-with-code-samples.md b/src/posts/a-post-with-code-samples.md new file mode 100644 index 0000000..f5af1c5 --- /dev/null +++ b/src/posts/a-post-with-code-samples.md @@ -0,0 +1,64 @@ +--- +title: A post with code samples +date: 2019-06-18 +tags: + - demo-content + - code + - blog +--- +The best way to demo a code post is to display a real life post, so check out this one from [andy-bell.design](https://andy-bell.design/wrote/creating-a-full-bleed-css-utility/) about a full bleed CSS utility. + +- - - + +Sometimes you want to break your components out of the constraints that they find themselves in. A common situation where this occurs is when you don’t have much control of the container that it exists in, such as a CMS main content area. + +This is even more the case with editing tools such as the [WordPress Gutenberg editor](https://wordpress.org/gutenberg/), where in theory, you could pull in a component from a design system and utilise it in the main content of your web page. In these situations, it can be pretty darn handy to have a little utility that makes the element 100% of the viewport’s width _and_ still maintain its flow within its parent container. + +This is when I normally pull the `.full-bleed` utility class out of my back pocket. + +## The `.full-bleed` utility + +It’s small, but hella mighty: + +```css +.full-bleed { + width: 100vw; + margin-left: 50%; + transform: translateX(-50%); +} +``` + +Here it is in a context where it makes a fancy `