【问题标题】:calc not working with stylus and gruntcalc 不适用于手写笔和 grunt
【发布时间】:2023-03-21 18:46:01
【问题描述】:

我遇到了一个小问题。 我正在尝试在手写笔中使用 calc 功能,但它不起作用。我总是给出错误的输出。我在 grunt 任务运行器中使用 grunt-contrib-stylus。

当我写 width: calc(100% - 100px); 时,生成为 width: calc(-300%);

我尝试了宽度:'calc(100% - 100px)';width: 'calc(100% \- 100px)';width: calc(100% \- 100px);,但没有成功。 也试过了:

calc(unquote('50% - 390px'))
calc(50% \- 390px)

给出的解决方案:https://github.com/stylus/stylus/issues/687 它给出了calc(0) 作为输出。

我的 package.json 包含“grunt-contrib-stylus”:“~0.9.0”。任何帮助将不胜感激。

【问题讨论】:

  • 这个width "calc(100% - 100px)";怎么样
  • 同样的结果。输出为: width: "calc(100% - 100px)";
  • 你试过width calc(100% - 100px)(没有冒号,没有分号)吗?

标签: css gruntjs stylus


【解决方案1】:

这是一个已知的手写笔问题。使用

calc(unquote('100% - 100px'))

https://github.com/stylus/stylus/issues/687

【讨论】:

  • 嗨,很抱歉,但我尝试了两种解决方案: calc(unquote('50% - 390px')) calc(50% \- 390px) 都给出 calc(0) 作为输出。
  • 我建议你在 grunt-contrib-stylus github 存储库中提出这个问题。
  • 是的,当然。我想我可能会得到一些解决方案。感谢@connexo 的建议
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-01-08
  • 2013-12-09
  • 1970-01-01
  • 1970-01-01
  • 2012-09-15
  • 2015-10-29
相关资源
最近更新 更多