neca neca - 4 months ago 35
Less Question

Can you increase specifity by nesting class inside of another class?

Would this

.subclass{ }

be same as


are there any diffrences apart from visual ones?

Answer Source

Nesting in SASS does exactly that. It increases specificity of the selector.

Play with this gist on SassMeister.

.class {
  .subclass {
    color: red;

compiles to:

.class .subclass {
  color: red;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download