Sha256: 2f361daba204e2b63774c6a99f4455a8d087e636f11501f76e29875e54d405ed

Contents?: true

Size: 281 Bytes

Versions: 7

Compression:

Stored size: 281 Bytes

Contents

// Calculate the total sum of a list
@function list-sum($list) {
  // zero out the initial sum
  $sum: 0;
  // loop through each value in the list adding it to $list-sum
  @for $i from 1 through length($list) {
    $sum: $sum + nth(nth($list, $i), 1);
  }
  @return nth($sum, 1);
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
singularity-extras-1.0.0 stylesheets/singularity-extras/helpers/_list-sum.scss
singularity-extras-1.0.0.alpha.3 stylesheets/singularity-extras/helpers/_list-sum.scss
singularity-extras-1.0.0.alpha.2 stylesheets/singularity-extras/helpers/_list-sum.scss
singularity-extras-1.0.0.alpha.1 stylesheets/singularity-extras/helpers/_list-sum.scss
singularity-extras-0.0.3 stylesheets/singularity-extras/helpers/_list-sum.scss
singularity-extras-0.0.2 stylesheets/singularity-extras/helpers/_list-sum.scss
singularity-extras-0.0.1 stylesheets/singularity-extras/helpers/_list-sum.scss