Question · JavaScript and React course · Module 7: Styling and Animations

SCSS Nesting Best Practices

What is the recommended maximum nesting depth for SCSS selectors?

Answer options

  • There is no limit - the deeper the nested selectors, the better organized the code
  • Maximum 3-4 levels to avoid overly specific selectors and hard-to-maintain CSS
  • Exactly 1 level - nesting is an anti-pattern in SCSS
  • Exactly 10 levels - that is what the SCSS compiler supports

You can check the correct answer by solving this task in the CodeWorlds game.