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

$counter in @each statement not working #59

Open
kayetter opened this issue Jun 16, 2018 · 1 comment · May be fixed by #103
Open

$counter in @each statement not working #59

kayetter opened this issue Jun 16, 2018 · 1 comment · May be fixed by #103

Comments

@kayetter
Copy link

kayetter commented Jun 16, 2018

I am not getting this statement to work. Using your example:

@each $animal $i in (puma, sea-slug, egret, salamander) { .$(animal)-icon { background-image: url("images/icon-$(i).svg"); } }

The CSS that is returned when I include the counter($i) looks like this:

.$(animal)-icon { background-image: url("images/icon-$i.svg"); }

If I remove the counter, the statement proceeds as expected.

@ghost
Copy link

ghost commented Nov 21, 2019

In my case $counter starts from 0, not from 1:

@each $icon $i in (network, orders, store, support) {
  .icon-$(i) {
    test-icon: $icon;
  }
}

returns:

.icon-0 {
    test-icon: network;
  }

.icon-1 {
    test-icon: orders;
  }

.icon-2 {
    test-icon: store;
  }

.icon-3 {
    test-icon: support;
  }

@armano2 armano2 linked a pull request Sep 20, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant