css - Stylus error : "expected "indent", got "outd

触控笔代码:

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也不会编译它。

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

更新:实验

作品:

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

预期的“缩进”失败,得到“outdent”:

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

看起来插值是无效的,我没有找到示例,在这种情况下如何插值。

最佳答案

official doc 上的信息不多...你能试试吗

Sprite($positiveXCoordinate, $positiveYCoordinate, $width, $height)
  width: $width * 1px

关于css - Stylus error : "expected "indent", got "outdent",可能是因为插值无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61400155/

相关文章:

python - 使用(常量)参数保存/加载 Keras 模型

ruby-on-rails - URL 参数被转换为看似乱码的字符

java - 获取对 java LinkedList 中最近添加的节点的引用

c# - 找不到 Xamarin.Forms 资源文件

domain-driven-design - DDD : How to save the order

php - Drupal 8.8.5 上奇怪的文件/文件夹权限错误

vue.js - vue js项目中的动态站点地图生成器

asp.net-mvc - Azure 应用服务授权/简易身份验证与 ASP.NET 表单例份验证冲

javascript - Ajax 多重上传

python - 无法安装最新版本的 pandas (1.0.3)