The Wayback Machine - https://web.archive.org/web/20200716032423/https://github.com/morishitter/stylefmt/issues/275
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

sass length method breaks in at statement #275

Open
modosc opened this issue Mar 15, 2017 · 11 comments
Open

sass length method breaks in at statement #275

modosc opened this issue Mar 15, 2017 · 11 comments

Comments

@modosc
Copy link
Contributor

@modosc modosc commented Mar 15, 2017

(this is without any config btw)

a space is added after the length method is used in a @for:
input:

@for $i from 1 through length($colors)

output:

@for $i from 1 through length ($colors)

this works when in a normal declaration:
input:

$foo: length($bar);

output:

$foo: length($bar);
@modosc modosc changed the title sass length method breaksin at statement sass length method breaks in at statement Mar 15, 2017
@jimblue
Copy link

@jimblue jimblue commented Apr 6, 2017

same problem here

@tplk
Copy link

@tplk tplk commented May 26, 2017

Same.

src/app/menu/menu.component.scss
     flex-shrink: 0;
   }
 }
-@for $i from 1 through length($menu-bg-colors) {
+@for $i from 1 through length ($menu-bg-colors) {
   .menu.menu_#{$i - 1} {
     &::-webkit-scrollbar-track {
       background-color: nth($menu-bg-colors, $i);
     }
@modosc
Copy link
Contributor Author

@modosc modosc commented May 26, 2017

i'll look at this today.

@jimblue
Copy link

@jimblue jimblue commented May 30, 2017

any update about a fix?

@tplk
Copy link

@tplk tplk commented May 30, 2017

@jimblue pr #308 pending review.

@jimblue
Copy link

@jimblue jimblue commented May 30, 2017

@t-p-l-k cool thanks 👍

@tplk
Copy link

@tplk tplk commented May 30, 2017

@jimblue thank @modosc, not me)

@t47io
Copy link

@t47io t47io commented Jun 4, 2017

Any update on this or merge the PR? This bug is preventing me using it in my project. So a fixed release would be great, thanks!

@tplk
Copy link

@tplk tplk commented Jun 5, 2017

@t47io here's a temporary fix:

$length-menu-bg-colors: length($menu-bg-colors);

@for $i from 1 through $length-menu-bg-colors {
  ...
}

Create a variable to store array's length and use it instead.
Works for me, both stylelint and stylefmt don't complain.

@jimblue
Copy link

@jimblue jimblue commented Jun 16, 2017

any news about this PR?

@modosc
Copy link
Contributor Author

@modosc modosc commented Jul 25, 2017

@morishitter ping?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.