CSS

477 readers
1 users here now

founded 1 year ago
MODERATORS
76
77
 
 

Note does not work on firefox

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

96
7
submitted 1 year ago* (last edited 1 year ago) by mac to c/css
97
6
submitted 1 year ago* (last edited 1 year ago) by starman to c/css
98
7
Hello CSSers! (self.css)
submitted 1 year ago by tappyturtle to c/css