I'm attempting to reverse the row layout for every 2nd child using Bourbon Neat reset-layout-direction
mixin. However, this does not seem to be working using the nth-child pseudo selector. What am I doing wrong? Here is the codepen
HTML
<div class="boxes">
<div class="project">
<div class="project__image">image</div>
<div class="project__text">text</div>
</div>
<div class="project">
<div class="project__image">image</div>
<div class="project__text">text</div>
</div>
<div class="project">
<div class="project__image">image</div>
<div class="project__text">text</div>
</div>
<div class="project">
<div class="project__image">image</div>
<div class="project__text">text</div>
</div>
</div>
SCSS
.project{
@include row();
//@include row($direction: RTL); //Works here and rightly reverses all rows.
.project__image, .project__text {
background: tint(red,50%);
margin-bottom: 20px;
height: 130px;
@include span-columns(3 of 6);
@include omega(2n);
}
&:nth-child(2n + 2){
color: red;
//@include row($direction: RTL); Doesn't work here
}
}
Edit: I've come up with this solution but its just silly. I shouldnt need to repeat styles in this way - Codepen