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

. Inside the @for rule, create a rule that passes the $i variable as the modifier in the .grid__col--selector.

. Inside the @for rule, create a rule that passes the $i variable as the modifier in the .grid__col--selector. I don't understand what I need to put at // code here

div {
  background-color: green;
}

$cols    : 10;
$width   : 50px;
$gutter  : 15px;
$context : ($width * $cols) + ($gutter * ($cols - 1));


  @for $i from 1 through $cols {
   .grid__col&--#($1) {
    // code here
   }
  }
style.scss
div {
  background-color: green;
}

$cols    : 10;
$width   : 50px;
$gutter  : 15px;
$context : ($width * $cols) + ($gutter * ($cols - 1));


  @for $i from 1 through $cols {
   .grid__col&--#($1) {

   }
  }

2 Answers

Steven Parker
Steven Parker
231,275 Points

It looks like you have a few issues:

  • you probably meant to write $i (letter "i"), but you have $1 (number 1)
  • you have a stray ampersand (&) on the line
  • you wrapped your variable in parenheses () instead of braces {}

Hi Steven! wow, my bad. Thanks for the help