responsive design 08 - github pages · responsive design ‣ eliminates the distinction between...

13
SPRING 2019 CS 498RK RESPONSIVE DESIGN mobile maers

Upload: others

Post on 25-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

SPRING 2019CS 498RK

RESPONSIVE DESIGN

mobile matters

Page 2: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

ideaA website should look good on

every display, from wide screens to mobile devices.

Page 3: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

RESPONSIVE DESIGN‣ Eliminates the distinction

between mobile and desktop websites.

‣ Allows a single codebase that is displayed differently in various screen sizes

‣ Achieved through media queries

https://developers.google.com/web/fundamentals/design-and-ux/responsive/

Page 4: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

4%47%

49% Mobile

Desktop

Tablet

Page 5: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

https://internetingishard.com/html-and-css/responsive-design

Page 6: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

MEDIA QUERIES

@media only screen and (min-width: 961px) { <regular-css-rules> }

Page 7: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

MEDIA QUERIES

@media only screen and (min-width: 961px) { <regular-css-rules> }

at-rule

media type

media feature

Page 8: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

VIEWPORT ZOOMING

<meta name='viewport' content='width=device-width, initial-scale=1.0'/>

‣ By default, mobile devices zoom out to fit entire desktop layout onto the viewport.

‣ This prevents mobile devices from rendering responsive designs,

‣ In order to disable it, we need to specify a <meta> tag in the <head>

https://internetingishard.com/html-and-css/responsive-design

Page 9: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

DESIGN

https://internetingishard.com/html-and-css/responsive-design

‣ Start with the design of how the website will look at every breakpoint.

‣ Various responsive design patterns exist. (Mostly Fluid, Column Drop, Layout Shifter, etc.)

‣ Implement them using media queries.

‣ We will use Layout Shifter.

Page 10: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

DESIGN

https://internetingishard.com/html-and-css/responsive-design

‣ Fluid Layout: Content stretches/shrinks to fill the entire viewport.

‣ Fixed-Width Layout: Content has the same width regardless of the viewport

‣ Generally, Mobile/Tablet → Fluid, Desktop → Fixed-Width

Page 11: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

BASIC PRINCIPLES‣ Mobile-First: Start implementing mobile version first

to maximize code reuse.

‣ Choosing Breakpoints: Don’t need to be device specific (i.e. iPhone X vs Galaxy S9). Take advantage of ranges.

‣ Relative vs Static Units: Use relative units when you want your content to adapt (when you don’t have enough screen real-estate), static units when you want the same look (when you have enough space).

http://blog.froont.com/9-basic-principles-of-responsive-web-design/

Page 13: responsive design 08 - GitHub Pages · RESPONSIVE DESIGN ‣ Eliminates the distinction between mobile and desktop websites. ‣ Allows a single codebase that is displayed differently

RESOURCES

https://internetingishard.com/html-and-css/responsive-design

https://developers.google.com/web/fundamentals/design-and-ux/responsive/

https://alistapart.com/article/responsive-web-design/

http://gs.statcounter.com/platform-market-share/desktop-mobile-tablet