I'm using SASS and would like to style an element when a particular child element has a specific class.
Here is a simplified version of my code:
<div class="classIWantToStyle">
...
<span class="displayErrorMessage">Error message</span>
</div>
Initially classIWantToStyle has a blue border, I want to change it to a red border if the span has the class displayErrorMessage. I need to be able to do this in SASS and not javascript or jQuery. The span will not always have this class present.
I need the border: red to be applied to the div when the span has the specified class, is this possible to do?