I want to create a structure like this
.nav-dropdown-items {
.nav-link {
padding-left: 1rem;
.nav-dropdown-items {
.nav-link {
padding-left: 2rem;
.....
}
}
}
}
This is my sass code
@mixin generatePadding($counter, $i:1){
@debug $i;
@debug $counter;
.nav-dropdown-items {
.nav-link {
padding-left: 1rem + $i;
@if $i < $counter {
@debug "include";
@include generatePadding($counter, ($i+1)); // next iteration
}
}
}
}
But the padding is always the same(2rem) instead 2rem, 3rem, 4rem, ....
Someone can tell me why?