CSS

594 readers
1 users here now

founded 2 years ago
MODERATORS
101
102
103
1
3D in CSS (garden.bradwoods.io)
submitted 2 years ago by poudlardo@jlai.lu to c/css@programming.dev
104
1
submitted 2 years ago* (last edited 2 years ago) by poudlardo@jlai.lu to c/css@programming.dev
 
 

For a project, I had to compile SCSS code to CSS. Everything seemed to work, except for a @for loop similar to this :

$base-color: #036;

@for $i from 1 through 3 {
  ul:nth-child(3n + #{$i}) {
    background-color: lighten($base-color, $i * 5%);
  }
}

This loop hasn't been compiled at all to CSS, as CSS does not loop though selectors. But is there a way to loop this code with JavaScript ?

105
106
1
submitted 2 years ago* (last edited 2 years ago) by starman@programming.dev to c/css@programming.dev
107