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

CSScomb collect all $variables togather in scss file. #467

Closed
zheeeng opened this issue May 31, 2016 · 2 comments
Closed

CSScomb collect all $variables togather in scss file. #467

zheeeng opened this issue May 31, 2016 · 2 comments

Comments

@zheeeng
Copy link

zheeeng commented May 31, 2016

In csscomb/sublime-csscomb#75, I submitted this question. Here I paste it again. I use CSScomb plugin for sublime. Please save my scss file.

Original scss file demo:

@function cal($paras) {
    $sum: 0;
    @each $para in $paras {
        $sum: $sum + $para;
    };
    $sum: $sum * 2;
    @return $sum;
}

After running CSScomb:

@function cal($paras) {
    $sum: 0;
    $sum: $sum * 2;
    @each $para in $paras {
        $sum: $sum + $para;
    };
    @return $sum;
}

This change is unacceptable!

Another bug only appears in sublime, original scss file demo:

@function cal($parasets...) {
    $sum: 0;
    @each $paraset in $parasets {
        @each $para in $paraset {
            $sum: $sum + $para;
        }
    }
    @return $sum;
}

.test {
    height: cal(20px 20px, 30px 40px 10px);
}

It works fine. But if I call the function by:

.test {
    height: cal((20px 20px), (30px 40px 10px));
}

Oops, CSScomb throw a error:

.../Application Support/Sublime Text 3/Packages/CSScomb/node_modules/csscomb/node_modules/csscomb-core/lib/core.js:412
            throw e;
            ^
@rickysullivan
Copy link

For starters, you can could just @return $sum * 2;

@tonyganch
Copy link
Member

@zheeeng, hey, this is an issue with your current config. Do you still need help with that?

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

No branches or pull requests

3 participants