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 Basics Write Smart and Efficient CSS with Sass Separate Your Stylesheet Into Partials

Thomas Barkel
PLUS
Thomas Barkel
Courses Plus Student 7,222 Points

Partials not working

I'm getting errors in the console and the webpage is displaying incorrectly

Console errors:

  error scss/style.scss (Line 141: ".btn-callout" failed to @ext

The selector "%btn" was not found.
Use "@extend %btn !optional" if the extend should be able to fail.
)

Change detected to: scss/style.scss
write css/style.css
write css/style.css.map
New template detected: scss/partials/_main-styles.scss
Change detected to: scss/partials/_main-styles.scss
Change detected to: scss/style.scss
error scss/style.scss (Line 4: Invalid CSS after "...
": expected file to import (string or url()), was ";")
Change detected to: scss/style.scss
error scss/style.scss (Line 4: Invalid CSS after "...
": expected file to import (string or url()), was ";")

style.scss
// Partial imports
@import 'partials/variables',
        'partials/mixins',
        'partials/helpers',                    ;
        'partials/main-styles';
helpers.scss
%clearfix {
  &::after {
      content: '';
      display: table;
      clear: both;
    }
}

%btn {
  color: $white;
  display: inline-block;
  font-weight: bold;
  text-decoration: none;
  text-transform: uppercase;
  padding: 0.75em 1.5em;
  border-radius: 0.35em; 
  &:hover {
      color: $white;
      opacity: 0.8;
    }
  &:active {
      opacity: initial; 
    }

} 

1 Answer

Looks like you have a stray semi-colon after your helpers import:

// Partial imports
@import 'partials/variables',
        'partials/mixins',
        'partials/helpers',                    ;  /* <= here! */
        'partials/main-styles';