prototype93
prototype93

Reputation: 25

Sass @mixin and @include compilation error

Here's my scss file

@mixin important-text {
 color: red;
  font-size: 25px;
  font-weight: bold;
  border: 1px solid blue;
}

.danger {
  @include: important-text;
  background-color: green;
}

After I compiled with koala I receive an error says -

Error: Invalid CSS after "  @include": expected identifier, was ": important-text;"
       on line 9 of C:\Users\

I have no idea where it did go wrong.

Upvotes: 0

Views: 399

Answers (2)

pl2ern4
pl2ern4

Reputation: 375

it should be@include mixin_name

danger {
 @include important-text;
 background-color: green;
}

reference

Upvotes: 1

Simplicius
Simplicius

Reputation: 2095

When including a mixin the : is unnecessary and will cause an error.

Instead:

@mixin mixin-name() {...}

@include mixin-name();

Upvotes: 0

Related Questions