| 1 |
|
| 2 |
@mixin apply-to-ie6-only { |
| 3 |
* html { |
| 4 |
@content; |
| 5 |
} |
| 6 |
} |
| 7 |
@include apply-to-ie6-only { |
| 8 |
#logo { |
| 9 |
background-image: url(/logo.gif); |
| 10 |
} |
| 11 |
} |
| 12 |
|
| 13 |
|
| 14 |
$color: white; |
| 15 |
@mixin colors($color: blue) { |
| 16 |
background-color: $color; |
| 17 |
@content; |
| 18 |
border-color: $color; |
| 19 |
} |
| 20 |
.colors { |
| 21 |
@include colors { color: $color; } |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
@mixin iphone { |
| 26 |
@media only screen and (max-width: 480px) { |
| 27 |
@content; |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
@include iphone { |
| 32 |
body { color: red } |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
#sidebar { |
| 37 |
$sidebar-width: 300px; |
| 38 |
width: $sidebar-width; |
| 39 |
@include iphone { |
| 40 |
width: $sidebar-width / 3; |
| 41 |
} |
| 42 |
} |
| 43 |
|
| 44 |
|
| 45 |
@mixin respond-to($width) { |
| 46 |
@media only screen and (min-width: $width) { @content; } |
| 47 |
} |
| 48 |
|
| 49 |
@include respond-to(40em) { |
| 50 |
@for $i from 1 through 2 { |
| 51 |
.grid-#{$i} { width: 100%; } |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
@include respond-to(40em) { |
| 56 |
$i: 1; |
| 57 |
@while $i <= 2 { |
| 58 |
.grid-#{$i} { width: 100%; } |
| 59 |
$i: $i + 1; |
| 60 |
} |
| 61 |
} |
| 62 |
|