1) Explain what is Sass? How it can be used?
Sass stands for Syntactically Awesome Stylesheets and was created by Hampton Catlin. It is an extension of CSS3, adding nested rules, mixins, variables, selector inheritance, etc.
Sass can be used in three ways
2) List out the key features for Sass?
Key features for Sass include
3) List out the Data Types that SassScript supports?
SassScript supports seven main data types
4) Explain how to define a variable in Sass?
Variables in Sass begin with a ($) sign and variable assignment is done with a colon(:).
5) Explain what is the difference between Sass and SCSS?
The difference between Sass and SCSS is that,
Any CSS valid document can be converted to Sass by simply changing the extension from.CSS to.SCSS.
6) What Selector Nesting in Sass is used for?
In Sass, selector nesting offers a way for stylesheet authors to compute long selectors by nesting shorter selectors within each other.
7) Explain what is a @extend function used for in Sass?
In Sass, the @EXTEND directive provides a simple way to allow a selector to inherit the styles of another one. It aims at providing a way for a selector A to extend the styles from a selector B. When doing so, the selector A will be added to selector B so they both share the same declarations. @EXTEND prevents code bloat by grouping selectors that share the same style into one rule.
8) Explain what is the use of the @IMPORT function in Sass?
The @IMPORT function in Sass
9) Why Sass is considered better than LESS?
10) Explain what is the use of Mixin function in Sass? What is the meaning of DRY-ing out a mixin?
Mixin allows you to define styles that can be re-used throughout the stylesheet without needing to resort to non-semantic classes like .float-left.
DRY-ing out of a mixing means splitting it into dynamic and static parts. The dynamic mixin is the one that the user actually going to call, and the static mixin is the pieces of information that would otherwise get duplicated.
11) Explain what Sass Maps is and what is the use of Sass Maps?
Sass map is a structured data in a hierarchical way and not just a bunch of variables. It can help in organizing the code. Some great use of Sass are
12) Explain how Sass comments are different from regular CSS?
Syntax for comments in regular CSS starts with /* comments…*/, while in SASS there are two type of comment, the single line comments // and the multiline CSS comments with /* */.
13) Does Sass support inline comments?
Single line comments // will be removed by the .scss pre-processor and won’t appear in your .css file
While the comment */ are valid CSS, and will be preserved between the translation from .scss to your .css file
14) How interpolation is used in Sass?
In Sass, you can define an element in a variable and interpolate it inside the Sass code. It is useful when you keep your modules in separate files.
15) Explain when can you use the %placeholders in Sass?
%placeholders in Sass is useful when you want to write styles that were meant to be extended, but you don’t want the base styles to be seen in output CSS styles
16) Is it possible to nest variables within variables in Sass?
Interpolation of variables names is not possible currently in Sass. However, you may use interpolation of placeholders.
17) What are Sass cons and pros?
18) Explain what is LESS?
LESS is dynamic style sheet producing language. LESS is a CSS pre-processors and extends CSS with dynamic behaviour. It allows for variables, mixins, operations and functions. LESS runs on server side and client side both.
19) Explain how to create LESS file and where to store it and compile it?
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
20) In what ways LESS can be used?
21) How variable is represented in LESS?
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.
22) Explain how Mixins is useful?
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.
23) Explain how can set code in a watch mode when you run LESS.js in an HTML5 browser?
24) Explain what is the meaning of nesting in LESS programming?
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.
25) Mention what are the color channel functions used in LESS?
26) Explain what is data-uri in LESS?
In CSS, Data URI’s is 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
27) Explain what “Source Map Less Inline”?
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.
28) Explain what is the use of Extend “all” in LESS?
When you specify all keyword last in an extend argument, it tells LESS to match that selector as part of another selector.
29) Explain what is “StrictImports” in LESS?
The strictImports controls whether the compiler will allow a @import inside of either @media blocks or other selector blocks
30) List out the differences between LESS and Sass?
Each style-sheet language is good in their perspective and use; however there are few differences in their usage.
|– Variable names are prefaced with the @symbol||– Variable name are prefaced with $ symbol|
|– LESS does not inherit multiple selectors with one set of properties||– Sass inherits multiple selectors with one set of properties|
|– LESS does not work with “unknown” units neither it returns syntax error notification for incompatible units or maths related syntax error||– Sass allows you to work with “unknown” units also returns a syntax error notification for incompatible units|
31) What are the similarities between LESS and Sass?
Between LESS and Sass the similarities are
32) 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
33) Explain what is the use of operations in LESS?
Operations can be used for performing functions like
34) Explain what is the use of Escaping?
The use of escaping in LESS
35) What does LESS elements contains?
Less elements contain commonly used mixins like
36) List out alternatives against LESS?
37) Explain how you can invoke the compiler from the command line?
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
38) What is the use of e () function?
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.
39) Explain how you can pre-compile LESS into CSS?
To pre-compile LESS into CSS you can use
40) Explain how merge function is used in LESS?
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
41) How can you create a loop structures in LESS?
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.
42) Why do we need parametric mixins in LESS?