SASS - beginner (small doubt)

2

Hello! I'm learning SASS and I came across a problem that was supposed to be simple. heehehe.

This is not compiling:

$purple: #9b0aa8;

#fofo{
  width:40px;
  height:40px;
  background: $purple;
}

#fofo:hover{
  @include transform(translateY(50%), scale(0.5));
}
<div id="fofo"></div>

It presents prblema in the line:

'@include transform(translateY(50%), scale(0.5));'

saying:

  stdin 10:3  root stylesheet on line 10 at column 3

Any ideas? It seems all right for me. = //

    
asked by anonymous 05.11.2018 / 12:59

1 answer

3

I believe that first you should create your @mixin, and then do the @include as you can consult in the guide: link

This way:

$purple: #9b0aa8;

@mixin transform($property, $propertyx) {
  transform: $property, $propertyx;
}

#fofo{
  width:40px;
  height:40px;
  background: $purple;
}

#fofo:hover{
  @include transform(rotate(30deg), scale(0.5));
}

You can test here that you will see that it will compile correctly link

    
05.11.2018 / 13:13