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

SASS interpolation error

i'm experiencing an error in SASS where this code

Line 14: @mixin width-class($width){
Line 15:     .#{$width}{
Line 16:         width: $width + "%";
Line 17:     }
Line 18: }

is causing this error

error modules/_layout.scss (Line 15: Invalid CSS after ".": expected class name, was "1")

http://gyazo.com/ed5d7da163263f75f5e610e0e8234012

Can anyone help me with fixing this?

1 Answer

I think your problem here is simply that CSS class names can't start with a number.

This Stack Overflow question has a great answer on what is and isn't valid for CSS class selectors.

Thanks! :D