<万博manbetx平台> Sass注释: /* */ 和 //-万博manbetx平台

Sass注释: /* */ 和 //

完整的Sass中文文档翻译完成:https://www.762w6o.com/doc/sass/

翻译自Sass官方文档:

Sass 支持标准的CSS多行注释以/* */以及单行注释 //。在尽可能的情况下,多行注释会被保留在输出的CSS中,而单行注释会被删除。 例如:

/* This comment is
 * several lines long.
 * since it uses the CSS comment syntax,
 * it will appear in the CSS output. */
body { color: black; }

// These comments are only one line long each.
// They won't appear in the CSS output,
// since they use the single-line comment syntax.
a { color: green; }

编译为:

/* This comment is
 * several lines long.
 * since it uses the CSS comment syntax,
 * it will appear in the CSS output. */
body {
  color: black; }

a {
  color: green; }

如果多行注释的第一个字母是 !,那么注释总是会被保留到输出的CSS中,即使在压缩输出模式下。这可用于在你生成的CSS中添加版权声明。

使用插值语句 (interpolation) ,可以将变量值输出到多行注释中,例如:

$version: "1.2.3";
/* This CSS is generated by My Snazzy Framework version #{$version}. */

编译为:

/* This CSS is generated by My Snazzy Framework version 1.2.3. */
赞(0) 打赏
未经允许不得转载:万博manbetx平台 » Sass注释: /* */ 和 //

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏