zl程序教程

您现在的位置是:首页 >  其它

当前栏目

[SCSS] Create a gradient with a Sass loop

with create loop Sass Scss Gradient
2023-09-14 08:59:16 时间

In this lesson, you will learn how to iteratively generate CSS selectors and attributes using Sass loops. We will create a gradient of 100 elements, each with 1% darker colour using only a couple of lines of Sass.

 

@for $i from 1 through 100 {
  .block#{$i} {
    background: darken(white, $i);
  }
}