Less

Less

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


  1. What is Less in web development?

    • A markup language
    • A JavaScript library
    • A CSS pre-processor
    • A browser extension
  2. What symbol is used to declare a variable in Less?

    • $
    • @
    • #
    • &
  3. How do you compile a .less file into CSS?

    • Run lessc filename.less
    • Use sass filename.less
    • Use compile filename.css
    • Save as .css
  4. Which of the following is a valid Less variable?

    • $color: red;
    • var color = red;
    • @color: red;
    • color = red;
  5. In Less, what does nesting allow you to do?

    • Add new elements
    • Combine JS with CSS
    • Write hierarchical selectors
    • Import JavaScript files
  6. How do you pass parameters to a mixin in Less?

    • Using $param syntax
    • With function()
    • By defining variables inside mixin
    • Using (@param) after mixin name
  7. What are "guarded mixins" in Less?

    • Mixins that are private
    • Mixins with conditions
    • Mixins without variables
    • Mixins that extend CSS
  8. Which of the following is a correct guard condition?

    • when (@color = red)
    • if @color == red
    • guard(@color == red)
    • when @color == red
  9. How do you define multiple mixins with the same name but different conditions?

    • Use overloaded mixins with when
    • Use function()
    • It's not allowed
    • Use IDs
  10. Which keyword is used to extend a selector in Less?

    • inherit
    • use
    • @extend
    • :extend
  11. What does recursion in Less typically use?

    • Loops
    • JavaScript
    • Self-invoking mixins
    • Conditional imports
  12. What is a common use of recursion in Less?

    • Repeating animations
    • Creating loops
    • Importing files
    • Nesting media queries
  13. How do you implement a loop in Less using recursion?

    • Use a for loop
    • Use while syntax
    • Use a mixin that calls itself with changed parameters
    • Use the loop() function
  14. How can you simulate a loop over a list in Less?

    • With a while directive
    • Using the each() function
    • Using forEach()
    • Using the do keyword
  15. What does each(@list, .mixin(@value)) do?

    • Assigns index to variable
    • Applies .mixin to each value in @list
    • Declares a mixin
    • Throws a syntax error