responsive web design en drupal

48
RESPONSIVE WEB DESIGN en Drupal PRESENTE Y FUTURO

Upload: cristina-chumillas

Post on 18-Dec-2014

1.246 views

Category:

Technology


0 download

DESCRIPTION

A día de hoy el Responsive Web Design ya ha dejado claro que no es una moda o una opción, sino una necesidad. De hecho, se prevé que en 2014 el tráfico de Internet móvil ya suponga al 50% del total. Esta es la presentación que hicimos junto a Pako García para la DrupalCampSpain 2013. Entramos en los conceptos básicos del Responsive para contextualizar, pero sesión estuvo enfocada a mostrar qué procesos, «themes» y módulos usamos actualmente en nuestro día a día. Los temas principales fueron: Mobile first Breakpoints Responsive Images/Picture «Themes» responsive Menús Y todo ello con un ojo puesto en D8 para saber qué va a tener continuidad y ver qué vamos a encontrarnos.

TRANSCRIPT

Page 1: Responsive Web Design en Drupal

RESPONSIVE WEB DESIGN en DrupalPRESENTE Y FUTURO

Page 2: Responsive Web Design en Drupal

QUIENES SOMOS

Cristina [email protected]@ymbra.com

WE ARE DRUPAL DREAMERS!

Pako [email protected]@ymbra.com

Page 3: Responsive Web Design en Drupal

¿QUÉ TRATAREMOS?

● RWD● Mobile first● Temas responsive ● Responsive Images/Picture● Menús● Breakpoints i D8

Page 4: Responsive Web Design en Drupal

¿QUÉ ES RESPONSIVE WEB DESIGN (RWD)?

Ethan Marcotte(A List Apart, 2010)

1. REJILLAS (GRID) FLUIDOS O LÍQUIDOS

2. IMÁGENES FLEXIBLES

3. MEDIA QUERIES

Page 5: Responsive Web Design en Drupal

¿QUÉ ES RWD?

1. REJILLAS (GRID) FLUIDOS O LÍQUIDOS

Page 6: Responsive Web Design en Drupal

QUÉ ES RWD?

2. IMÁGENES FLEXIBLES

Page 7: Responsive Web Design en Drupal

QUÉ ES RWD?

2. MEDIA QUERIES

@media all and (min-width: 320px) { .col { background-color: red } .co2 { background-color: blue1} .co3 { background-color: blue2}}@media all and (min-width: 768px) { .col1 { float: left; width: 50% } .col2 { float: left; width: 50% } .col3 { clear:both }}

Page 8: Responsive Web Design en Drupal

QUÉ ES RWD?

vs

RWD APP MÓBIL

WEBm.foo.com

vs

Page 9: Responsive Web Design en Drupal

QUÉ ES RWD?

RWD APP MÓBIL

WEBm.foo.com

Si tienes APP,

Page 10: Responsive Web Design en Drupal

QUÉ ES RWD?

RWD APP MÓBIL

WEBm.foo.com

necesitas web.

Page 11: Responsive Web Design en Drupal

QUÉ ES RWD?

RWD APP MÓBIL

WEBm.foo.com

Si tienes versión móvil,

Page 12: Responsive Web Design en Drupal

QUÉ ES RWD?

RWD APP MÓBIL

WEBm.foo.com

mismos problemas que RWD.

Page 13: Responsive Web Design en Drupal

MOBILE FIRST

¿Qué es?

Diseñar y construir primeropensando en móviles.

Page 14: Responsive Web Design en Drupal

MOBILE FIRST

¿Por qué?

● Priorizamoscontenidoy funcionalidad

Page 15: Responsive Web Design en Drupal

MOBILE FIRST

¿Por qué?

● Priorizamos contenido y funcionalidad

● Más fácil reorganizar1 columna a varias,que al revés

Page 16: Responsive Web Design en Drupal

MOBILE FIRST

¿Por qué?

● Priorizamos contenido y funcionalidad

● Más fácil reorganizar 1 columna a varias, que al revés

● Foco en peformance desde el inicio

Page 17: Responsive Web Design en Drupal

MOBILE FIRST

¿Tan importante es?

Page 18: Responsive Web Design en Drupal

MOBILE FIRST

¿Tan importante es?

201450% tráfico(previsión 2012)

Page 19: Responsive Web Design en Drupal

MOBILE FIRST

¿Tan importante es?

67% usuariosque entra en web no optimitzada la abandona al momento

Page 20: Responsive Web Design en Drupal

RWD EN DRUPAL

Page 21: Responsive Web Design en Drupal

RWD EN DRUPAL

● RESPONSIVE THEMES

● RESPONSIVE IMAGES

● MENUS

Page 22: Responsive Web Design en Drupal

Responsive themes

111.367 sitios actuales(1,093,968 descargas)

67.136 48.417 27.576 11.190

Page 23: Responsive Web Design en Drupal

Responsive themes: ZEN

● Usa Zen GRIDS http://zengrids.com/

● Media queries == mobile first ● respond.js per >IE8● Layout con solución de menú RWD

Page 24: Responsive Web Design en Drupal

Responsive themes: ZEN

_responsive.scss:

Valores comunes: Ancho del separador$zen-gutter-width: 20px;

Definición de elemento contenedor de la GRID@include zen-grid-container();@include zen-grid-item-base();

Reset de GRID@include zen-clear();

Page 25: Responsive Web Design en Drupal

Responsive themes: ZEN

_responsive.scss:

Valor de las columnas x cada mediaquery@media all and (min-width: 480px) {$zen-column-count: 1;

Definición de GRIDs x cada mediaquery@media all and (min-width: 480px) and (max-width: 959px) {

@include zen-grid-item(2, 2);

Page 26: Responsive Web Design en Drupal

Responsive themes: ZEN

_responsive.scss:

Solución menú RWD

@media all and (min-width: 480px) { #main {

padding-top: $nav-height;position: relative;

} #navigation {

position: absolute;top: 0;height: $nav-height;width: $zen-grid-width;

}}

Page 27: Responsive Web Design en Drupal

Responsive themes

● 960 grid● Concepto Delta como creador de

diseños reaprovechables.● Posibilita mucha configuración

desde interfaz de usuario.● Muchas posibilidades.● No incluye soporte base Sass

● Fluid Layout● Breakpoint

Susy GRIDS ● Selectivizr.js● SMACSS● CSS3 Media Queries JS, Respond.js● CSS3 PIE, HTML5 shiv● LiveReload built-in support

Page 28: Responsive Web Design en Drupal

Responsive images

<picture width="500" height="500"> <source media="(min-width: 45em)" src="/large.jpg"> <source media="(min-width: 18em)" src="/med.jpg"> <source src="/small.jpg"> <img src="/small.jpg" alt=""> <p>Accessible text</p></picture>

Responsive Images Community Group ha propuesto este nuevo elemento como

solución.

Elemento nuevo con un comportamiento que es, por ahora, controlado por

JavaScript.

Page 29: Responsive Web Design en Drupal

Responsive images

Cambio mediante CSS.No hay diferencia entre proporciones.

Cambio tamaño en servidor.Devuelve imagen recortada y escalada.

Page 30: Responsive Web Design en Drupal

Responsive images

• BreackpointsResponsiveImages

• Picture

dgo.to/picturedgo.to/breakpoints

AdaptiveImages

dgo.to/resp_img dgo.to/adaptive_image

5272 instalaciones2025 instalaciones2297/7343instalaciones

1 2 3Soluciones responsive más usadas:

Page 31: Responsive Web Design en Drupal

Responsive images

Responsive Images21Crear sufijos.

2Definir sufijo por defecto.

Page 32: Responsive Web Design en Drupal

Responsive images

Responsive Images2 3Crear estilos responsive.

Page 33: Responsive Web Design en Drupal

Responsive images

Responsive Images24Seleccionar estilo responsive base.

Page 34: Responsive Web Design en Drupal

Responsive images

Picture + Breackpoints3

1

23

Page 35: Responsive Web Design en Drupal

Responsive images

Picture + Breackpoints35 Configuration » Media » Picture

6 Structure » Content types » Article » Manage display

Page 36: Responsive Web Design en Drupal

Menus

Solución ZEN (o similar)Posicionar el menú (items) después del contenido y recolocarlo con posición absoluta según la media-query.En versión móvil un enlace simple al anchor «menu» llevará a los enlaces.

Para ocultar/mostrar contenido mejor CSS que Javascript.

Las conexiones lentas nos delatan!

CO

MP

LEJI

DA

D

Page 37: Responsive Web Design en Drupal

Menus

Usando un módulo

+ Muchas opciones configurables.- Poca autonomía, mucho ruido.

Responsive menushttp://dgo.to/responsive_menus

Responsive navigationhttp://dgo.to/responsive_navigation

Superfishhttp://dgo.to/superfishC

OM

PLE

JID

AD

Page 38: Responsive Web Design en Drupal

Opciones 100% CSS

+ Funcionamiento sin JavaScript- Tenemos que adaptarlo al marcado de Drupal.

Menú Sidehttp://bit.ly/17QeEuG

MenusC

OM

PLE

JID

AD

Page 39: Responsive Web Design en Drupal

Menus

Opciones 100% CSS

+ Funcionamiento sin JavaScript- Tenemos que adaptarlo al marcado de Drupal

Simple con Submenúhttp://bit.ly/Qqiw02

CO

MP

LEJI

DA

D

Page 40: Responsive Web Design en Drupal

Menus

Opciones 100% CSS

+ Funcionamiento sin JavaScript- Tenemos que adaptarlo al marcado de Drupal

Simple togglehttp://bit.ly/1c2FH9Q

CO

MP

LEJI

DA

D

Page 41: Responsive Web Design en Drupal

Menus

Opciones 100% CSS

+ Funcionamiento sin JavaScript- Tenemos que adaptarlo al marcado de Drupal

Simple navigation menuhttp://bit.ly/VZyAIV

CO

MP

LEJI

DA

D

Page 42: Responsive Web Design en Drupal

Otros temas: Tablas RWD

Fijación de cabecerahttp://bit.ly/LPHp5n

Adaptación de la informaciónhttp://bit.ly/dHpDua

FooTablehttp://dgo.to/footable

Page 43: Responsive Web Design en Drupal

Otros temas: Problemas conocidos

Mobile Theme

Context Mobile detect

Soluciones (malas):

Problemas con la Caché al hacer un theme solamente para móvilhttp://dgo.to/1591208

Problemas con la caché al usar el contexto para los dispositivos móviles:http://dgo.to/1768556

Usar Varnish para detectar el dispositivo (complejo)No cachear la versión móvil (bajo rendimiento)

Page 44: Responsive Web Design en Drupal

RWD en Drupal 8

Responsive Admin theme: Toolbar

Page 45: Responsive Web Design en Drupal

RWD en Drupal 8

Responsive Admin theme: Theme

* Overlay

Page 46: Responsive Web Design en Drupal

RWD en Drupal 8

Responsive core themes

MOBILETABLETDESKTOP

Page 47: Responsive Web Design en Drupal

RWD en Drupal 8

Responsive images: Breakpoints+Picture

Page 48: Responsive Web Design en Drupal

¿¿PREGUNTAS?? ¡¡GRACIAS!!

Cristina [email protected]@ymbra.com

WE ARE DRUPAL DREAMERS!

Pako [email protected]@ymbra.com