Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Modular CSS with Sass Sass Grid System Sass Grid System Challenge

Mark Bojesen
Mark Bojesen
12,873 Points

Modular CSS with Sass: Missing rule that passes the $i variable as the modifier

Hi,

I am having trouble figuring out what rule I need to pass the $i variable in the loop?

Question follows: Next, we'll need to output selectors for the total number of columns. Inside the @for rule, create a rule that passes the $i variable as the modifier in the .grid__col-- selector.

Any help is much appreciated!

style.scss
div {
  background-color: green;
}

@for $cols from 1 through 10 {
//What rule am I missing here?
}

$cols    : 10;
$width   : 50px;
$gutter  : 15px;
$context : ($width * $cols) + ($gutter * ($cols - 1));
Mark Bojesen
Mark Bojesen
12,873 Points

Ahh, never mind. Worked it out.

@for $i from 1 through $cols {
  .grid__col--#{$i} {
  }
}