I have a container (.homepage-section
) and inside this there could be up to three .widget
's. Depending on how many .widget
's there inside of .homepage-section
, I'd like the widths to change.
I've followed the approach outlined by Lea Verou (link) but with no success.
Here's the SASS function I've written (so far):
.widget {
@for $i from 1 through 3 {
&:first-of-type:nth-last-of-type(#{$i}),
&:first-of-type:nth-last-of-type(#{$i}) ~ .widget {
width: (1000px / #{$i});
}
}
}
http://codepen.io/anon/pen/BKwte