-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettify.scss
36 lines (35 loc) · 992 Bytes
/
settify.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* Settify mixin for SASS. */
/* Version 1.1 - 2016.01.04. */
/* Author: Zsolt Pentz - github.com/pentzzsolt */
/* License: CC0 1.0 Universal (Public Domain) */
@mixin settify($selector, $properties...) {
@for $i from 1 through (length($sets)) {
@if $i == 1 {
@for $j from 1 through length(nth($sets, $i)) {
&:nth-#{$selector}(#{$j}) {
@each $property in $properties {
#{$property}: nth(nth($sets, $i), $j);
}
}
}
}
@else {
@for $j from 1 through length(nth($sets, $i)) {
@if $j == 1 {
&:nth-last-#{$selector}(-n+#{length(nth($sets, $i))}):first-#{$selector} {
@each $property in $properties {
#{$property}: nth(nth($sets, $i), $j);
}
}
}
@else {
&:nth-last-#{$selector}(-n+#{length(nth($sets, $i))}):first-#{$selector} ~ #{nth(nth(&, 1), length(nth(&, 1)))}:nth-#{$selector}(#{$j}) {
@each $property in $properties {
#{$property}: nth(nth($sets, $i), $j);
}
}
}
}
}
}
}