I like to make mixins with SASS that help me make good cross-browser compatibility. I want to make a mixin that looks like this:
@mixin box-shadow($value) {
There's many ways to do this, the best way is using a mixin like so:
@mixin box-shadow($value...) {
-webkit-box-shadow: $value;
-moz-box-shadow: $value;
box-shadow: $value;
}
And include it like this:
@include box-shadow(inset 0 1px 0 #FFD265, 0 0 0 1px #912E01, 0 0 0 7px rgba(0, 0, 0, .1), 0 1px 4px rgba(0, 0, 0, .6));
or
@mixin box-shadow($value) {
-webkit-box-shadow: #{$value};
-moz-box-shadow: #{$value};
box-shadow: #{$value};
}
And include it like this:
@include box-shadow("inset 0 1px 0 #FFD265, 0 0 0 1px #912E01, 0 0 0 7px rgba(0, 0, 0, .1), 0 1px 4px rgba(0, 0, 0, .6)");
or:
@mixin box-shadow($value) {
$value: unquote($value);
-webkit-box-shadow: $value;
-moz-box-shadow: $value;
box-shadow: $value;
}
or:
@mixin box-shadow($value) {
-webkit-box-shadow: $value;
-moz-box-shadow: $value;
box-shadow: $value;
}
And include it like this:
@include box-shadow((inset 0 1px 0 #FFD265, 0 0 0 1px #912E01, 0 0 0 7px rgba(0, 0, 0, .1), 0 1px 4px rgba(0, 0, 0, .6)));
Sass is very powerful :)