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 Generating Column Classes

Rachel Lev
Rachel Lev
14,583 Points

why am I getting this error in the css output?

Error: Undefined variable: "$target".

@for $i from 1 through $g-col-count {
    $context: g-context($g-col-width, $g-col-count, $g-gutter-width) !global;
    $target: ($g-col-width * $i) + ($g-gutter-width * ($i - 1));
    .grid__col--#{$i} {
      width: percentage( $target / $context );
    }
  }

1 Answer

Everything looks fine, not sure why you would be getting an error, except that I am not sure what !global is used for. Guil doesn't have it in his code.