Skip to content

Commit 176e07c

Browse files
committed
LukyVj#61 Fixed each mixin. every is now an alias of each with default starting point of 1.
1 parent 553fb3c commit 176e07c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/src/_family.scss

+5-5
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@
9898
/// @alias every
9999
@mixin each($num, $from: 0) {
100100

101-
@if $from != 0 {
102-
&:nth-child(#{$num}n + $from) {
101+
@if $from == 0 {
102+
&:nth-child(#{$num}n) {
103103
@content;
104104
}
105105
} @else {
106-
&:nth-child(#{$num}n) {
106+
&:nth-child(#{$num}n + #{$from}) {
107107
@content;
108108
}
109109
}
@@ -113,8 +113,8 @@
113113
/// @group with-arguments
114114
/// @content [Write the style you want to apply to the children, and it will be added within the @content directive]
115115
/// @param {number} $num - id of the child
116-
@mixin every($num) {
117-
&:nth-child(#{$num}n) {
116+
@mixin every($num, $from: 1) {
117+
@include each($num, $from) {
118118
@content;
119119
}
120120
}

0 commit comments

Comments
 (0)