手写笔错误:“可能是由于缩进而导致的”缩进,“是缩进”

问题描述 投票:0回答:2

手写笔代码:

Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height)
  width {$width}px
  height {$height}px
  background-position -{$positiveXCoordinate}px -{$positiveYCoordinate}px

错误:

   157| Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height)
   158|   width {$width}px
   159|   height {$height}px
   160|   background-position -{$positiveXCoordinate}px -{$positiveYCoordinate}px
   161| 
--------^

expected "indent", got "outdent"
  • 如果从文件中删除以上代码,错误将消失。
  • IDE自动将行添加到文件末尾(但是由于前面的子句,这似乎不是原因)
  • Stylus online也不编译。

我试图找到文件中的所有空格:

enter image description here

更新:实验

Works:

Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height)
  width 2px

expected "indent", got "outdent"失败:

Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height)
  width {$width}px

看上去行插值无效,我没有找到示例,在这种情况下如何插值。

css stylus
2个回答
0
投票

official doc处的信息不多...您可以尝试


0
投票

经过大量的实验,我使它起作用。并让Stylus感到有些失望。

© www.soinside.com 2019 - 2024. All rights reserved.