Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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';