Use some of the new compass helpers to clean up this code.

This commit is contained in:
Chris Eppstein 2010-11-15 03:48:59 -08:00
parent 795800a85f
commit 0f5746bec0
3 changed files with 24 additions and 15 deletions

View File

@ -69,23 +69,10 @@ $default-box-shadow-inset : false !default;
}
@if $shadow-1 == default {
$shadow-1 : $default-box-shadow-h-offset $default-box-shadow-v-offset;
@if $default-box-shadow-blur { $shadow-1: $shadow-1 $default-box-shadow-blur; }
@if $default-box-shadow-spread { $shadow-1: $shadow-1 $default-box-shadow-spread; }
@if $default-box-shadow-color { $shadow-1: $shadow-1 $default-box-shadow-color; }
@if $default-box-shadow-inset { $shadow-1: inset $shadow-1; }
$shadow-1 : -compass-space-list(compact(if($default-box-shadow-inset, inset), $default-box-shadow-h-offset, $default-box-shadow-v-offset, $default-box-shadow-blur, $default-box-shadow-spread, $default-box-shadow-color));
}
$shadow : $shadow-1;
@if $shadow-2 { $shadow: $shadow, $shadow-2; }
@if $shadow-3 { $shadow: $shadow, $shadow-3; }
@if $shadow-4 { $shadow: $shadow, $shadow-4; }
@if $shadow-5 { $shadow: $shadow, $shadow-5; }
@if $shadow-6 { $shadow: $shadow, $shadow-6; }
@if $shadow-7 { $shadow: $shadow, $shadow-7; }
@if $shadow-8 { $shadow: $shadow, $shadow-8; }
@if $shadow-9 { $shadow: $shadow, $shadow-9; }
@if $shadow-10 { $shadow: $shadow, $shadow-10; }
$shadow : compact($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, $shadow-7, $shadow-8, $shadow-9, $shadow-10);
@include experimental(box-shadow, $shadow,
-moz, -webkit, -o, not -ms, not -khtml, official
);

View File

@ -0,0 +1,17 @@
.box-shadow {
-moz-box-shadow: 0px 0px 5px #333333, 2px 2px 5px #222222;
-webkit-box-shadow: 0px 0px 5px #333333, 2px 2px 5px #222222;
-o-box-shadow: 0px 0px 5px #333333, 2px 2px 5px #222222;
box-shadow: 0px 0px 5px #333333, 2px 2px 5px #222222; }
.single-box-shadow {
-moz-box-shadow: 0px 0px 5px #333333;
-webkit-box-shadow: 0px 0px 5px #333333;
-o-box-shadow: 0px 0px 5px #333333;
box-shadow: 0px 0px 5px #333333; }
.multiple-box-shadows {
-moz-box-shadow: 0px 0px 5px #333333, 2px 2px 5px #222222;
-webkit-box-shadow: 0px 0px 5px #333333, 2px 2px 5px #222222;
-o-box-shadow: 0px 0px 5px #333333, 2px 2px 5px #222222;
box-shadow: 0px 0px 5px #333333, 2px 2px 5px #222222; }

View File

@ -0,0 +1,5 @@
@import "compass/css3/box-shadow-v2";
.box-shadow { @include box-shadow(default, 2px 2px 5px #222);}
.single-box-shadow { @include single-box-shadow;}
.multiple-box-shadows { @include multiple-box-shadows(default, 2px 2px 5px #222);}