csstools / csstools/postcss-advanced-variables

@each don't work properly.

Open
#88 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
144
Forks
33
PR merge metrics
No merged PRs in 30d

Description

I have @each loop:

```sass
@each $status $color in $list-statuses
````
but doesn't work

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

where $i is only a counter.

Is it not possible to do this:

```scss
@each $animal $i in (puma, sea-slug, egret, salamander), (something, something1, something2, something3) {
.#{$animal}-icon {
background-image: url("images/icon-#{$i}.svg");
}
}
```
or

```sass
$list-statuses: (
"inprogress" : $cv-pending,
"In Progress" : $cv-pending,
"tobedone" : $cv-g-200,
"complete" : $cv-success,
"Complete" : $cv-success,
"Cancelled" : $cv-alert,
"Active" : $cv-notification,
);

@each $status $color in $list-statuses {
[data-value="#{$status}"] {
.list-dropdown {
@include background-contrast-hover($color);
border-color:$color;
}

&.cs-tag {
@include background-contrast($color);
border-color:$color;
}
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.