Sass

Sass

Test your Sass knowledge with free quizzes on MyCodeSkills covering core concepts.


  1. What is Sass primarily used for?

    • Server-side rendering
    • JavaScript bundling
    • Extending CSS with features like variables and nesting
    • Creating HTML templates
  2. Which file extension is commonly used for SCSS syntax?

    • .css
    • .sass
    • .scss
    • .style
  3. What symbol is used to declare a variable in Sass?

    • $
    • #
    • @
    • %
  4. Which of the following is a valid variable declaration in Sass?

    • var-color = red;
    • color: red;
    • $color: red;
    • @color = red;
  5. What does nesting in Sass allow you to do?

    • Import other CSS files
    • Write JavaScript inside CSS
    • Structure selectors in a hierarchical manner
    • Combine HTML and CSS
  6. What is a mixin in Sass?

    • A way to nest selectors
    • A reusable block of styles with optional parameters
    • A method for rendering HTML
    • A directive for importing CSS
  7. Which keyword is used to define a mixin in Sass?

    • @mixin
    • @include
    • @use
    • @function
  8. How do you include a mixin in a selector?

    • @use mixin-name
    • @import mixin-name
    • @include mixin-name
    • @extend mixin-name
  9. What is the purpose of @extend in Sass?

    • To reuse a class's styles
    • To load external libraries
    • To include another file
    • To define a mixin
  10. Which placeholder selector is used with @extend?

    • #placeholder
    • .placeholder
    • @placeholder
    • %placeholder
  11. What is the primary benefit of the @use and @forward system in Sass?

    • Allows global variable access
    • Replaces the need for variables
    • Encourages modular, namespaced styles
    • Disables mixins
  12. Which statement correctly forwards mixins from one file to another?

    • @export mixins;
    • @forward 'mixins';
    • @use 'mixins';
    • @include 'mixins';
  13. What happens if you use @use 'file' multiple times in different files?

    • File is loaded multiple times
    • File is ignored
    • File is only loaded once
    • File is duplicated
  14. How can you access a variable from a module used via @use?

    • $variable
    • @variable
    • file.variable
    • file.$variable
  15. How do you make a variable available when forwarding a file?

    • @use with !default
    • @export variable
    • Add @forward and use show
    • Use @include variable