Flushing

Flushing

Flush

CoffeeScript

CoffeeScript

number   = 42

number = -42 if opposite

square = (x) -> x * x

list = [1, 2, 3, 4, 5]

math =
  root:   Math.sqrt
  square: square
  cube:   (x) -> x * square x

SCSS

Variables

$my-color: #ab42ef;

body {
  background: $my-color;
}

Mixins

@mixin my-style {
  background: red;
}

.my-box {
  @include my-style;
}

Default in Rails 3.1

More details in my next talk

Is Google fast?

Yes it is.

Why?

Google sprites
http://www.google.de/images/srpr/nav_logo14.png

Sprites (1)

  • 1 image
  • 1 HTTP request
  • small file size

=> very fast

How to create your own Sprite?

Buy Photoshop

Photoshop
1,010.31 € anyone?

Or use Compass
(soon)

Sprites (1)

Sprite folder
Two images with 10 x 10 px and 20 x 20 px size.

Sprites (2)

@import "squares/*.png";
@include all-squares-sprites;

Sprites (3)

.squares-sprite, .squares-10x10, .squares-20x20 {
  background: url('/squares.png') no-repeat;
}

.squares-10x10 {
  background-position: 0 0;
}

.squares-20x20 {
  background-position: 0 -10px;
}

Dimensions (1)

$squares-sprite-dimensions: true;
@import "squares/*.png";
@include all-squares-sprites;

Dimensions (2)

.squares-sprite, .squares-10x10, .squares-20x20 {
  background: url('/squares.png') no-repeat;
}

.squares-10x10 {
  background-position: 0 0;
  height: 10px;
  width: 10px;
}

.squares-20x20 {
  background-position: 0 -10px;
  height: 20px;
  width: 20px;
}

Spacing (1)

$squares-10x10-spacing: 33px;
@import "squares/*.png";
@include all-squares-sprites;

Spacing (2)

.squares-sprite, .squares-10x10, .squares-20x20 {
  background: url('/squares.png') no-repeat;
}

.squares-10x10 {
  background-position: 0 0;
}

.squares-20x20 {
  background-position: 0 -43px;
}

Can I use it now?

Yes. Use lemonade.