Lie to me: CSS3 Demystified

Håkon Wium Lie
CTO, Opera Software
howcome@opera.com, #sxsw #LieToMe

Lie to me: CSS3 Demystified

Håkon Wium Lie
CTO, Opera Software
howcome@opera.com, #sxsw #LieToMe
http://people.opera.com/howcome

CSS Timeline

HTML

<h1>Headline</h1>
  • simple structure
  • universal semantics
  • media-independent

CSS

<h1>Headline</h1>

h2 {
  font-size: 18px;
  color: red;
  text-align: left;
}
 
Some text
font-size: 40px
font-size
font-style: italic
font-style
font-family: serif
font-family
background: #fe7
background
border: 0.1em solid black
border
border: 0.1em solid #486
border-color
border: 0.1em dotted #486
border-style
border: 0.3em inset #46F
border-width
border: 0.5em outset #F46
border-width
text-shadow: 10px 10px black
text-shadow
text-shadow: 5px 5px 5px #F79
text-shadow
text-shadow: 0px 0px 20px orange; color: white
text-shadow

CSS3

border-radius: 40px
border-radius
border-radius: 40px
border-radius
border-radius: 150px / 50px
border-radius
border-radius: 60px 0 / 60px 0;
border-radius
box-shadow: 20px 20px gray;
box-shadow
box-shadow: 20px 20px 10px #993;
box-shadow
box-shadow: 0px 0px 20px 10px #993;
box-shadow
box-shadow: 0px 0px 20px 10px #993 inset;
box-shadow

Webfonts

Microsoft's Core fonts

Andale Mono Arial Comic Sans MS Courier New Georgia Impact Times New Roman Trebuchet MS Verdana
@import url(http://www.princexml.com/fonts/steffmann/index.css); 
font-family: Angel
Angel
font-family: Becker Inline
Becker Inline
font-family: Broadcast Titling
Broadcast Titling
font-family: Cardiff
Cardiff
font-family: Direction
Direction


From: "Siebrand Mazeland (WMF)" <smazeland@wikimedia.org>
Date: Wed, 14 Dec 2011 18:49:19 +0100
Sender: wikitech-l-bounces@lists.wikimedia.org
To: wikitech-l@lists.wikimedia.org, mediawiki-i18n@lists.wikimedia.org
Subject: [Wikitech-l] Report on WebFonts deployment

On Monday December 12 at 18:00 UTC we deployed the extension
WebFonts[1] to 40 wikis in 11 Indic languages and Wikimedia Incubator
-- all wikis in Assamese, Bengali, Gujarati, Hindi, Kannada, Marathi,
Nepali, Oriya, (Eastern) Punjabi, Sankrit and Telugu have WebFonts
now. WebFonts was not deployed on Malayalam and Tamil projects. The
reason for this was that community members had requested us not to. We
are confident that in time, the communities will request that WebFonts
is enabled on their projects.

CSS3 transitions

Norwegian coat of arms
img { transition: 1s }
img:hover { transform: rotate(-360deg) } 

Testing

Multicolum Layout

Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, and what is the use of a book, thought Alice without pictures or conversation?

So she was considering in her own mind (as well as she could, for the hot day made her feel very sleepy and stupid), whether the pleasure of making a daisy-chain would be worth the trouble of getting up and picking the daisies, when suddenly a White Rabbit with pink eyes ran close by her.

There was nothing so very remarkable in that; nor did Alice think it so very much out of the way to hear the Rabbit say to itself, Oh dear! Oh dear! I shall be late! (when she thought it over afterwards, it occurred to her that she ought to have wondered at this, but at the time it all seemed quite natural); but when the Rabbit actually took a watch out of its waistcoat-pocket, and looked at it, and then hurried on, Alice started to her feet, for it flashed across her mind that she had never before see a rabbit with either a waistcoat-pocket, or a watch to take out of it, and burning with curiosity, she ran across the field after it, and fortunately was just in time to see it pop down a large rabbit-hole under the hedge.

Multicol code

div.multicol { columns: 2 }
article { columns: 20em } 
wikipedia book cover
wikipedia book cover

Table of contents

Chapter 1.............12
Chapter 2............245

Table of contents

<ul id=toc>
  <li><a href="#chapter1">Chapter 1</a>
  <li><a href="#chapter2">Chapter 2</a>
</ul>
#toc a::after {
  content: leader('.') 
    target-counter(attr(href), page);
}

Paging
the web

Technique #1

html {
  overflow: paged-x;
  height: 100%;
  columns: 3;
}

Technique #2

img { 
  float: top-corner;
  column-span: 2;
}

Technique #3

<link rel=next href="article3.html">
<link rel=previous href="article1.html">
...
@navigation {
  nav-right: link-rel(next);
  nav-left: link-rel(previous);
  nav-down: url(http://www.example.com)
}