Skip to content
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

Simpler / safer aliasing #15

Closed
KittyGiraudel opened this issue Oct 26, 2014 · 4 comments
Closed

Simpler / safer aliasing #15

KittyGiraudel opened this issue Oct 26, 2014 · 4 comments

Comments

@KittyGiraudel
Copy link

Current:

@mixin justify-content($value: flex-start) {
  // ...
}

// Shorter version:
@mixin flex-just($value: flex-start) { @include justify-content($value); }

Why not:

@mixin justify-content($value: flex-start) {
  // ...
}

// Shorter version:
@mixin flex-just($args...) { @include justify-content($args...); }
@mastastealth
Copy link
Owner

@hugogiraudel Thanks for the tip. For my own reference, I take it "$args..." would grab the $value's of the long-versions (therefore won't affect anyone who updates)? I've applied it to both justify and direction.

@KittyGiraudel
Copy link
Author

Not sure what you mean.

@mastastealth
Copy link
Owner

As in, justify-content defaults to flex-start. Rather than having to redefine that as:
@mixin flex-just($value: flex-start) { @include justify-content($value); }
by using $args... it'll receive whatever custom argument is used, but if none are provided it will know to use the default value of flex-start from the justify-content mixin it's calling?

@KittyGiraudel
Copy link
Author

Yep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants