charla de flexbox en frontenders valencia

61

Upload: daniel-martinez

Post on 03-Jul-2015

511 views

Category:

Technology


1 download

DESCRIPTION

Presentación sobre el módulo Flexbox en los meetup de Frontenders Valencia.

TRANSCRIPT

Page 1: Charla de Flexbox en Frontenders Valencia
Page 2: Charla de Flexbox en Frontenders Valencia

flexbox

Page 3: Charla de Flexbox en Frontenders Valencia

floatfloat:left

Page 4: Charla de Flexbox en Frontenders Valencia

float

Page 5: Charla de Flexbox en Frontenders Valencia

float

Page 6: Charla de Flexbox en Frontenders Valencia

float

Page 7: Charla de Flexbox en Frontenders Valencia

float• Dificultad para organizar • El posicionamiento visual depende del markup • No puedes centrar • No controlas las alturas en sistemas de columnas

Page 8: Charla de Flexbox en Frontenders Valencia

tabledisplay:table

display:table-celldisplay:table-rowdisplay:table-caption…

Page 9: Charla de Flexbox en Frontenders Valencia

display:table-cell

Page 10: Charla de Flexbox en Frontenders Valencia

display:table-cell

Page 11: Charla de Flexbox en Frontenders Valencia

flexbox

Page 12: Charla de Flexbox en Frontenders Valencia

flexboxdisplay:flex

Page 13: Charla de Flexbox en Frontenders Valencia

flexboxdisplay:-ms-flexbox; display:flex

Page 14: Charla de Flexbox en Frontenders Valencia

flexboxdisplay:-moz-flex; display:-ms-flexbox; display:flex

Page 15: Charla de Flexbox en Frontenders Valencia

flexboxdisplay:-webkit-flex; display:-moz-flex; display:-ms-flexbox; display:flex

Page 16: Charla de Flexbox en Frontenders Valencia

flexboxdisplay:-webkit-box; display:-webkit-flex; display:-moz-flex; display:-ms-flexbox; display:flex

Page 17: Charla de Flexbox en Frontenders Valencia

caniuse.com

Page 19: Charla de Flexbox en Frontenders Valencia

flexboxdisplay:-webkit-box; display:-webkit-flex; display:-moz-flex; display:-ms-flexbox; display:flex

@include flexbox;

Page 20: Charla de Flexbox en Frontenders Valencia

flexboxProvee una forma más eficiente de maquetar cubriendo

espacios disponibles expandiendo elementos o encogiéndolos.

Page 21: Charla de Flexbox en Frontenders Valencia

.container {display: flex;

}

Page 22: Charla de Flexbox en Frontenders Valencia

eje horizontal

Page 23: Charla de Flexbox en Frontenders Valencia

.container {display: flex;justify-content: flex-start;

}

.item {

}

Page 24: Charla de Flexbox en Frontenders Valencia

justify-content: flex-start

Page 25: Charla de Flexbox en Frontenders Valencia

.container {display: flex;justify-content: flex-end;

}

.item {

}

Page 26: Charla de Flexbox en Frontenders Valencia

justify-content: flex-end

Page 27: Charla de Flexbox en Frontenders Valencia

.container {display: flex;justify-content: center;

}

.item {

}

Page 28: Charla de Flexbox en Frontenders Valencia

justify-content: center

Page 29: Charla de Flexbox en Frontenders Valencia

.container {display: flex;justify-content: space-between;

}

.item {

}

Page 30: Charla de Flexbox en Frontenders Valencia

justify-content: space-between

Page 31: Charla de Flexbox en Frontenders Valencia

.container {display: flex;justify-content: space-around;

}

.item {

}

Page 32: Charla de Flexbox en Frontenders Valencia

justify-content: space-around

Page 33: Charla de Flexbox en Frontenders Valencia

justify-content

justify-content: flex-start

justify-content: flex-end

justify-content: center

justify-content: space-between

justify-content: space-around

Page 34: Charla de Flexbox en Frontenders Valencia

.container {display: flex;justify-content: space-around;flex-wrap: wrap;

}

.item {width: 200px;

}

Page 35: Charla de Flexbox en Frontenders Valencia

flex-wrap

Page 36: Charla de Flexbox en Frontenders Valencia

flex-wrap

Page 37: Charla de Flexbox en Frontenders Valencia

eje vertical

Page 38: Charla de Flexbox en Frontenders Valencia

.container {display: flex;justify-content: flex-end;align-items: flex-start; // default

}

.item {

}

Page 39: Charla de Flexbox en Frontenders Valencia

align-items: flex-start

José Dimas es fundador de Ockham Ti, empresa de desarrollo de software, app móviles, videojuegos y cursos. Profesor de universidad. Ha trabajado en varias universidades de El Caribe, México y de EscuelaIT.

El Mariachi

I create scalable and robust CSS, focusing in maintainability. I Apply DRY rules and some OOCSS (Not every time, CSS is still cascade) and I always comment my CSS with BEM comments.

I usually attach myself to these rules and guidelines when coding CSS.

I use CSS frameworks, (not design frameworks like Bootstrap/Foundation or similar). I believe a framework should do your work easier, it is not meant to do ALL the work: Every project evolves in a different way and depending on its path.

Wakkos

I work with various technology companies as a consultant, trainer and developer. In computer engineering emphasizes my passion for mobile applications across platforms, but with special emphasis on training, where implement my own method: LEX, by which several startups have been able to begin to take their first steps into the applications sector. Over 25 years of commitment to the industry.

El Padrino

Page 40: Charla de Flexbox en Frontenders Valencia

.container {display: flex;justify-content: flex-end;align-items: flex-end;

}

.item {

}

Page 41: Charla de Flexbox en Frontenders Valencia

align-items: flex-end

José Dimas es fundador de Ockham Ti, empresa de desarrollo de software, app móviles, videojuegos y cursos. Profesor de universidad. Ha trabajado en varias universidades de El Caribe, México y de EscuelaIT.

El Mariachi

I create scalable and robust CSS, focusing in maintainability. I Apply DRY rules and some OOCSS (Not every time, CSS is still cascade) and I always comment my CSS with BEM comments.

I usually attach myself to these rules and guidelines when coding CSS.

I use CSS frameworks, (not design frameworks like Bootstrap/Foundation or similar). I believe a framework should do your work easier, it is not meant to do ALL the work: Every project evolves in a different way and depending on its path.

Wakkos

I work with various technology companies as a consultant, trainer and developer. In computer engineering emphasizes my passion for mobile applications across platforms, but with special emphasis on training, where implement my own method: LEX, by which several startups have been able to begin to take their first steps into the applications sector. Over 25 years of commitment to the industry.

El Padrino

Page 42: Charla de Flexbox en Frontenders Valencia

.container {display: flex;justify-content: flex-end;align-items: center;

}

.item {

}

Page 43: Charla de Flexbox en Frontenders Valencia

align-items: center

José Dimas es fundador de Ockham Ti, empresa de desarrollo de software, app móviles, videojuegos y cursos. Profesor de universidad. Ha trabajado en varias universidades de El Caribe, México y de EscuelaIT.

El Mariachi

I create scalable and robust CSS, focusing in maintainability. I Apply DRY rules and some OOCSS (Not every time, CSS is still cascade) and I always comment my CSS with BEM comments.

I usually attach myself to these rules and guidelines when coding CSS.

I use CSS frameworks, (not design frameworks like Bootstrap/Foundation or similar). I believe a framework should do your work easier, it is not meant to do ALL the work: Every project evolves in a different way and depending on its path.

Wakkos

I work with various technology companies as a consultant, trainer and developer. In computer engineering emphasizes my passion for mobile applications across platforms, but with special emphasis on training, where implement my own method: LEX, by which several startups have been able to begin to take their first steps into the applications sector. Over 25 years of commitment to the industry.

El Padrino

Page 44: Charla de Flexbox en Frontenders Valencia

.container {display: flex;justify-content: flex-end;align-items: stretch;

}

.item {

}

Page 45: Charla de Flexbox en Frontenders Valencia

align-items: stretch

José Dimas es fundador de Ockham Ti, empresa de desarrollo de software, app móviles, videojuegos y cursos. Profesor de universidad. Ha trabajado en varias universidades de El Caribe, México y de EscuelaIT.

El Mariachi

I create scalable and robust CSS, focusing in maintainability. I Apply DRY rules and some OOCSS (Not every time, CSS is still cascade) and I always comment my CSS with BEM comments.

I usually attach myself to these rules and guidelines when coding CSS.

I use CSS frameworks, (not design frameworks like Bootstrap/Foundation or similar). I believe a framework should do your work easier, it is not meant to do ALL the work: Every project evolves in a different way and depending on its path.

Wakkos

I work with various technology companies as a consultant, trainer and developer. In computer engineering emphasizes my passion for mobile applications across platforms, but with special emphasis on training, where implement my own method: LEX, by which several startups have been able to begin to take their first steps into the applications sector. Over 25 years of commitment to the industry.

El Padrino

Page 46: Charla de Flexbox en Frontenders Valencia

propiedades de hijos.item {width: 200px;

}

Page 47: Charla de Flexbox en Frontenders Valencia

.container {display: flex;

}

.item {width: 200px;order: 0;flex-grow: 0;flex-shrink: 0;align-self: auto;flex-basis: auto;

}

Page 48: Charla de Flexbox en Frontenders Valencia

.container {display: flex;

}

.mariachi {width: 200px;order: 1;flex-grow: 0;flex-shrink: 0;align-self: auto;flex-basis: auto;

}

Page 49: Charla de Flexbox en Frontenders Valencia

flex children

José Dimas es fundador de Ockham Ti, empresa de desarrollo de software, app móviles, videojuegos y cursos. Profesor de universidad. Ha trabajado en varias universidades de El Caribe, México y de EscuelaIT.

El Mariachi

I create scalable and robust CSS, focusing in maintainability. I Apply DRY rules and some OOCSS (Not every time, CSS is still cascade) and I always comment my CSS with BEM comments.

I usually attach myself to these rules and guidelines when coding CSS.

I use CSS frameworks, (not design frameworks like Bootstrap/Foundation or similar). I believe a framework should do your work easier, it is not meant to do ALL the work: Every project evolves in a different way and depending on its path.

Wakkos

I work with various technology companies as a consultant, trainer and developer. In computer engineering emphasizes my passion for mobile applications across platforms, but with special emphasis on training, where implement my own method: LEX, by which several startups have been able to begin to take their first steps into the applications sector. Over 25 years of commitment to the industry.

El Padrino

order: 1;

markup order: 1markup order: 3markup order: 2

Page 50: Charla de Flexbox en Frontenders Valencia

flex children

order: -1;

José Dimas es fundador de Ockham Ti, empresa de desarrollo de software, app móviles, videojuegos y cursos. Profesor de universidad. Ha trabajado en varias universidades de El Caribe, México y de EscuelaIT.

El Mariachi

markup order: 1

I work with various technology companies as a consultant, trainer and developer. In computer engineering emphasizes my passion for mobile applications across platforms, but with special emphasis on training, where implement my own method: LEX, by which several startups have been able to begin to take their first steps into the applications sector. Over 25 years of commitment to the industry.

El Padrino

markup order: 3

I create scalable and robust CSS, focusing in maintainability. I Apply DRY rules and some OOCSS (Not every time, CSS is still cascade) and I always comment my CSS with BEM comments.

I usually attach myself to these rules and guidelines when coding CSS.

I use CSS frameworks, (not design frameworks like Bootstrap/Foundation or similar). I believe a framework should do your work easier, it is not meant to do ALL the work: Every project evolves in a different way and depending on its path.

Wakkos

markup order: 2

Page 51: Charla de Flexbox en Frontenders Valencia

.container {display: flex;

}

.mariachi {width: 200px;order: 0;flex-grow: 2;flex-shrink: 0;align-self: auto;flex-basis: auto;

}

Page 52: Charla de Flexbox en Frontenders Valencia

flex children

I create scalable and robust CSS, focusing in maintainability. I Apply DRY rules and some OOCSS (Not every time, CSS is still cascade) and I always comment my CSS with BEM comments.

I usually attach myself to these rules and guidelines when coding CSS.

I use CSS frameworks, (not design frameworks like Bootstrap/Foundation or similar). I believe a framework should do your work easier, it is not meant to do ALL the work: Every project evolves in a different way and depending on its path.

Wakkos

I work with various technology companies as a consultant, trainer and developer. In computer engineering emphasizes my passion for mobile applications across platforms, but with special emphasis on training, where implement my own method: LEX, by which several startups have been able to begin to take their first steps into the applications sector. Over 25 years of commitment to the industry.

El PadrinoJosé Dimas es fundador de Ockham Ti, empresa de desarrollo de software, app móviles, videojuegos y cursos. Profesor de universidad. Ha trabajado en varias universidades de El Caribe, México y de EscuelaIT.

El Mariachi

flex-grow: 2;

Page 53: Charla de Flexbox en Frontenders Valencia

.container {display: flex;

}

.mariachi {width: 200px;order: 0;flex-grow: 0;flex-shrink: 0;align-self: flex-end;flex-basis: auto;

}

Page 54: Charla de Flexbox en Frontenders Valencia

José Dimas es fundador de Ockham Ti, empresa de desarrollo de software, app móviles, videojuegos y cursos. Profesor de universidad. Ha trabajado en varias universidades de El Caribe, México y de EscuelaIT.

El Mariachi

I create scalable and robust CSS, focusing in maintainability. I Apply DRY rules and some OOCSS (Not every time, CSS is still cascade) and I always comment my CSS with BEM comments.

I usually attach myself to these rules and guidelines when coding CSS.

I use CSS frameworks, (not design frameworks like Bootstrap/Foundation or similar). I believe a framework should do your work easier, it is not meant to do ALL the work: Every project evolves in a different way and depending on its path.

Wakkos

I work with various technology companies as a consultant, trainer and developer. In computer engineering emphasizes my passion for mobile applications across platforms, but with special emphasis on training, where implement my own method: LEX, by which several startups have been able to begin to take their first steps into the applications sector. Over 25 years of commitment to the industry.

El Padrino

flex children

align-self: flex-end;

Page 55: Charla de Flexbox en Frontenders Valencia

José Dimas es fundador de Ockham Ti, empresa de desarrollo de software, app móviles, videojuegos y cursos. Profesor de universidad. Ha trabajado en varias universidades de El Caribe, México y de EscuelaIT.

El Mariachi

I create scalable and robust CSS, focusing in maintainability. I Apply DRY rules and some OOCSS (Not every time, CSS is still cascade) and I always comment my CSS with BEM comments.

I usually attach myself to these rules and guidelines when coding CSS.

I use CSS frameworks, (not design frameworks like Bootstrap/Foundation or similar). I believe a framework should do your work easier, it is not meant to do ALL the work: Every project evolves in a different way and depending on its path.

Wakkos

I work with various technology companies as a consultant, trainer and developer. In computer engineering emphasizes my passion for mobile applications across platforms, but with special emphasis on training, where implement my own method: LEX, by which several startups have been able to begin to take their first steps into the applications sector. Over 25 years of commitment to the industry.

El Padrino

flex children

align-self: stretch;

Page 56: Charla de Flexbox en Frontenders Valencia

.form {display: flex;

}

input[type=text] {width: 100%;

}

input[type=submit] {flex-basis: 100px;

}

Page 57: Charla de Flexbox en Frontenders Valencia

<form action="" class="form"> <input type="text" /> <input type="submit" /></form>

Page 58: Charla de Flexbox en Frontenders Valencia

submit

Page 59: Charla de Flexbox en Frontenders Valencia

submit

Page 61: Charla de Flexbox en Frontenders Valencia