Is it possible to overload mixins in sass? -
let have mixin shadow such:
@mixin box-shadow($offset, $blur, $color) { -moz-box-shadow: $offset $offset $blur $color; -webkit-box-shadow: $offset $offset $blur $color; box-shadow: $offset $offset $blur $color; }
is possible overload mixin like:
@mixin box-shadow($offset, $blur) { @include box-shadow($offset, $blur, #999); }
or have use different names mixins?
you can't overload, typical practice set defaults.
/* take color arg, or fall #999 on 2 arg call */ @mixin box-shadow($offset, $blur, $color: #999) { -webkit-box-shadow: $offset $offset $blur $color; -moz-box-shadow: $offset $offset $blur $color; box-shadow: $offset $offset $blur $color; }
Comments
Post a Comment