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

Default parameter values should be able to refer to previous parameters #39

Closed
jeffpatzer opened this issue Aug 23, 2012 · 3 comments
Closed

Comments

@jeffpatzer
Copy link

@mixin font-size($font-size,$lines:ceil($font-size / $base-line-height)){
    font-size:$font-size;
    line-height:rhythm($lines,$font-size);
}

Notice the use of $font-size in the arg list. This will fail, but works in normal scss.

@akhleung
Copy link

This is a semantically weird thing for Sass to allow, but I'll duplicate it if it's standard and existing code depends on it.

@chriseppstein
Copy link
Contributor

Yes, any parameter can have a default value that depends on the value of the previous arguments. Python does this too and it's really quite nice.

@akhleung
Copy link

akhleung commented Sep 1, 2012

Fixed!

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

3 participants