Andrzej Mazur | @end33r | blog.end3r.com | css4.pl || meet.js Summit | PoznaĆ, Poland | 14.01.2012
Gather multiple definitions into one
li a:link, li a:hover, li a:visited, li a:focus
li a:matches(:link, :hover, :visited, :focus)
Mozilla's :-moz-any()
Known before, but now have super powers
p:not(.active, .visible)
Little helper for the links
a:link, a:visited
=> a:any-link
Useful for breadcrumbs, menus, external links
http://end3r.com/portfolio/client/gtech/
:local-link(0)
http://end3r.com/
:local-link(2)
http://end3r.com/portfolio/client/
Selecting spoken words, karaoke style
text-to-speech, subtitles for the WebVTT
p:current { color: #333; border: 1px solid #999; }
Target default state and style it
checkbox, radio button
input.checkbox:indeterminate { background: #ccc; }
Use matching on chosen elements
:nth-child()
and :matches()
Cool: :nth-child(even)
Cool: :matches(.active)
Uber-cool: li a:nth-match(even of .active)
Selecting columns just like rows in the table
:column(.total)
:nth-column(even)
:nth-last-column(2n+1)
The force is strong in this one
Long-awaited multi-purpose swiss army knife
Easier styling of generated menus
ul li a.active
ul $li a.active
$body header a.styleSwitcher:hover { background: red; }
img { -webkit-filter: grayscale(100%); }
img { -webkit-filter: blur(5px); }
img { -webkit-filter: sepia(100%); }
img { -webkit-filter: hue-rotate(90deg); }
img { -webkit-filter: saturate(300%); }
img { -webkit-filter: brightness(50%); }
img { -webkit-filter: contrast(300%); }
img { -webkit-filter: invert(100%); }
Mac OS X users: Cmd + Alt + Ctrl + 8
3D GFX moving to WebGL
Vertex shaders, fragment shaders
.old-book-page { filter: custom(url('book.vs') url('old-page-paper.fs')); }
calculate the CSS values
width: calc((12em * 3) + 10px);
height: min(3em, 30px);
font-size: calc(max(2em, 20px) - 4px);
write once, use everywhere
@var $textColor #FF0000;
h1 { color: $textColor; }
article { color: $textColor; }
Modernizr in the Stylesheet
@supports (display: grid) {}
@supports (background: linear-gradient) and (transform: rotate3d) {}
repeating fragments
@mixin fragment { color: #F00; font-size: 14px; }
h1 { @mix fragment; margin: 10px; }
@mixin differentFragment($myColor #F00) { color: $myColor; font-size: 14px; }
h1 { @mix differentFragment(#00F); margin: 10px; }