LHJ

I'm a FE developer.

1. sass basic - variables

02 Nov 2020 » sass

1. sass basic - variables

div*#box$*5

<div id="box1"></div>
<div id="box2"></div>
<div id="box3"></div>
<div id="box4"></div>
<div id="box5"></div>
$bg-color: #00f;

body {
    background-color: #ddd;
}

#box1 {
    color: #ff0;
    background-color: $bg-color;
    width: 100px;
}

#box2 {
    color: #ff0;
    background-color: $bg-color;
    width: 200px;
}

#box3 {
    color: #ff0;
    background-color: $bg-color;
    width: 300px;
}

#box4 {
    color: #ff0;
    background-color: $bg-color;
    width: 400px;
}

#box5 {
    color: #ff0;
    background-color: $bg-color;
    width: 500px;
}