美文网首页
Stylus预处理器简介(七)内置方法8

Stylus预处理器简介(七)内置方法8

作者: 曲昶光 | 来源:发表于2021-07-21 14:06 被阅读0次

控制台方法

warn(msg)

警告给定的错误' msg '。不退出。

warn("oh noes!")

error(msg)

使用给定的错误' msg '退出Stylus。

add(a, b)
  unless a is a 'unit' and b is a 'unit'
    error('add() expects units')
  a + b

p(expr)

检查给定的' expr ':

fonts = Arial, sans-serif
p('test')
p(123)
p((1 2 3))
p(fonts)
p(#fff)
p(rgba(0,0,0,0.2))

add(a, b)
  a + b

p(add)

标准输出:

inspect: "test"
inspect: 123
inspect: 1 2 3
inspect: Arial, sans-serif
inspect: #fff
inspect: rgba(0,0,0,0.2)
inspect: add(a, b)

相关文章

网友评论

      本文标题:Stylus预处理器简介(七)内置方法8

      本文链接:https://www.haomeiwen.com/subject/axwvpltx.html