Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Less Scope

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 227
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: