LESS Interview Questions
Less interview questions
These Less questions have been designed for various interviews, competitive exams and entrance tests. We have covered questions on both basic and advanced concepts which will help you improve your skills to face interview questions on Less.Who are these Less interview questions designed for?
All the Front End developers, UI/ UX developers and designers will find these questions extremely useful. All freshers, BCA, BE, BTech, MCA and college students wanting to make a career in front end designing will be highly benefitted by these questions.Less interview questions topics
This section covers Less topics like - Less Nested Rules, Operations, Escaping, Functions, Namespaces and Accessors, Scope, Comments, Importing, Variables, Mixins, Parametric Mixins, Mixins as Functions,Passing Rulesets to Mixins, Import Directives, Import Options, Merge etc. etc.
1. What is LESS?
Answer:
LESS (Leaner CSS) is a dynamic style sheet which can be run on client-side or server-side.
It is mostly designed to make CSS more manageable, customizable and reusable.
LESS is a powerful CSS extension which makes designing easier and more efficient.
It helps writing CSS simpler and object-oriented.
2. What are the features of LESS?
Answer:
LESS compiles faster than other preprocessor of CSS.
It is a clean, compact and readable code written in a well organized way.
It supports cross-browser compatibility.
It provides @import rule so you can easily handle external files. Importing is required when we have multiple style sheets.
It facilitates to define styles which can be reused throughout the code.
3. What are the disadvantages of LESS?
Answer:
LESS has a tight coupling between modules so it takes time to reuse and/or test dependent modules.
If you are new to CSS preprocessing then it takes time to learn LESS.
LESS has lesser framework compared to SASS, which consists of frameworks Compass, Gravity and Susy.
4. What is the difference between SASS and LESS?
Answer:
SASS | LESS |
---|
To run SASS, you will need to have Ruby installed. | LESS is written in JavaScript, so you will need NodeJS to run it. |
To assign a variable SASS uses '$'symbol.
Example:
$font-stack: Helvetica, sans-serif;
$primary-color: #333;
body {
font: 100% $font-stack;
color: $primary-color;
} | To assign a variable LESS uses '@'symbol.
Example:
@nice-blue: #5B83AD;
@light-blue: @nice-blue + #111;
#header {
color: @light-blue;
} |
SASS inherits multiple selectors with one set of properties. | LESS does not inherit multiple selectors with one set of properties. |
SASS has Compass available for mixins, which includes every option available with updates for future support. | LESS has Preboot.less, LESS mixins, LESS Elements, gs and Frameless. |
5. Why should we use LESS?
Answer:
LESS is an open-source written in JavaScript. It compiles and generates into a simple CSS which works across the browser and supports creating cleaner CSS faster and easier.
Less keeps your code in modular. Codes are simple and well organized as compared to CSS
Less offers list of operators that makes coding faster.
LESS has better error messages and user friendly documentation than SASS.
Less also supports Lazy Loading feature.
6. How to pre-compile LESS into CSS?
Answer:
To pre-compile LESS into CSS you can use,
Run less.js using Node.js: By using Node.js JavaScript framework, you can run 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.
7. What is the use of Extend in LESS?
Answer:
Extend is a feature of LESS.
This feature acts as a pseudo class which extends other selector styles in one selector by using :extend selector.
Extend is placed into ruleset or attached to a selector.