SASS (Syntactically Awesome Style sheets) Interview Questions & Answers

  1. Question 1. What Is Sass?

    Answer :

    SASS (Syntactically Awesome Stylesheet) is a CSS pre-processor which helps to reduce repetition with CSS and saves time. It is more stable and powerful CSS extension language that describes style of document cleanly and structurally.

  2. Question 2. Why To Use Sass?

    Answer :

    • It is pre-processing language which provides indented syntax (its own syntax) for CSS.
    • It allows writing code more efficiently and easy to maintain.
    • It is super set of CSS which contains all the features of CSS and is an open source pre-processor, coded in Ruby.
    • It provides document style in good structure format than flat CSS.
    • It uses re-usable methods, logic statements and some of the built in functions such as color manipulation, mathematics and parameter lists.
  3. CSS3 Interview Questions

  4. Question 3. List Out Some Features Of Sass?

    Answer :

    • It is more stable, powerful and compatible with versions of CSS.
    • It is super set of CSS and is based on the JavaScript.
    • It is known as syntactic sugar for CSS which means it makes easier way for user to read or express the things more clearly.
    • It uses its own syntax and compiles to readable CSS.
    • You can easily write CSS in less code within less time.
    • It is an open source pre-processor which is interpreted into CSS.
  5. Question 4. What Are Advantages Of Sass?

    Answer :

    • It allows writing clean CSS in a programming construct.
    • It helps in writing CSS quicker.
    • It is superset of CSS which helps designers and developers work more efficiently and quickly.
    • As Sass is compatible with all versions of CSS, we can use any available CSS libraries.
    • It is possible to use nested syntax and useful functions such as color manipulation, mathematics and other values.
  6. CSS3 Tutorial

  7. Question 5. What Are Disadvantages Of Sass?

    Answer :

    • It takes time for developer to learn new features present in this pre-processor.
    • If more number of people working on the same site, then will use the same preprocessor. Some people use the Sass and some people use the CSS to edit the files directly. So it will become difficult to work with site.
    • There are chances of losing benefits of browser’s built-in element inspector.
  8. HTML 5 Interview Questions

  9. Question 6. Name The Two Syntaxes Supported By Sass?

    Answer :

    SASS supports two syntaxes namely SCSS and Indented syntax.

    • The SCSS (Sassy CSS) is an extension of CSS syntax that makes much easier to maintain large stylesheets and can recognize vendor specific syntax and many CSS. SCSS files use the extension .scss.
    • The Indented is an older syntax and sometimes just called as Sass. Using this form of syntax, CSS can be written concisely. SASS files use the extension .sass.
  10. Question 7. In How Many Ways You Can Use The Sass?

    Answer :

    You can use SASS in three different ways:

    • As a command line tool
    • As a Ruby module
    • As a plugin for Rack enable framework
  11. HTML 5 Tutorial
    SAS Programming Interview Questions

  12. Question 8. What Are Nested Rules In Sass?

    Answer :

    Nesting is combining of different logic structures. Using SASS, we can combine multiple CSS rules within one another. If you are using multiple selectors, then you can use one selector inside another to create compound selectors.

  13. Question 9. How To Refer Parent Selector In The Sass?

    Answer :

    You can select the parent selector by using the & character. It tells where the parent selector should be inserted.

  14. Statistics Interview Questions

  15. Question 10. How To Write Placeholder Selector In Sass?

    Answer :

    SASS supports placeholder selector using class or id selector. In normal CSS, these are specified with “#” or “.”, but in SASS they are replaced with “%”.

  16. SAS Programming Tutorial

  17. Question 11. Mention The Different Types Of Operations On The Sass?

    Answer :

    There are 5 types of operations:

    • Number Operations
    • Color Operations
    • String Operations
    • Boolean Operations
    • List Operations
  18. SAS Programming,SQL server Interview Questions

  19. Question 12. What Are Number Operations?

    Answer :

    It allows for mathematical operations such as addition, subtraction, multiplication and division.

  20. CSS3 Interview Questions

  21. Question 13. What Are Color Operations?

    Answer :

    It allows using color components along with arithmetic operations.

  22. Statistics Tutorial

  23. Question 14. What Are List Operations?

    Answer :

    Lists represent series of values which are separated using commas or space.

  24. Question 15. What Are Boolean Operations?

    Answer :

    You can perform boolean operations on Sass script by using and, or and not operators.

  25. HTML DOM Interview Questions

  26. Question 16. What Are Parentheses In Sass?

    Answer :

    Parentheses is pair of signs which are usually marked off by round brackets ( ) or square brackets [] which provides symbolic logic that affect the order of operations.

  27. CSS Advanced Tutorial

  28. Question 17. What Is Interpolation In Sass?

    Answer :

    It provides SassScript variables in selectors and property names using #{ } syntax. You can specify variables or property names within the curly braces.

  29. CSS Advanced Interview Questions

  30. Question 18. What Is Variable Defaults?

    Answer :

    You can set default values for variables by adding !default flag to the end of the variable value. It will not re-assign the value, if it is already assigned to the variable.

  31. HTML 5 Interview Questions

  32. Question 19. What Is Import Directive?

    Answer :

    It directly takes the filename to import and all the imported files will get combined in a single CSS file.

  33. Question 20. What Is Media Directive?

    Answer :

    It set style rule to different media types.

  34. Scalable Vector Graphics Interview Questions

  35. Question 21. What Is Extend Directive?

    Answer :

    It is used to share rules and relationships between selectors. It can extend all another class styles in one class and can also apply its own specific styles.

  36. Question 22. What Is At-root Directive?

    Answer :

    It is a collection of nested rules which is able to make style block at root of the document.

  37. Question 23. What Is @if Directive?

    Answer :

    It is used to selectively execute the code statements based on the result of the evaluating an expression.

  38. SQL Server Analysis Services (SSAS) Interview Questions

  39. Question 24. What Is @else If Directive?

    Answer :

    The @else if statements are used with the @if directive, whenever the @if statement fails then the @else if statements are tried and if they also fails then the @else is executed.

  40. SAS Programming Interview Questions

  41. Question 25. What Is @for Directive?

    Answer :

    It allows you to generate styles in a loop. The counter variable is used to set the output for each iteration.

  42. Question 26. What Is @each Directive?

    Answer :

    In @each directive, a variable is defined which contains the value of each item in a list.

  43. Less (stylesheet language) Interview Questions

  44. Question 27. What Is @mixin Directive?

    Answer :

    It is used to define the mixins that includes optionally the variables and argument after the name of the mixin.

  45. Statistics Interview Questions

  46. Question 28. What Is @include Directive?

    Answer :

    It is used to include the mixin in the document and styles defined by the mixin can be included into the current rule.

  47. Question 29. What Are Mixin Arguments?

    Answer :

    The SassScript values can be taken as arguments in mixins which are given when mixin is include and are available as variable within the mixin.

  48. Base Sas Interview Questions

  49. Question 30. Mention The Two Types Of Mixin Arguments?

    Answer :

    There are two types of mixin arguments:

    • Keyword Arguments
    • Variable Arguments
  50. Question 31. What Are Keyword Arguments?

    Answer :

    It is used to include arguments in the mixins. The arguments which are named can be passed in any order and the default values of argument can be omitted.

  51. Question 32. What Are Variable Arguments?

    Answer :

    Variable arguments are used to pass any number of arguments to mixin. It contains keyword arguments passed to the function or mixin.

  52. Question 33. What Are Function Directive?

    Answer :

    Using function directive, you can create your own function and use them in your script context or can be used with any value.

  53. SAS Programming,SQL server Interview Questions

  54. Question 34. What Is Sass Output Style?

    Answer :

    The CSS file that the SASS generates consists of default CSS style which reflects the structure of document. The default CSS styling is good but might not be suitable for all situations.

  55. Question 35. What Is Nested Css Style?

    Answer :

    Nested style is default styling of SASS. This way of styling is very useful when you are dealing with large CSS files.

  56. Question 36. What Is Expanded Css Style?

    Answer :

    In expanded output styling, each property and rule has its own line. It takes more space compared to nested CSS style.

  57. HTML DOM Interview Questions

  58. Question 37. What Is Compact Css Style?

    Answer :

    Compact CSS style competitively takes less space than Expanded and Nested. It focuses mainly on selectors rather than its properties.

  59. Question 38. What Is Compressed Css Style?

    Answer :

    Compressed CSS style takes least amount of space compared to all other styles. It provides whitespaces only to separate selectors and newline at the end of the file.

  60. Question 39. What Are Key Features Of Sass Indented Syntax?

    Answer :

    • It uses indentation rather than { and } to delimit blocks.
    • To separate statements, it uses newlines instead of semicolons(;).
    • Property declaration and selectors must be placed on its own line and statements within { and } must be placed on new line and indented.
  61. Question 40. In How Many Ways You Can Declare Css Properties?

    Answer :

    CSS properties can be declared in two ways −

    • Properties can be declared similar to CSS but without semicolon(;).
    • colon(:) will be prefixed to every property name.
  62. CSS Advanced Interview Questions

  63. Question 41. What Is Shorthand For Writing @mixin And @include Directives?

    Answer :

    You can use = for @mixin directive and + for @include directive which requires less typing and makes your code simpler, and easier to read.

  64. Question 42. Which Command Is Used To Watch The File And Update The Css Whenever Sass File Changes?

    Answer :

    sass –watch C:rubylibsassstyle.scss:style.css

  65. Scalable Vector Graphics Interview Questions

  66. Question 43. What Are Comments In Sass?

    Answer :

    Comments take up entire line and enclose all the text nested under them and they are line-based in indented syntax.

  67. Question 44. Which Command Is Used To Run Sass Code From The Command Line?

    Answer :

    sass input.scss output.css

  68. Question 45. What Are The Css Specifications For Character Encoding Of Stylesheets?

    Answer :

    • First it checks for Unicode byte, next @charset declaration and then Ruby string encoding.
    • Next if nothing is set, then it considers charset encoding as UTF-8.
    • Determine character encoding explicitly by using @charset declaration. Just use “@charset encoding name” at the beginning of the stylesheet and SASS will assume that this is the given character encoding.
    • If output file of SASS contains non ASCII characters, then it will use the @charset declaration.
  69. Question 46. How Many Types Are There In Comments?

    Answer :

    Sass supports two types of comments −

    • Multiline comments − These are written using /* and */. Multiline comments are preserved in CSS output.
    • Single line comments − These are written using // followed by comments. single line comments are not preserved in CSS output.
  70. Question 47. What Is Interactive Shell?

    Answer :

    It evaluates SassScript expression using command line. You can run the shell with the sass command line along with -i option.

  71. Question 48. What Is @debug Directive?

    Answer :

    It detects the errors and display the SassScript expression values to the standard error output stream.

  72. Question 49. What Is @error Directive?

    Answer :

    It displays the SassScript expression value as fatal error.

  73. Question 50. What Are The Data Types That Is Supported By Sassscript?

    Answer :

    SassScript supports seven main data types:

    • Numbers (1, 5, 10)
    • Strings of texts (“foo”, “bar”)
    • Colors (blue, #04a3f9)
    • Booleans (true or false)
    • Nulls (null)
    • List of values, separated by space or commas (1.5em, Arial, Helvetica)
    • Maps from one value to another ( (key 1: value1, key 2: Value 2) )