【问题标题】:Error "stack level too deep" when compiling sass with nested SUSY calls使用嵌套的 SUSY 调用编译 sass 时出现“堆栈级别太深”错误
【发布时间】:2014-09-30 03:06:26
【问题描述】:

每当我在@include with-layout(...) 内部调用@include span(...) 时,我都会在一个特定的.scss 文件中找到它,就像这样

@include with-layout(10 0 split){ div.header{ @包括跨度(10 个中的 8 个); } }

我收到以下错误:

error myFile.scss (org/jruby/RubyArray.java:2339:in `collect': stack level too deep)

这让我相信这些特定的嵌套属性会发生某种无限递归。有谁知道这应该如何解决,或者嵌套这些@include 语句的正确方法是什么?谢谢!

【问题讨论】:

  • 你确定它会在你嵌套它们的任何时候发生吗?我无法使用列出的代码重现您的问题。甚至 more deeply nested example 也适用于 Sassmeister。

标签: jruby susy-compass


【解决方案1】:

你能发布你的 mixin 定义吗?
我的猜测是您的 span mixin 包含一个 @content 指令,导致无限循环:

您的代码将 div.header {} 内容块应用于位于 with-layout mixin 中的所有 @content 指令,但如果每个 div.header {} 块通过 span mixin 包含一个 @content 指令,SASS 将继续替换每个 @content 指令div.header 包含 @content 指令等。

这可以通过从你的 span mixin 中删除 @content 指令来解决,或者定义一个不包含 @content 指令的新 span mixin。

【讨论】:

猜你喜欢
  • 2012-09-18
  • 2012-01-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-04-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多