It's not chained class, but more a question about Cascading Order and Inheritance in CSS.
You have to know that in Cascading Style Sheets you have some reading priority.
The orders of your rules is very important.
In your example:
.a .c { color: red }
.b .c { color: green }
.c { color: blue }
<div class="a">
<div class="b">
<div class="c">
text
</div>
</div>
</div>
The last selector declaration will "always" take precedence, only
if their selector's lengths are equals. More your selector is
specific, more is his priority.
- The last one is
.c { color: blue }
(but the selector's length is only "2")
- Instead of
.a .c { color: red }
(that is "5")
- Then we can see that we have an another selector
.b .c
and .a .c
(but here .b .c
is the latest declared selector)
So
.b .c { color: green }
is applied.
Some others example to understand:
Here just for understand that the order is important:
.b .c { color: green }
.a .c { color: red }
.c { color: blue }
<div class="a">
<div class="b">
<div class="c">
text
</div>
</div>
</div>
Here for understand that length is important:
.b .c { color: green }
.a div.c { color: blue }
.a .c { color: red }
<div class="a">
<div class="b">
<div class="c">
text
</div>
</div>
</div>