-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixin : default value for variable arguments feature #810
Comments
+1 |
You can do this currently the same way you define input defaults in JavaScript; with a check: @mixin my-font($font-family...) {
@if length($font-family) == 0 {
$font-family: sans-serif;
}
font-family: $font-family;
} Or, with Sass's @mixin my-font($font-family...) {
$font-family: if(length($font-family) == 0, sans-serif, $font-family);
font-family: $font-family;
} |
👍 That's how we expected it to be used. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, it's possible to have a default value for a mixin arguments
or a variable arguments (that you must fill in)
But it's not possible to have a default value for a variable arguments, to not be forced to fill it
What do you think ?
The text was updated successfully, but these errors were encountered: