Slide 1

Slide 1 text

Responsive Web Design By Kelvin Gobo

Slide 2

Slide 2 text

● Kelvin Gobo ● Front-End Developer ● PWA Enthusiast ● @kelvingobo A little about me

Slide 3

Slide 3 text

A short story about the web

Slide 4

Slide 4 text

The web was created to share information It has since expanded beyond that of course.

Slide 5

Slide 5 text

Some of the early computers

Slide 6

Slide 6 text

But the demand for the internet grew

Slide 7

Slide 7 text

● Personal computers became more popular ● Sizes of PC became smaller each year ● Mobile devices joined the party ● Tablets came some time later

Slide 8

Slide 8 text

Problem How do we build websites to work on these multiple devices?

Slide 9

Slide 9 text

Temporary solution If the user visits your website on a laptop, serve them the website Else if you detect a mobile device, serve them the mobile version

Slide 10

Slide 10 text

Problem How do you know what device the user visits your site with?

Slide 11

Slide 11 text

Another temporary solution / / check the devices screen width If(screen.width <= 800) { window.location = “http:/ /m.example.com”; }

Slide 12

Slide 12 text

Problem Managing two code bases for the same website

Slide 13

Slide 13 text

Enter Responsive web design

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

“Responsive design is not about designing for mobile. But it’s not about designing for desktop either. Rather it’s about adopting a more flexible, design-agnostic approach.” Ethan Marcotte - Author of Responsive Web Design -

Slide 16

Slide 16 text

Tools to make your website responsive ● Set the viewport ● Media queries ● CSS flexbox

Slide 17

Slide 17 text

Set the Viewport

Slide 18

Slide 18 text

Media queries (Set break points at different device widths)

Slide 19

Slide 19 text

Using media queries ● Embed media queries in css ● Link to css file when device matches a query

Slide 20

Slide 20 text

/ / Embed media queries in CSS body { background-color: red; } @media (max-width: 800px) { background-color: blue; } @media (max-width: 500px) { background-color: yellow; }

Slide 21

Slide 21 text

/ / Link to css file when device matches a query

Slide 22

Slide 22 text

Responsive patterns ● Mostly fluid ● Column drop ● Layout shifter ● Off canvas

Slide 23

Slide 23 text

Mostly fluid The mostly fluid pattern consists primarily of a fluid grid. On large or medium screens, it usually remains the same size, simply adjusting the margins on wider screens.

Slide 24

Slide 24 text

Column drop For full-width multi-column layouts, column drop simply stacks the columns vertically as the window width becomes too narrow for the content.

Slide 25

Slide 25 text

Layout shifter Key to this layout is the way content moves about, instead of reflowing and dropping below other columns. Due to the significant differences between each major breakpoint, it is more complex to maintain and likely involves changes within elements, not just overall content layout.

Slide 26

Slide 26 text

Off canvas Rather than stacking content vertically, the off canvas pattern places less frequently used content—perhaps navigation or app menus—off screen

Slide 27

Slide 27 text

CSS Flexbox

Slide 28

Slide 28 text

Thanks!