css3 - posts - snook.ca · pdf filecss3 in a nutshell selectors marquee namespaces paged media...

48
CSS3 Now and the Future

Upload: hathien

Post on 10-Feb-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

CSS3Now and the Future

Page 2: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

What to expect

Page 3: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Understanding the W3CJust a little bit.

Page 4: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Recommendation Timeline

WD LC

PR REC

CR

Page 5: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Understanding CSS3Just a little bit.

Page 6: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

CSS3 in a nutshellSelectors

Marquee

Namespaces

Paged Media

Values and Units

Text

BGs and Borders

Fonts

Multi-Column

Template

Media Queries

Speech

Color

Grid Positioning

Flex Box

Ruby

Image Values

2D Transforms

3D Transforms

Transitions

Animations

And more...

http://www.w3.org/Style/CSS/current-work

Line

Lists

Page 7: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

What is close enough?Candidate Recommendations

Page 8: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

CSS3 in a nutshellSelectors

Marquee

Namespaces

Paged Media

Values and Units

Text

BGs and Borders

Fonts

Multi-Column

Template

Media Queries

Speech

Color

Grid Positioning

Flex Box

Ruby

Image Values

2D Transforms

3D Transforms

Transitions

Animations

And more...

http://www.w3.org/Style/CSS/current-work

Line

Lists

Page 9: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

NowWhat browsers support.

Page 10: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Safari 5Selectors

Marquee

Namespaces

Paged Media

Values and Units

Text

BGs and Borders

Fonts

Multi-Column

Template

Media Queries

Speech

Color

Grid Positioning

Flex Box

Ruby

Image Values

2D Transforms

3D Transforms

Transitions

Animations

And more...

Line

Lists

Page 11: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Firefox 3.6Selectors

Marquee

Namespaces

Paged Media

Values and Units

Text

BGs and Borders

Fonts

Multi-Column

Template

Media Queries

Speech

Color

Grid Positioning

Flex Box

Ruby

Image Values

2D Transforms

3D Transforms

Transitions

Animations

And more...

Line

Lists

Page 12: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Opera 10.6Selectors

Marquee

Namespaces

Paged Media

Values and Units

Text

BGs and Borders

Fonts

Multi-Column

Template

Media Queries

Speech

Color

Grid Positioning

Flex Box

Ruby

Image Values

2D Transforms

3D Transforms

Transitions

Animations

And more...

Line

Lists

Page 13: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Internet Explorer 8Selectors

Marquee

Namespaces

Paged Media

Values and Units

Text

BGs and Borders

Fonts

Multi-Column

Template

Media Queries

Speech

Color

Grid Positioning

Flex Box

Ruby

Image Values

2D Transforms

3D Transforms

Transitions

Animations

And more...

Line

Lists

Page 14: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

PopularIt’s what all the cool kids are doing

Page 15: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

What’s hawt:nth-child Multiple BGs

@font-face

Multi-Column

Media Queries

rgba/hsla

Flex Box

2D Transforms

3D Transforms

Transitions

Animations

Border-radius

Text-shadow GradientBox-shadow

Page 16: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

FutureWhat browsers will support.

Page 17: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Safari:nth-child Multiple BGs

@font-face

Multi-Column

Media Queries

rgba/hsla

Flex Box

2D Transforms

3D Transforms

Transitions

Animations

Border-radius

Text-shadow GradientBox-shadow

Page 18: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Firefox 4:nth-child Multiple BGs

@font-face

Multi-Column

Media Queries

rgba/hsla

Flex Box

2D Transforms

3D Transforms

Transitions

Animations

Border-radius

Text-shadow GradientBox-shadow

Page 19: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Opera 11:nth-child Multiple BGs

@font-face

Multi-Column

Media Queries

rgba/hsla

Flex Box

2D Transforms

3D Transforms

Transitions

Animations

Border-radius

Text-shadow GradientBox-shadow

Page 20: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Internet Explorer 9:nth-child Multiple BGs

@font-face

Multi-Column

Media Queries

rgba/hsla

Flex Box

2D Transforms

3D Transforms

Transitions

Animations

Border-radius

Text-shadow GradientBox-shadow

Page 21: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Code“Finally!”

Page 22: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

:nth-child tr:nth-­‐child(2n)  {

         background-­‐color:rgba(255,255,255,.3);

}

tr:nth-­‐child(2n+2)  {  ...  }

Page 23: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

:nth-child

Page 24: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Multiple Backgroundsdiv  {

       background:

         url(icon.png)  no-­‐repeat  0  0,

         linear-­‐gradient(0  50%  90deg,  #666,  #999)

         #000;

}

Page 25: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Multiple Backgrounds

Page 26: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Box Shadow.modal  {

   box-­‐shadow:0  0  5px  #888;

   box-­‐shadow:0  0  5px  #888  inset;

}

Page 27: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Border Radius.modal  {

   border-­‐radius:5px;

   border-­‐top-­‐left-­‐radius:5px;

}

Page 28: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Box Shadow

Page 29: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

What about IE?It does like to be different.

Page 30: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Filters.modal  {

   filter:  alpha(opacity=0);

}

Page 31: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Gradients.modal  {

   filter:  progid:DXImageTransform.Microsoft.gradient

   (startColorstr=#FFFFFF,

   endColorstr=#E6E6E6))  

}

Page 32: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

rgba for Backgrounds.modal  {

   filter:  progid:DXImageTransform.Microsoft.gradient

   (startColorstr=#33FFFFFF,

     endColorstr=#33E6E6E6))  

}

Page 33: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Box Shadow.modal  {

   filter:  progid:DXImageTransform.Microsoft.DropShadow(Color='white',  OffX=0,  OffY=0);

}

Page 34: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Multiple Backgrounds.modal  {

   background:  url(...  );

   filter:  

progid:DXImageTransform.Microsoft.DropShadow

   (Color='white',  OffX=0,  OffY=0)

progid:DXImageTransform.Microsoft.gradient

   (startColorstr=#33FFFFFF,

     endColorstr=#33E6E6E6))

}

Page 35: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

These are our tools.

Page 36: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

The Dream.modal  {

   box-­‐shadow:0  1px  0  rgba(0,  0,  0,  0.2);

   border-­‐radius:  5px;

   background:  url(  ...  ),

       linear-­‐gradient(0  50%  90deg,  #000,  #FFF);

}

Page 37: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

The Reality.modal  {

-­‐mox-­‐box-­‐shadow:0  1px  0  0  rgba(0,  0,  0,  0.2);

-­‐webkit-­‐box-­‐shadow:0  1px  0  rgba(0,  0,  0,  0.2);

box-­‐shadow:0  1px  0  rgba(0,  0,  0,  0.2);

filter:  progid:DXImageTransform.Microsoft.DropShadow(Color='white',  OffX=0,  OffY=0);

}

Page 38: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

The Reality Part 2.modal  {

  background-­‐color:  #666;

  background-­‐image:  -­‐moz-­‐linear-­‐gradient(#333,  #666);

  background-­‐image:  -­‐webkit-­‐gradient(linear,  0  top,  0  bottom,  from(#333),  to(#666));

  filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr=#333333,  endColorstr=#666666));

}

Page 39: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

The Reality Part 3.modal  {

  /*  need  to  use  longhand  border-­‐radius  here  */

  -­‐moz-­‐border-­‐radius-­‐topleft:  4px;

  -­‐moz-­‐border-­‐radius-­‐bottomleft:  4px;

  -­‐webkit-­‐border-­‐bottom-­‐left-­‐radius:  4px;

  -­‐webkit-­‐border-­‐top-­‐left-­‐radius:  4px;

  border-­‐bottom-­‐left-­‐radius:  4px;

  border-­‐top-­‐left-­‐radius:  4px;

}

Page 40: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

We can choose to use them or not.

Page 41: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Ready for Prime Time?What do you think?

Page 42: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media
Page 43: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media
Page 44: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

ResourcesTime to get your feet wet

Page 45: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

http://leaverou.me/ft2010/

Page 46: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

http://caniuse.com/

Page 47: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

http://www.modernizr.com/

Page 48: CSS3 - Posts - Snook.ca · PDF fileCSS3 in a nutshell Selectors Marquee Namespaces Paged Media Values and Units Text BGs and Borders Fonts Multi-Column Template Media

Questions?Hit me with your best shot.