Consider the following two mixins:
@mixin padding($v: 8px)
padding: $v - 3 $v $v - 3 $v
@mixin button($padding: "")
@include padding($padding)
@include border-radius
border: 1px solid black
I can call @include padding
without an argument, and the default 8px
gets used, no problem. But how can I call the button
mixin and still have the default value get used in the padding
mixin? If I simply call @include button
without an argument, the button
mixin still seems to pass some kind of argument to padding
(which padding
inevitably interprets as 0, thus not adding any padding). Based on Making a Sass mixin with optional arguments, I tried modifying the button
mixin to have
@include padding(unquote($padding))
but that had no effect -- padding
still seemed to interpret the argument as being 0, rather than there being no argument and thus using its default value.