Reputation: 139
Would this
.class{
.subclass{ }
}
be same as
.class{}
.subclass{}
are there any diffrences apart from visual ones?
Upvotes: 0
Views: 186
Reputation: 5003
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;
}
Upvotes: 3
Reputation: 1180
It does increase specificity.
.class {
.subclass{}
}
after being compiled into regular css is:
.class .subclass {
}
While your second example stays exactly the same after compiling.
Of course this only works if you are using SASS / LESS.
Upvotes: 1