MGLS #26 Responsive Web Design: The Next Decade (1/4) – Ethan Marcotte

i’m here to talk to you today about accept network blueprints next decade hello everyone my mention is ethan marcotte i’m an independent decorator based in the united states i’m beep on flutter now 2020 well it had a lot of things going on in it but it had one special time in it for me because on may 25 th i had a little bit of an important milestone because 10 year ago something very substantial had occurred in my career which is i published a little article called accept entanglement designing now in the clause i proposed that there was a brand-new way of thinking about designing for the web that the web is really if you think about it the first genuinely flexible intend medium there’s never been anything fairly like it but at the time i wrote the section we were still thinking about designing for the web in terms of siloing its own experience to different devices designing separate portable ordeals various desktop websites separate tablet websites and what i proposed in the article was that we could design across those suffers use the flexibility roasted into the heart of the web as a scheme asset as a strength now in the commodity i put forward a very high level overview of what makes a design responsive and it basically only evaporates down to three distinct parts first and foremost there’s a liquid or adaptable grid that’s established with fractions rather than uncompromising pixels there are flexible idols and media that work within those resilient organizations and then finally there was still media queries which are a little bit of fairy junk from the css3 specification that allow us to articulate how and when those adaptable layouts need to change their contour to adapt to the changing size of a screen or is submitted in response to a differently sized expose now that was then all the way back in 2010 now if we fast forward 10 years the landscape examines dramatically different because i have to be perfectly honest with you it feels very weird being the guy talking about responsive design over a decade last-minute i perfectly imagine i necessitate i just i wrote an article but since that time so many designers and agencies and businesses and symbols and booklets i profoundly respect and admire raced with the idea to a limited extent that i never could have imagined and across nearly every industry from personal blogs and portfolio places to large travel outlets to media reach contest areas to e-commerce places each one of them began to adopt responsive motif and learned that the flexible roasted into the web is a real strength that we can leverage when we’re tailor for more maneuvers and situations than ever before and as they experimented with the accept design they started to share lessons about how it modified their rehearse internally how it created different disciplines closer together and in doing so they were able to build more effectively across all the complexity that we’re being asked to manage on a daily basis in other words as an industry in the last 10 years we’ve started to develop a vocabulary for how layout is evolving into this new weird post-desktop landscape we’re all trying to record with but there’s one question that i still hear from every client that i work with or each company that i speak with on a daily basis and that is so what happens next now really to be clear when i hear this question there’s usually a little bit of panic in the eyes of the person querying it because if you think about it we’ve been asked to deal with a considerable extent of change and complexity exactly in the last 10 years and it’s still changing to this day i represent portable which sort of knocked off the whole accept discussion is still exploding according to some calculates there are nearly eight billion mobile designs estimated to be in use worldwide now tablets are still relatively speaking in newer shop situation and we’re still working on the best way to design for them but they’re still incredibly favourite now this statistic’s a few years older but it still storeys me that in 2011 alone some 80 new tablet designs entered the marketplace in one 12 -month period that’s staggering and of course there’s been a considerable quantity of investment in trying to understand what else might be out there that we should start thinking about designing for so smart tv smart watches another kind of wearable there’s an incredible about of excitement around this question what happens next but here’s their own problems with that question well for one can’t possibly answer it and i don’t think anybody really can we don’t know where we’re going but the only thing that i do know is that in the last 10 years responsive design’s three main ingredients haven’t changed every accept layout is still built today with flexible grids flexible likeness and media queries but the details around every single one of those ingredients have changed in a million different wonderful lanes so with that in recollection let’s look at some of them over the course of this talk i want to actually use the home page of a spurious publication that i’ve designed called the viewport to look at some of the modalities by which accept scheme has changed stayed the same but likewise of the many actions that it’s changed or has become different so squandering this simple design we’ll look at individual bits of this layout and look at how to implement it now in 2020 and in doing so we’re going to review those three parts of a responsive design fluid grids fluid images and media inquiries and we’re going to look at some of the new ways that we can use today to create them so as we look through them you’re going to learn new ways to build responsive designs today and that’s going to help you better prepare your concoctions for the challenges in front of you tomorrow so with that in spirit let’s get started let’s begin right at the top with fluid grids now in continuing our flashback expedition i’m going to bring you the whole way back to the original article and this was sort of the sample layout that i worked on back in 2010 to show how a responsive designing could actually operate how you could marry fluid grids and media queries to build these resilient organizations that could change their contour modify their give deepen the placement of information on the sheet to better suit the amount of seat available to them in a viewport now there’s a lot of excitement around the striking actions in which a accept intend can adapt consuming media inquiries but truly the workhorse of a accept motif is the fluid grid in other words we’re moving away from pixels and defining our organizations and come through here with grid-based motifs that are completely proportional that move in synchronicity in a satisfying and symmetrical lane so in other words every accept intend has to begin with a flexible foundation and that helps us better pattern across all these different machines and frameworks that we’re being asked to reckon with on a daily basis what’s more we have new remarkable tools for creating that resilient organization and i would like to speak about two of them with you today precisely flexbox and the css grid layout framework so let’s start with flexbox now flexbox or the adaptable box modeling mostly is a way to control the distribution of containers factors along an axis i realize it resonates a little confusing but let me show you a very simple example from the viewports homepage precisely i’d like to draw your attention to the masthead that appears at the unusually top of the page which simply contains the logo and the primary piloting now the primary sailing is marked up as a listing in the html but we can actually override its default exhibition and define it as a resilient casket by setting its expose property to flex and then we can also start a flex direction of sequence and this proves the axis along which other points inside the adaptable carton shall be set out so with the flex tendency asset set to row the axis follows the sequence and then the elements inside the flexbox shall be set out across it now we can actually reuse the same mechanic for the entire masthead as well we can set the masthead to expose flex establishing our flexible box and then we can set the flex direction to row again laying out factors along that axis now you’ll notice that these two elements are actually dramatically removed from each other along that axis one on the left one on the right that’s because of this third belonging that we’ve prepare vindicate content’s gap between ensures that there’s well enough space between the elements and distributes them evenly along the axis now the first item will ever lay flush against the starting edge of our flexbox and the last item will always be flush against the ending edge now since there are only two elements inside of our flexbox this is a very easy way to push them to defending demises of their receptacle now what’s incredibly potent about flexbox is that it can work along a horizontal axis as well so let’s turn away from the masthead and actually wreaking our notice closer to the bottom of the page where we’re promoting different blog records that we’ve been publishing in the periodical so each one of these teasers for an individual article is built with flexbox in a similar style to what we just did with the masthead the teaser is basically has a background color attached to it and its presentation property is also set to flex now you might notice that we’re not actually specifying flex tack row here because that’s actually the default value of flex guidance so with that in sentiment we’ve still got an axis moving across the horizontal axis of the box and that’s where the two main pieces of content are laid out on along that axis so the portrait appears on the left and the teaser content appears on the right now the content of the teaser itself though is also set to be a flexible container with the presentation flex owned but here we’re actually adjusting flex direction to column to establish a vertical axis from top to bottom and then the individual aspects inside of there are laid out along that axis now you’ll notice now that there’s a big chink between the headline and the byline that were presented closer to the bottom of the box that’s because we’ve decide the flex stretch owned on the headline to one which mostly tells it as a resilient part to occupy as much space as it can along the axis pushing the contents closer to the bottom and ensuring the headline occupies as much space as possible inside its flexbox receptacle so we’ve just scratched the surface of some of the things that flexbox can do for us in a accept scheme remember it’s basically just about controlling the distribution of ingredients along an axis of a container now css grid is a different devil solely it allows us to layout content in rows and columns within a container now before we dive into code let’s just take a really brief look at some of the differences between machinists of what a css grid does and how they work together so if you’ve worked with any kind of grid in a traditional motif employment or building one in html and css a grid is basically often constructed of pieces right and those are often separated from ditches between them and that’s very true in css grid as well there are pieces and sewers but just as well there are also rows that can be separated by sewers along the vertical axis from top to bottom so let’s see how that can actually work in practice here’s a very simple demo precisely rigged up in some basic html so let’s say we have a container element that has a knot of simple little aspects inside of it that only contain the little snippets of verse now by default because of the course which blocks will flow in material those slice of content will exactly stack on top of each other but if we reform the container from a block rank part into a grid we can set its display asset to grid and then expending the grid template pillars dimension we can set up a column or we can set up a grid of four columns each set to 100 pixels so with that in place we’ve moderately dramatically modified the presentation of the information inside of that container we’re no longer stacking these pieces on top of each other but very they’re automatically going slotted into those individual 100 pixel wide pillars and then flowing down to a second row when they transcend the extent of their receptacle now if we’d like to have a little bit of spacing between those pieces we can use the grid divergence asset and say space them out by 10 pixels and the nice thing about the grid gap dimension is that it’s actually a shorthand property that’s uh expands out to grid article crack and grid sequence chink so if you’d like to control those two spaces independently that’s an option to you as well now what we’ve been looking at still further is witnessing how these components automatically reflow through the grid by default but we can override that behavior and actually specify different placements for those aspects exerting properties like grid tower culminate so for example if i wanted to accord a little bit more prominence to one of these parts i could say grid editorial and encompas to are responsible for ensuring that that ingredient is actually encompassing two pillars now i should probably delay here and just take a moment because what we’re doing here isn’t actually cros two columns in fact let’s take a closer look at how our grid is fabricated so in our grid we have as we built before four separate columns but once we characterized that grid we likewise characterized a place of grid ways that run across the grid from left to right each one of them bounding off one of those columns now those are also numbered and we can refer to those numbered indices when we’re laying out individual grid pieces so for example if we have an individual grid component inside of our container we can say we want its grid tower to aspiration at 3 and 3 refers to a specific grid string a specific column line applying grid tower outcome three we can then say to that item we want you to expand your diameter until you’ve reached that third grid front we can also change the initial placement of the item let’s say grid tower start 2 and grid tower tip five and that’ll ensure that that item begins at the second grid text and demises at the fifth one now we could also be a little bit less precise we can use the span keyword to mostly determine how many wrinkles from the opposite edge this particular grid piece should span so here we want it to span three cables so if we’re starting from two we would then end at five we are capable of even collapse all the css a little bit further and move it down into the individual grid article quality which is just a shorthand value that allows us to specify the start and discontinuing predicaments[ Music]

As found on YouTube

Share this article

Leave a comment

Related Posts