Less (stylesheet language) Interview Questions & Answers

4 avg. rating (80% score) - 5879 votes

Less (stylesheet language) Interview Questions & Answers

Are you a person with knowledge in Java Script? Are you experienced in dynamic style sheet language then log on to www.wisdomjobs.comLess (style sheet language) is a dynamic style sheet language designed by Alexis Seller from Berlin. It can serve client-side, it can run server-side, it can be precompiled into CSS. It extends CSS with dynamic tools such as variables, mixins, operations and functions. It can evaluate Java Script inline, it is a dynamic preprocessor style sheet language that can be compiled into cascading style sheets (CSS) and run on the client side or server side. So explore your path into LESS (Style Sheet Language) as Developer, Web designer, programmer by looking into LESS Job interview question and answers given.

Less (stylesheet Language) Interview Questions

Less (stylesheet language) Interview Questions
    1. Question 1. Explain What Is Less?

      Answer :

      LESS is dynamic style sheet producing language. LESS is a CSS pre-processors and extends CSS with dynamic behavior. It allows for variables, mixins, operations and functions. LESS runs on server side and client side both.

    2. Question 2. Explain How To Create Less File And Where To Store It And Compile It?

      Answer :

      Creating or storing LESS file is similar to creating/storing CSS file. A new LESS file can be created with a .less extension, or you can rename existing .css file to .less file. You can write LESS code with existing CSS code.

      The best way of creating it inside ~/content/ or ~/Styles/ folder.

    3. Question 3. In What Ways Less Can Be Used?

      Answer :

      Following are the ways :

      • Via npm LESS can be used on the command line
      • Download as a script file for the browser
      • For third party tools, it is used

    4. Question 4. How Variable Is Represented In Less?

      Answer :

      LESS allows variables to be defined. In LESS, the variable is represented as @ sing. While, variable assignment is done with a : (colon) sing. The values of the variables are inserted into the CSS output file as well as minified file.

    5. Question 5. Explain How Mixins Is Useful?

      Answer :

      Mixins enable embedding all the properties of a class into another class by including the class name as one of its properties. It is just like variables but for whole classes.

    6. Question 6. Explain How Can Set Code In A Watch Mode When You Run Less.js In An Html5 Browser?

      Answer :

      If you run LESS.js in an HTML5 browser, it will use local storage to cache the generated CSS. However, from the developer point of view they cannot see the changes they made instantly. In order to see your changes instantly, you can load program in development and watch mode by following JavaScript.

    7. Question 7. Explain What Is The Meaning Of Nesting In Less Programming?

      Answer :

      Nesting in LESS is clustering of statements inside other statements, so it forms a group of related code. In other words when we add a code snippet and add another code inside it, then that code snippet is called nesting.

    8. Question 8. Mention What Are The Color Channel Functions Used In Less?

      Answer :

      color channel function used in LESS are as:

      • hue
      • saturation
      • hsvhue
      • saturation
      • hswalue
      • red
      • green
      • blue
      • alpha
      • luma
      • luminance

    9. Question 9. Explain What Is Data-uri In Less?

      Answer :

      In CSS, Data URI’sis one of the best technique, it allows developers to avoid external image referencing and instead embed them directly into a stylesheet. Data URIs are the excellent way to reduce HTTP requests

    10. Question 10. Explain What “source Map Less Inline”?

      Answer :

      The “Source Map Less Inline” option indicates that we should include all of the CSS files into the sourcemap. Which means that you only need your map file to get to your original source.

    11. Question 11. Explain What Is The Use Of Extend “all” In Less?

      Answer :

      When you specify all keyword last in an extend argument, it tells LESS to match that selector as part of another selector.

    12. Question 12. Explain What Is “strictimports” In Less?

      Answer :

      The strictImports controls whether the compiler will allow a @importinside of either @media blocks or other selector blocks.

    13. Question 13. List Out The Differences Between Less And Sass?

      Answer :

      Each style-sheet language is good in their perspective and use; however there are few differences in their usage.


      • LESS uses JavaScript and processed at client-side
      • Variable names are prefaced with the @symbol
      • LESS does not inherit multiple selectors with one set of properties
      • LESS does not work with “unknown” units neither it returns syntax error notification for incompatible units or math’s related syntax error.


      • Sass is coded in Ruby and thus processed to server-side
      • Variable name are prefaced with $ symbol
      • Sass inherits multiple selectors with one set of properties
      • Sass allows you to work with “unknown” units also returns a syntax error notification for incompatible units.

    14. Question 14. What Are The Similarities Between Less And Sass?

      Answer :

      Between LESS and Sass the similarities are:

      • Namespaces
      • Color functions
      • Mixins and parametric mixins
      • Nesting capabilities
      • JavaScript evaluations

    15. Question 15. Explain What Is The Use Of &combinator?

      Answer :

      &combinatorconcatenates nested selector with the parent selector. It is useful for Pseudo classes such as :hover and :focus.

    16. Question 16. Explain What Is The Use Of Operations In Less?

      Answer :

      Operations can be used for performing functions like:

      • Simple Mathematical operators: +, – , *, /
      • Color functions
      • Math functions
      • Any size or color variable can be operated upon.

    17. Question 17. Explain What Is The Use Of Escaping?

      Answer :

      Following are the use of escaping in LESS:

      • When you need to output CSS that is not valid CSS syntax
      • Proprietary syntax not recognized by LESS
      • LESS compiler will throw an error if not used
      • Simple prefix with ~ symbol and put in quotes

    18. Question 18. What Does Less Elements Contains?

      Answer :

      Less elements contain commonly used mixins like:

      • .gradient
      • .rounded
      • .opacity
      • .box-shadow
      • .inner-shadow

    19. Question 19. List Out Alternatives Against Less?

      Answer :

      • SASS: Syntactically Awesome Stylesheets
      • SCSS: Version.2 of SASS
      • Stylus

    20. Question 20. Explain How You Can Invoke The Compiler From The Command Line?

      Answer :

      You can invoke the compiler from the command line in LESS as

      $ lessc styles.less

      This will output the compiled CSS to stdout; you may then redirect it to a file of your choice

      $ lessc styles.less > styles.css

    21. Question 21. What Is The Use Of E () Function?

      Answer :

      With the help of e()function you can escape a value so that it passes straight through to the compiled CSS, without being noticed by the LESS compiler.

    22. Question 22. Explain How You Can Pre-compile Less Into Css?

      Answer :

      To pre-compile LESS into CSS you can use:

      Run less.js using Node.js : By using the Node.js JavaScript framework you can run the less.js script outside the browser.

      Use lessphp: For the implementation of the LESS compiler written in PHP, lessphp is used.

      Use online Compiler: Use online compiler for quick compilation of LESS code without installing a compiler

      Less. app (for Mac users): Less.app is a free tool for Mac users, this tool auto compiles them into CSS files.

    23. Question 23. Explain How Merge Function Is Used In Less?

      Answer :

      For aggregating values from multiple properties into a space or comma separated list under a single property LESS is used. It is useful for properties such as transform and background.

    24. Question 24. How Can You Create A Loop Structures In Less?

      Answer :

      A mixin can call itself in LESS. Such recursive mixins, when combined with Pattern matching and Guard Expressions, can be used to create various iterative/loop structures.


      .loop(@counter) when (@counter > 0) {
        .loop((@counter - 1));    //
      next iteration
        width: (10px * @counter); // code for each
      div {
        .loop(5); // launch the loop
      div {
        width: 10px;
        width: 20px;
        width: 30px;
        width: 40px;
        width: 50px;

    25. Question 25. Why Do We Need Parametric Mixins In Less?

      Answer :

      Parametric mixinsare same like standard mixins. The only difference is that parametric mixins take parameters like functions in JavaScript. After determining parameters to the mixins, you get more control over mixins.

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SASS (Syntactically Awesome Style sheets) Tutorial