The short story is that it's not possible to do what you want here. There's no CSS rule which is to "ignore some other rule". The only way around it is to write a more-specific CSS rule for the inner elements which reverts it to how it was before, which is a pain in the butt.
Take the example below:
<div class="red"> <!-- ignore the semantics, it's an example, yo! -->
<p class="blue">
Blue text blue text!
<span class="notBlue">this shouldn't be blue</span>
</p>
</div>
<div class="green">
<p class="blue">
Blue text!
<span class="notBlue">blah</span>
</p>
</div>
There's no way to make the .notBlue
class revert to the parent styling. The best you can do is this:
.red, .red .notBlue {
color: red;
}
.green, .green .notBlue {
color: green;
}