Top 50 Syntactically Awesome Style Sheets (SASS) Interview Questions You Must Prepare 27.Jul.2024

Q1. What Are Boolean Operations?

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

Q2. What Is Import Directive?

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

Q3. Why To Use Sass?

  • 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.

Q4. What Are Advantages Of Sass?

  • 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.

Q5. Mention The Two Types Of Mixin Arguments?

There are two types of mixin arguments:

  • Keyword Arguments
  • Variable Arguments

Q6. What Is Nested Css Style?

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

Q7. What Is Variable Defaults?

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.

Q8. What Are Mixin Arguments?

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.

Q9. List Out Some Features Of Sass?

  • 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.

Q10. What Is

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

Q11. What Are The Css Specifications For Character Encoding Of Stylesheets?

  • 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-@
  • 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.

Q12. How To Write Placeholder Selector In Sass?

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

Q13. What Are Number Operations?

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

Q14. Mention The Different Types Of Operations On The Sass?

There are 5 types of operations:

  • Number Operations
  • Color Operations
  • String Operations
  • Boolean Operations
  • List Operations

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

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

Q16. What Are Nested Rules In Sass?

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.

Q17. What Is

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

Q18. How To Refer Parent Selector In The Sass?

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

Q19. What Is Compact Css Style?

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

Q20. What Are Color Operations?

It allows using color components along with arithmetic operations.

Q21. What Are Parentheses In Sass?

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.

Q22. What Is

It displays the SassScript expression value as fatal error.

Q23. What Is Sass Output Style?

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.

Q24. In How Many Ways You Can Declare Css Properties?

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.

Q25. What Is Sass?

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.

Q26. What Is Expanded Css Style?

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

Q27. What Is

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

Q28. What Is Shorthand For Writing

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

Q29. What Are Comments In Sass?

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

Q30. What Are Disadvantages Of Sass?

  • 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.

Q31. What Is Interpolation In Sass?

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

Q32. What Are Function Directive?

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

Q33. What Is

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

Q34. What Is Media Directive?

It set style rule to different media types.

Q35. What Are The Data Types That Is Supported By Sassscript?

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) )

Q36. What Is

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

Q37. In How Many Ways You Can Use The Sass?

You can use SASS in three different ways:

  • As a command line tool
  • As a Ruby module
  • As a plugin for Rack enable framework

Q38. What Is

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.

Q39. What Is At-root Directive?

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

Q40. What Are Key Features Of Sass Indented Syntax?

  • 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.

Q41. What Is Compressed Css Style?

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.

Q42. What Is Extend Directive?

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.

Q43. What Are Keyword Arguments?

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.

Q44. What Are Variable Arguments?

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

Q45. Name The Two Syntaxes Supported By Sass?

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.

Q46. What Is Interactive Shell?

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

Q47. Which Command Is Used To Run Sass Code From The Command Line?

sass input.scss output.css

Q48. How Many Types Are There In Comments?

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.

Q49. What Is

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

Q50. What Are List Operations?

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