Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS sass mixin with a variable? Re: sass mixin with a variable?

#132222
Alen
Participant

@mixin boxshadow($h: 0px, $v: 1px, $b:2px, $brand-color: rgba(0,0,0,.25)){
-webkit-box-shadow : $h $v $b $brand-color;
-moz-box-shadow : $h $v $b $brand-color;
box-shadow : $h $v $b $brand-color;
}

Using it, like so:

div{
@include boxshadow(0px,1px,2px,rgba(green,0.4));
}

If you don’t specify any options and use the mixin as `@include boxshadow()` default styles defined in the mixin will be applied.

http://codepen.io/anon/pen/mgqcC