File: _set-multiple.scss

package info (click to toggle)
compass-toolkit-plugin 2.10.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 520 kB
  • sloc: ruby: 63; javascript: 49; makefile: 2; sh: 1
file content (20 lines) | stat: -rw-r--r-- 554 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@mixin set-multiple($value, $properties...) {
  $property-length: length($properties);
  $error-msg: "The `set-multiple` mixin requires you to pass in a list of properties as the second argument";

  @if $property-length < 1 {
    @if feature-exists(at-error) {
      @error $error-msg;
    }
    @else {
      @warn $error-msg;
    }
  }

  // If the first argument passed in is a white-spaced separated list.
  $properties: if($property-length == 1, nth($properties, 1), $properties);

  @each $property in $properties {
    #{$property}: $value
  }
}