Slide 1

Slide 1 text

CSS3 técnicas avanzadas Javier Usobiaga Marta Armada SeedRocket 16 marzo 2011

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

@htmlboy @martuishere

Slide 4

Slide 4 text

vENTAJAS

Slide 5

Slide 5 text

velocidad

Slide 6

Slide 6 text

velocidad flexibilidad

Slide 7

Slide 7 text

velocidad escalabilidad flexibilidad

Slide 8

Slide 8 text

velocidad escalabilidad flexibilidad ligereza

Slide 9

Slide 9 text

prOBLEMAS

Slide 10

Slide 10 text

experimental

Slide 11

Slide 11 text

experimental redundancia

Slide 12

Slide 12 text

experimental abuso redundancia

Slide 13

Slide 13 text

experimental abuso soporte redundancia

Slide 14

Slide 14 text

SOLUCIONES dibujo de Phil Henderson @LLcoolPhil

Slide 15

Slide 15 text

progressive enhancement Cumplo mi función :-) de menos a más

Slide 16

Slide 16 text

Y f progressive enhancement Cumplo mi función :-) de menos a más

Slide 17

Slide 17 text

graceful degradation Me diseñaron así de guay de más a menos

Slide 18

Slide 18 text

Tengo una imagen de fondo graceful degradation Me diseñaron así de guay de más a menos

Slide 19

Slide 19 text

hardboiled ¿Le gustaré a @4lexcat? :-) “To hell with being graceful” Andy Clarke Harboiled Web Design

Slide 20

Slide 20 text

hardboiled Paso de la imagen de fondo ¿Le gustaré a @4lexcat? :-) “To hell with being graceful” Andy Clarke Harboiled Web Design

Slide 21

Slide 21 text

regressive enhancement tapando agujeros con Javascript

Slide 22

Slide 22 text

http://modernizr.com

Slide 23

Slide 23 text

http://yepnopejs.com

Slide 24

Slide 24 text

¿soporte?

Slide 25

Slide 25 text

http://caniuse.com

Slide 26

Slide 26 text

COLOR & TRANSPARENCIAS

Slide 27

Slide 27 text

rgba .box{ background-color: rgba (211, 85, 41, .7); }

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

h1 a{ color: rgba(179,45,71,.75); } #navigation li a{ background: rgba(170,178,192,.75); } #content{ background-color: rgba(14,32,59,.5); } http://24ways.org

Slide 30

Slide 30 text

hsl HUE: grado de la rueda de color. 0º es rojo. SATURATION: porcentaje de saturado (100%) a gris (0%) LUMINOSITY: porcentaje de negro (0%) a blanco (100%).

Slide 31

Slide 31 text

hsla .box{ background-color: hsla (16, 67, 49, .7); }

Slide 32

Slide 32 text

http://hslpicker.com

Slide 33

Slide 33 text

gradients .box{ background-image: linear-gradient(45deg, #291633, #D35529); }

Slide 34

Slide 34 text

gradients .box{ background-image: linear-gradient (#291633 0%, #FFEBA3 50%, #D35529 100%); }

Slide 35

Slide 35 text

gradients .box{ background-image: linear-gradient (top, hsl(16,67,50) 0%, hsl(16,67,55) 50%, hsl(16,90,50) 50%, hsl(16,90,40) 100%); }

Slide 36

Slide 36 text

gradients .box{ background-image: radial-gradient(#291633, #D35529); }

Slide 37

Slide 37 text

http://colorzilla.com/gradient-editor

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

a#appstore{ background-image: linear-gradient (top, #B6B6B6, #9B9B9B); } a#twitter{ background-image: linear-gradient (top, #2B79DE, #4798E7); } http://dribbbitsapp.com

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

body{ background: #030205 radial-gradient (center top, circle closest-corner, #615C59,#030205) no-repeat; } http://earthhour.fr

Slide 42

Slide 42 text

DROP SHADOWS

Slide 43

Slide 43 text

box shadow .box{ box-shadow: 5px 5px 10px 10px rgba(0,0,0,.75); }

Slide 44

Slide 44 text

box shadow .box{ box-shadow: 0 5px 0 hsl(16, 67%, 33%), 0 10px 0 rgba(0, 0, 0, .5); }

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

nav li{ box-shadow: 0 2px 8px -3px rgba(0, 0, 0, .5), inset 0 1.4em 2em -0.7em rgba(255, 255, 255, .3); } http://bit.ly/viajartiempo

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

.boton{ box-shadow: 0 1px 0 #E87754, 0 2px 0 #BD4019, 0 3px 0 #AE3B17, 0 5px 0 #9F3615, 0 7px 0 #903113, 0 8px 1px rgba(0,0,0,.1), 0 0 5px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.3), 0 3px 5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.25), 0 10px 10px rgba(0,0,0,.2), 0 20px 20px rgba(0,0,0,.15); } http://bit.ly/viajartiempo

Slide 49

Slide 49 text

text shadow text shadow h1{ text-shadow: 5px 5px 5px rgba(0,0,0,.75); }

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

h1{ text-shadow: 1px 1px 0 rgba(255,255,255,.6); } http://lanyrd.com

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

h1{ text-shadow: 0 0 10px white, 0 0 20px white, 0 0 30px white, 0 0 40px #FF00DE, 0 0 70px #FF00DE, 0 0 80px #FF00DE, 0 0 100px #FF00DE, 0 0 150px #FF00DE; } http://bit.ly/text-shadows

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

h1 .c{ text-shadow: 0px 0px #FE8, 0px 2px #EB0, 0px 1px #FE8, 0px 3px #EB0, -1px 2px #FE8, -1px 4px #EB0, -1px 3px #FE8, (...) -4px 26px #EB0; } http://beercamp.com/2010

Slide 56

Slide 56 text

bACK GROUNDS

Slide 57

Slide 57 text

multiple backgrounds .box{ background: url(panda.png) no-repeat right bottom, url(madera.jpg); }

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

#services li{ background: url(ux.png) no-repeat left top, url(separador.png) no-repeat center bottom; } http://swwweet.com/services.html

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

#header{ background: url(pattern.png) repeat-x, linear-gradient (top, #17132A, #2A234B); } http://dribbbitsapp.com

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

input#submit{ background: url(download-arrow.png) no-repeat 0px 50%, #95DC2F linear-gradient (top, #8BD225 0%, #BCF26F 50%, #8BD225 50%, transparent 100%); } http://modernizr.com

Slide 64

Slide 64 text

background size .box{ background: url(balloons.png) repeat; background-size: 100px auto; }

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

html{ background-color:#FFECD0; background-image: linear-gradient (-45deg, rgba(255,255,255,.3) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.3) 50%, rgba(255,255,255,.3) 75%, transparent 75%, transparent); background-size: 100px 100px; } http://leaverou.me

Slide 67

Slide 67 text

MÁXIMA FLEXIBILIDAD

Slide 68

Slide 68 text

media queries @media screen and (max-width:800px){ body{ font-size:12px; } #columna{ width:400px; } }

Slide 69

Slide 69 text

media queries @media screen and (min-width:1200px)

Slide 70

Slide 70 text

media queries @media screen and (max-width:320px)

Slide 71

Slide 71 text

media queries aspect-ratio color orientation device- aspect-ratio device-height device-width resolution height monochrome max-width width max-height

Slide 72

Slide 72 text

http://alistapart.com/articles/responsive-web-design

Slide 73

Slide 73 text

http://bit.ly/hardboiled-media-queries

Slide 74

Slide 74 text

http://stpaulsschool.org.uk

Slide 75

Slide 75 text

http://stpaulsschool.org.uk

Slide 76

Slide 76 text

http://stpaulsschool.org.uk

Slide 77

Slide 77 text

http://sasquatchfestival.com

Slide 78

Slide 78 text

http://sasquatchfestival.com

Slide 79

Slide 79 text

http://sasquatchfestival.com

Slide 80

Slide 80 text

http://mediaqueri.es

Slide 81

Slide 81 text

MÚLTIPLES COLUMNAS

Slide 82

Slide 82 text

columns .box{ column-count: 2; } Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam semper augue et libero vulputate fringilla. Phasellus a e n i m n o n f e l i s c o m m o d o elementum vel non purus. Curabitur ut orci est. Curabitur lobortis lacus ac dolor placerat sed vehicula neque accumsan. Nullam auctor arcu quis lectus auctor interdum. Suspendisse at pulvinar ipsum. In hac habitasse platea dictumst. In volutpat, tortor eu posuere sollicitudin, tortor eros interdum libero, et condimentum leo purus at nisi. Mauris vel sem lacus, quis laoreet lorem. Integer est orci, sollicitudin quis fermentum eget, consequat nec libero. Sed vitae dolor dolor, eget placerat leo. Proin egestas malesuada pharetra. Sed arcu ante, adipiscing sit amet semper vel, aliquet sit amet nunc.

Slide 83

Slide 83 text

columns .box{ column-gap: 100px; } Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam semper augue et libero vulputate fringilla. Phasellus a enim non felis commodo elementum vel non purus. Curabitur ut orci est. Curabitur lobortis lacus ac dolor placerat sed vehicula neque accumsan. Nullam auctor arcu quis lectus auctor interdum. Suspendisse at pulvinar ipsum. In hac habitasse platea dictumst. In volutpat, tortor eu posuere sollicitudin, tortor eros i n t e r d u m l i b e r o , e t condimentum leo purus at nisi. Mauris vel sem lacus, quis laoreet lorem. Integer est o r c i , s o l l i c i t u d i n q u i s fermentum eget, consequat nec libero. Sed vitae dolor dolor, eget placerat leo. Proin egestas malesuada pharetra. Sed arcu ante, adipiscing sit amet semper vel, aliquet sit amet nunc.

Slide 84

Slide 84 text

columns .box{ column-rule: 1px solid black; } Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam semper augue et libero vulputate fringilla. Phasellus a e n i m no n fe l is co m mo d o elementum vel non purus. Curabitur ut orci est. Curabitur lobortis lacus ac dolor placerat sed vehicula neque accumsan. Nullam auctor arcu quis lectus auctor interdum. Suspendisse at pulvinar ipsum. In hac habitasse platea dictumst. In volutpat, tortor eu posuere sollicitudin, tortor eros interdum libero, et condimentum leo purus at nisi. Mauris vel sem lacus, quis laoreet l o r e m . I n t e g e r e s t o r c i , sollicitudin quis fermentum eget, consequat nec libero. Sed vitae dolor dolor, eget placerat leo. P ro i n e g e s t as mal e su ada p h a r e t r a . S e d a r c u a n t e , adipiscing sit amet semper vel, aliquet sit amet nunc.

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

#content{ column-count: 3; column-gap: 1.125em; } http://informationarchitects.jp

Slide 87

Slide 87 text

NUEVOS SELECTORES

Slide 88

Slide 88 text

:first-child ul :first-child{ background: #D35529; }

Slide 89

Slide 89 text

:last-child ul :last-child{ background: #D35529; }

Slide 90

Slide 90 text

:nth-child() ol :nth-child(odd){ background: #D35529; } 1 2 3 4 5 6 7 8 9

Slide 91

Slide 91 text

:nth-child() ol :nth-child(3n){ background: #D35529; } 1 2 3 4 5 6 7 8 9

Slide 92

Slide 92 text

:nth-child() ol :nth-child(3){ background: #D35529; } 1 2 3 4 5 6 7 8 9

Slide 93

Slide 93 text

:nth-child() ol :nth-child(3n+2){ background: #D35529; } 1 2 3 4 5 6 7 8 9

Slide 94

Slide 94 text

:nth-child() ol :nth-child(6n+4){ background: #D35529; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Slide 95

Slide 95 text

http://css-tricks.com/examples/nth-child-tester

Slide 96

Slide 96 text

:not() ul :not(:first-child){ background: #D35529; }

Slide 97

Slide 97 text

attribute a[title] {color: red;} a[href=‟index.html”] {color: red;} img[alt*=‟web”] {border: 5px solid red;} a[href$=‟.pdf”] {background: url(pdf.png)}

Slide 98

Slide 98 text

http://selectivizr.com

Slide 99

Slide 99 text

http://selectivizr.com

Slide 100

Slide 100 text

No content

Slide 101

Slide 101 text

#recent-projects li:nth-child(2){ margin: 0 13px; } http://swwweet.com

Slide 102

Slide 102 text

No content

Slide 103

Slide 103 text

#intro nav li{ background: rgba(5, 129, 121, .8); } #intro nav li:nth-child(2){ background: rgba(224, 80, 35, .8); } #intro nav li:nth-child(3){ background: rgba(238, 165, 27, .8); } #intro nav li:nth-child(4){ background: rgba(94, 79, 58, .8); } #intro nav li:nth-child(5){ background: rgba(173, 165, 53, .8); } http://bit.ly/viajartiempo

Slide 104

Slide 104 text

pseudo-elements p:before{ content:‟Mis gatos:”; color: #D35529; } Mis gatos: Oslo Mis gatos: Quinto

Oslo

Quinto

Slide 105

Slide 105 text

pseudo-elements p:after{ content:‟es un gato”; color: #D35529; } Oslo es un gato Quinto es un gato

Oslo

Quinto

Slide 106

Slide 106 text

pseudo-elements li:before{ content: url(pizza.png); }
  • Cuatro estaciones
  • Margarita
  • Cuatro estaciones Margarita

    Slide 107

    Slide 107 text

    pseudo-elements p:before{ content:‟ ”; display: inline-block; width: 10px; height: 10px; background: #D35529; }

    Un cuadrado

    Un cuadrado

    Slide 108

    Slide 108 text

    No content

    Slide 109

    Slide 109 text

    #signin form:before{ content: "{"; font-size: 15em; color: #BE3F9E; position: absolute; top: -15px; left: -100px; } #signin form:after{ content: "}"; font-size: 15em; color: #BE3F9E; position: absolute; top: -15px; right: -100px; } http://freelancebcn.com

    Slide 110

    Slide 110 text

    No content

    Slide 111

    Slide 111 text

    #intro nav li{ position:relative; } #intro nav li:before{ content: ""; position: absolute; left: 0; bottom: -8px; border: 10px solid black; border-color: transparent rgb(5, 129, 121); border-width: 0 8px 8px 0; } http://bit.ly/viajartiempo

    Slide 112

    Slide 112 text

    http://nicolasgallagher.com

    Slide 113

    Slide 113 text

    TRANS FORMACIONES

    Slide 114

    Slide 114 text

    scale .box{ transform: scale(.5); }

    Slide 115

    Slide 115 text

    No content

    Slide 116

    Slide 116 text

    .articulo:hover{ transform: scale(1.1); } http://abelsutilo.com

    Slide 117

    Slide 117 text

    rotate .box{ transform: rotate(45deg); }

    Slide 118

    Slide 118 text

    No content

    Slide 119

    Slide 119 text

    #imagery .photos li:hover { transform: rotate(2deg) scale(1.1); } http://nordicruby.org

    Slide 120

    Slide 120 text

    translate .box{ transform: translate(20px, 40px); }

    Slide 121

    Slide 121 text

    skew .box{ transform: skew(5deg, 30deg); }

    Slide 122

    Slide 122 text

    TRANSICIONES

    Slide 123

    Slide 123 text

    transitions .box{ background: #51E500; transition: 1s background ease-in; } .box:hover{ background: #D35529; }

    Slide 124

    Slide 124 text

    transitions .box{ transition: 1s background ease-in, 1s height ease-in; }

    Slide 125

    Slide 125 text

    delay .box{ transition: 1s background ease-in .5s; }

    Slide 126

    Slide 126 text

    No content

    Slide 127

    Slide 127 text

    li#shape-b a{ transform:rotate(-10deg); transition:all 0.8s ease-in; opacity:0.5; background:#17659b; } li#shape-b a:hover{ transform:rotate(360deg); } http://newadventuresconf.com

    Slide 128

    Slide 128 text

    No content

    Slide 129

    Slide 129 text

    .banner h3 a{ background: url(banner.png) 0 0 no-repeat; transition: all 0.3s ease-in-out; } .banner h3 a:hover { margin-right: -10px; text-indent: 10px; background: url(banner.png) 10px 0 no-repeat; } #imagery .photos li { transition : all .2s ease-in-out; } #imagery .photos li:hover { transform: rotate(2deg) scale(1.1); } http://nordicruby.org

    Slide 130

    Slide 130 text

    http://books.alistapart.com rECURSOS

    Slide 131

    Slide 131 text

    http://hardboiledwebdesign.com rECURSOS

    Slide 132

    Slide 132 text

    http://stunningcss3.com rECURSOS

    Slide 133

    Slide 133 text

    ¡GRACIAS!

    Slide 134

    Slide 134 text

    ¿PREGUNTAS?

    Slide 135

    Slide 135 text

    http://www.flickr.com/photos/soonerpa/4220518842 http://www.flickr.com/photos/gregheo/5321202672 http://www.flickr.com/photos/wainwright/351684037 http://www.flickr.com/photos/joeshlabotnik/4749975148 http://www.flickr.com/photos/tetzl/178374065 http://www.flickr.com/photos/cibomahto/2291127824 http://www.flickr.com/photos/st3f4n/4448140377 http://www.flickr.com/photos/blubrblog/4326100513 http://www.flickr.com/photos/lucynieto/2536364522 http://www.flickr.com/photos/tainara/314471333 http://www.flickr.com/photos/adman_as/3507892529 http://www.flickr.com/photos/archer10/2216791949 http://www.flickr.com/photos/rohdesign/4444113922 http://www.flickr.com/photos/lycid/1515574003 http://www.flickr.com/photos/stevedave/3566325269 http://www.flickr.com/photos/aftab/3364835006 http://www.flickr.com/photos/rhinoneal/4353519405 créditos