Html 在Sass文件中创建mixin

Html 在Sass文件中创建mixin,html,css,sass,Html,Css,Sass,这是我的代码,我想在我的sass文件中创建mixin =shaping($height , $width, $rad, $bg, $color) height: $height width: $width -webkit-border-radius: $rad -moz-border-radius: $rad -ms-border-radius: $rad b

这是我的代码,我想在我的sass文件中创建mixin

=shaping($height , $width, $rad, $bg, $color)

height:                     $height

width:                      $width

-webkit-border-radius:      $rad

-moz-border-radius:         $rad

-ms-border-radius:          $rad

background-color:           $bg

border-radius:              $rad

color:                      $color
但是当我编译它时,它有这个错误,我不知道是什么问题,有人能帮我解决这些问题吗?是因为语法吗

错误:仅允许在规则、指令、mixin包含或其他属性中使用属性

=shaping($height, $width, $rad, $bg, $color)
  height: $height
  width: $width
  -webkit-border-radius: $rad
  -moz-border-radius: $rad
  -ms-border-radius: $rad
  border-radius: $rad
  background-color: $bg
  color: $color

.element
  +shaping(50px, 50px, 10px, #000, #fff) 
在选择器之后,给一个换行符。例如

.element
      +shaping

以下代码适用于我:

$brand-dark: #000
$brand-light: #fff

=shaping($height , $width, $rad, $bg, $color)
  height: $height
  width: $width
  -webkit-border-radius: $rad
  -moz-border-radius: $rad
  -ms-border-radius: $rad
  background-color: $bg
  border-radius: $rad
  color: $color

.box
  +shaping(120px, 100px, 10%, $brand-dark, $brand-light)

你是如何包含mixin的?我喜欢这个=>。thumb1+整形(120px,100px,10%,$brand dark,$brand light)include的语法不正确尝试添加
。thumb1{@include整形(120px,100px,10%,$brand dark,$brand light)}
你能告诉我为什么使用=符号创建mixin吗?这是sass中的有效语法吗?对于sass Mixsure,im使用此站点[link](),对于Mixin,您遵循哪个文档?它有一个简单的示例,用于=创建Mixin
=边界半径($border radius)
您是对的,但此语法适用于SCS,im使用sass,它有一个不同的语法,即Mixin以相等的标志线中断开始!!就是这样,谢谢。现在对我有用。这样一个愚蠢的错误也与断线有关。在
+成形之前,不要忘记2个空格或制表符。另外,如果这个问题能解决你的问题,就接受它。看来换行符在Sass中很重要,我会的,谢谢