CSS

542 readers
1 users here now

founded 2 years ago
MODERATORS
76
77
11
submitted 2 years ago by mac to c/css
78
79
 
 

Note does not work on firefox

80
81
82
83
84
85
86
3
The new @font-face syntax (fullystacked.net)
submitted 2 years ago by mac to c/css
87
88
89
90
8
submitted 2 years ago by mac to c/css
91
92
93
7
submitted 2 years ago by mac to c/css
94
1
submitted 2 years ago by mac to c/css
95
96
9
3D in CSS (garden.bradwoods.io)
submitted 2 years ago by [email protected] to c/css
97
2
submitted 2 years ago* (last edited 2 years ago) by [email protected] to c/css
 
 

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 ?

98
7
submitted 2 years ago* (last edited 2 years ago) by mac to c/css
99
6
submitted 2 years ago* (last edited 2 years ago) by starman to c/css