美文网首页
Stylus预处理器简介(九)注释

Stylus预处理器简介(九)注释

作者: 曲昶光 | 来源:发表于2021-07-23 09:27 被阅读0次

注释

Stylus 支持三种注释方式:单行注释、多行注释和多行缓冲注释。

单行注释

单行注释和 JavaScript 中的注释方式一样,不会输出到最终的 CSS 中:

// I'm a comment!
body
  padding 5px // some awesome padding

多行注释

多行注释看起来有点像 CSS 的常规注释。然而,它们只有在 compress 选项未启用的时候才会被输出。

/*
 * Adds the given numbers together.
 */

add(a, b)
  a + b

多行缓冲注释

/*! 开头的多行注释将被输出。这其实是告诉 Stylus 无论是否压缩(开启 compress 选项)都直接输出此注释。

/*!
 * Adds the given numbers together.
 */

add(a, b)
  a + b

相关文章

网友评论

      本文标题:Stylus预处理器简介(九)注释

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