Languages
[Edit]
EN

SCSS - nesting classes

0 points
Created by:
Vanessa-Drake
718

In this article, we would like to show you how to use nesting in SCSS.

Quick solution:

 

Practical example

Edit

In many cases classes are used as namespaces and they are being duplicated as follows:

To avoid situations like this, we can nest the styles inside the parent:

 

See also

Edit
  1. SCSS / SASS - installation

  2. SCSS - variable declaration

References

Edit
  1. Sass: Sass Basics

Alternative titles

  1. SCSS - class nesting example
  2. How to use nesting in SCSS?
  3. How to use nested classes in SCSS?
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join