Values of less variable depends on the scope. If the value is not specified in the specific scope, LESS will look for it in upper blocks until it finds the nearest declaration.
Example:-
@text-color: #000000;
ul{
@text-color: #fff;
background-color: #03A9F4;
padding: 10px;
list-style: none;
li{
color: @text-color;
border-radius: 3px;
margin: 10px 0;
}
}
In the above code First I have created a variable @text-color: #000000; and then declared this inside li{ in color like color: @text-color; doing this it show black color in CSS output as shown in output below.
Output:-
ul {
background-color: #03A9F4;
padding: 10px;
list-style: none;
}
ul li {
color: #ffffff;
border-radius: 3px;
margin: 10px 0;
}
0 Comment(s)