SASS mixins - default value for @content

后端 未结 2 1261
南旧
南旧 2020-12-22 04:41

Is it possible to define a default value for @content just as one would do with arguments?

For instance something like:

@mixin foo {
            


        
2条回答
  •  不知归路
    2020-12-22 05:27

    try this:

    @mixin foo($content: 100%) {
        width:$content;
    }
    

    or this:

        @mixin foo() {
            $content: 100%;
            width:$content;
        }
    

提交回复
热议问题