Less is a programming language, or just something more complex than CSS?

2

Well I believe that Less may not be a programming language, so what is it? where do you rate?

If it's really a programming language, what makes it?

    
asked by anonymous 15.04.2016 / 21:52

3 answers

3

LESS is a style sheet language dynamic, but not a programming language - because it is not Turing-complete .

Its main features are:

  • Variables

    @pale-green-color: #4D926F; // Definição de variável
    
    #header {
      color: @pale-green-color; // utilização de variável
    }
    h2 {
      color: @pale-green-color;
    }
    
  • Mixins

    .rounded-corners (@radius: 5px 10px 8px 2px) { // Definição da primitiva
      -webkit-border-radius: @radius;
      -moz-border-radius: @radius;
      border-radius: @radius;
    }
    
    #header {
      .rounded-corners; // Utilização da primitiva
    }
    
  • Style in nesting

    .header {
        p {
            font-size: 16px              // compilado como .header p {...}
            a {
                text-decoration: none;   // compilado como .header p a {...}
                &:hover {
                    border-width: 1px;
                }
            }
        }
    }
    

Browsers do not interpret LESS. A LESS file must be interpreted when the code is ready for the target environment, and the result of the interpretation is a standard CSS file that is then made available for consumption.

Source.

    
15.04.2016 / 22:08
1

LESS is not a programming language but rather a pre-processor CSS as well as SASS.

The purpose of LESS is to extend the capabilities of CSS, adding new features to generate CSS such as Mixins, Functions and Variables - all features that do not exist in CSS.

The LESS processor will transform your LESS code into pure CSS for use in the usual way.

Having doubts about the characteristics of a programming language, visit the link contained in the @bigown comment in your post.

    
15.04.2016 / 22:13
0

LESS is referenced as a language, it generates CSS starting from a logic. LESS generates CSS as PHP ends in HTML. We can not deny that it is more complex, but for less code to do more than have less refactoring. You can find more details about the features you can use in the documentation examples at the link below.

link

    
15.04.2016 / 21:58