Is it possible to overload mixins in sass?

前端 未结 3 877
感动是毒
感动是毒 2021-02-04 00:59

Let say you have a mixin for shadow like such:

@mixin box-shadow($offset, $blur, $color)
{
   -moz-box-shadow: $offset $offset $blur $color;
   -webkit-box-shado         


        
3条回答
  •  深忆病人
    2021-02-04 01:25

    If you need to tweak a vendor mixin slightly you can copy it to another file - included after the original - and edit it in there, and the vendor's original will be ignored.

    @import "_their-mixins";
    @import "_our-mixins";
    

    Warning - this may depend on which processor you are using. At time of writing it works great using grunt and grunt-contrib-compass

提交回复
热议问题