Google News
logo
Less Interview Questions
1 .
Explain what is the use of &combinator ?
&combinator concatenates nested selector with the parent selector. It is useful for Pseudo classes such as :hover and :focus
Operations can be used for performing functions like
 
* Simple Mathematical operators : +, – , *, /
* Color functions
* Math functions
* Any size or colour variable can be operated upon
Less elements contain commonly used mixins like :
 
* .gradient
* .rounded
* .opacity
* .box-shadow
* .inner-shadow

SASS : Syntactically Awesome Stylesheets
SCSS : Version.2 of SASS
Stylus
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
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
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.
In less, there are various Node.js compilers used that are given below :
 
* grunt-contrib-less
* assemble-less
* gulp-less
* autoless etc.
The list of different types of functions in Less is as follows :
 
* Misc function
* String functions
* List function
* Math function
* Type function
* Color definition function
* Color channel function
* Color operation
* Color blending functions
The extend is a Less pseudo class which is used to select another selector style in one selector.
 
For example :
h2 {  
   &:extend(.style);  
   font-style: italic;  
}  
  
.style {  
   background: green;  
}