{"id":3648,"date":"2017-10-17T10:30:42","date_gmt":"2017-10-17T17:30:42","guid":{"rendered":"https:\/\/2017.seattle.wordcamp.org\/?p=3648"},"modified":"2017-10-16T13:11:45","modified_gmt":"2017-10-16T20:11:45","slug":"death-of-the-media-query","status":"publish","type":"post","link":"https:\/\/seattle.wordcamp.org\/2017\/death-of-the-media-query\/","title":{"rendered":"Death of the Media Query"},"content":{"rendered":"<p><em>Guest post by Saied Abbasi, Web Developer, Founder of <a href=\"https:\/\/wphelp.co\" target=\"_blank\" rel=\"noopener\">WPHelp.Co<\/a>, and <a href=\"https:\/\/2017.seattle.wordcamp.org\/speaker\/saied-abbasi\/\" rel=\"nofollow\">WordCamp Seattle 2017 Speaker<\/a>.<\/em><\/p>\n<p>Maybe you\u2019re a theme developer, maybe you\u2019ve heard of a 12-column grid, or maybe you\u2019re a blogger. Wherever you stand, let me let you in on a secret&#8230;<\/p>\n<h2>The most common solutions to make websites responsive are hacks.<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3653\" data-permalink=\"https:\/\/seattle.wordcamp.org\/2017\/death-of-the-media-query\/death-media-query\/\" data-orig-file=\"https:\/\/seattle.wordcamp.org\/2017\/files\/2017\/10\/death-media-query.jpg\" data-orig-size=\"1200,630\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Death of the Media Query\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/seattle.wordcamp.org\/2017\/files\/2017\/10\/death-media-query-1024x538.jpg\" src=\"https:\/\/2017.seattle.wordcamp.org\/files\/2017\/10\/death-media-query.jpg\" alt=\"Death of the Media Query\" width=\"1200\" height=\"630\" class=\"alignnone size-full wp-image-3653\" srcset=\"https:\/\/seattle.wordcamp.org\/2017\/files\/2017\/10\/death-media-query.jpg 1200w, https:\/\/seattle.wordcamp.org\/2017\/files\/2017\/10\/death-media-query-300x158.jpg 300w, https:\/\/seattle.wordcamp.org\/2017\/files\/2017\/10\/death-media-query-768x403.jpg 768w, https:\/\/seattle.wordcamp.org\/2017\/files\/2017\/10\/death-media-query-1024x538.jpg 1024w, https:\/\/seattle.wordcamp.org\/2017\/files\/2017\/10\/death-media-query-500x263.jpg 500w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p><a href=\"https:\/\/2017.seattle.wordcamp.org\/session\/death-of-the-media-query\/\" rel=\"nofollow\">Death of the Media Query<\/a> will be a discussion on how to employ \u2018vanilla CSS\u2019 to create designs that are fluid across devices. This will enable us to move away from our dependency on frameworks like Bootstrap, be less surgical with our code, and create templates that don\u2019t break with an extra line of text.<\/p>\n<h2>Get ready for some buzzwords.<\/h2>\n<p>We\u2019ll explore fluid solutions from a mixin that throws us back to Geometry class with the magic of linear interpolation, to CSS Grid areas that will change the rules of theme development, and to our dear friend Flexbox that finally came along and said \u201cyou want it centered vertically, no problem!\u201d (In my head Flexbox has the confidence of an NYC construction worker).<\/p>\n<h2>Let\u2019s think about a simple example with Flexbox.<\/h2>\n<p>You have a navigation at the top of your site with 5 links. The links run horizontally across the screen. In an ideal world, you want the first link flush to the left of the screen, the last link flush to the right of the screen, and the three remaining links to be evenly spaced in-between.<\/p>\n<p>This should be easy &#8212; but no. You have your font size set just right, the text of each link covers about half an inch of the screen\u2026 so, let\u2019s see, take 5 links carry the width of 100%, divide by 37 and multiply that by the square root of your font size in pixels &#8212; and voil\u00e0, if nobody ever changes the copy you have a perfectly spaced navigation\u2026 that only works on large screens.<\/p>\n<p>As we\u2019ll explore during Death of the Media Query, we want to avoid these situations where we have to get surgical with our code. You shouldn\u2019t need your graphing calculator to create symmetrical designs. However, dealing with spacing in CSS historically has been tricky.<\/p>\n<p>Instead, if we let Flexbox handle this navigation bar predicament, we can distribute space effortlessly. Just as easily as we can make a font size a few pixels larger, we can take five links, pin the first flush to the left of the screen, the last flush to the right of the screen, and space the other three evenly between\u2026 for all screen sizes.<\/p>\n<p>Don\u2019t believe me? Well you should come to my talk :]<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p>Saied&#8217;s <a href=\"https:\/\/2017.seattle.wordcamp.org\/session\/death-of-the-media-query\/\" rel=\"nofollow\">Death of the Media Query<\/a> session is Saturday at 11am. Don&#8217;t miss it!<\/p>\n<p style=\"text-align: center;margin: 60px auto\"><a class=\"button\" href=\"https:\/\/2017.seattle.wordcamp.org\/tickets\/\" rel=\"nofollow\">GET YOUR WORDCAMP TICKET NOW!<\/a><\/p>\n<p><em>photo credit: <a href=\"https:\/\/www.pexels.com\/u\/fecundap6\/\" target=\"_blank\" rel=\"noopener\">Aphiwat chuangchoem<\/a><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Guest post by Saied Abbasi, Web Developer, Founder of WPHelp.Co, and WordCamp Seattle 2017 Speaker. Maybe you\u2019re a theme developer, maybe you\u2019ve heard of a 12-column grid, or maybe you\u2019re a blogger. Wherever you stand, let me let you in on a secret&#8230; The most common solutions to make websites responsive are hacks. Death of &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/seattle.wordcamp.org\/2017\/death-of-the-media-query\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Death of the Media Query&#8221;<\/span><\/a><\/p>\n","protected":false},"author":11704063,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[168],"tags":[],"class_list":["post-3648","post","type-post","status-publish","format-standard","hentry","category-sessions"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8fuws-WQ","_links":{"self":[{"href":"https:\/\/seattle.wordcamp.org\/2017\/wp-json\/wp\/v2\/posts\/3648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seattle.wordcamp.org\/2017\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seattle.wordcamp.org\/2017\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seattle.wordcamp.org\/2017\/wp-json\/wp\/v2\/users\/11704063"}],"replies":[{"embeddable":true,"href":"https:\/\/seattle.wordcamp.org\/2017\/wp-json\/wp\/v2\/comments?post=3648"}],"version-history":[{"count":4,"href":"https:\/\/seattle.wordcamp.org\/2017\/wp-json\/wp\/v2\/posts\/3648\/revisions"}],"predecessor-version":[{"id":4088,"href":"https:\/\/seattle.wordcamp.org\/2017\/wp-json\/wp\/v2\/posts\/3648\/revisions\/4088"}],"wp:attachment":[{"href":"https:\/\/seattle.wordcamp.org\/2017\/wp-json\/wp\/v2\/media?parent=3648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seattle.wordcamp.org\/2017\/wp-json\/wp\/v2\/categories?post=3648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seattle.wordcamp.org\/2017\/wp-json\/wp\/v2\/tags?post=3648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}