SASS mixins - default value for @content -
is possible define default value @content 1 arguments?
for instance like:
@mixin foo { @content: width:100%; }
no, @content not variable. cannot set default value it. cannot manipulate or examine it.
if alessandro's answer unsuitable needs, you'll need create mixin results desire:
@mixin foo { color: red; @content; } @mixin empty-foo { @include foo { width: 100%; } } .foo { @include foo { border: 1px solid; } } .bar { @include empty-foo; }
Comments
Post a Comment