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 CSS to Sass Refactoring with Sass Nesting Selectors

Erik Nuber
Erik Nuber
20,629 Points

Issue with Brackets allowing use of & in sass

I am using a combination of Scout and Brackets to run thru the lessons on CSS to Sass. with the following code, I get an error saying

Syntax error: Invalid CSS after " &": exptected "{", was "-heading { " followed by : "-heading" may only be used at the beginning of a selector.

.main {
    &-heading {  
      font-size: 5.625rem;
      color: rgba(255, 255, 255, 1);
      text-transform: uppercase;
      font-weight: normal;
      line-height: 1.3; 
      text-shadow: 0 1px 1px rgba(0,0,0,.8);
      margin: 12px 0 0;
    }

    &-title {
      color: white;
      font-size: 1.625rem;
      letter-spacing: .065em;
      font-weight: 200;
      border-bottom: 2px solid;
      padding-bottom: 10px;
    }
}

I have read a related question about Codekit with the answer being make sure your sass is updated. Within terminal I have checked an my computer is running the most current version of sass but, I do not know how to go about finding out if brackets runs its own version of sass, an older version of sass, or runs what is running on my computer. I did make sure to update brackets to the latest version. Also, the & replacement has been used elsewhere without causing and error.

If someone could please help it would be appreciated. I have been thru plenty of brackets documentation and can't figure out what I'm doing wrong.