安装
快速入门
使用变量
嵌套CSS 规则
导入SASS文件
静默注释
混合器
使用选择器继承来精简CSS
小结
中文文档
特色功能
语法格式
使用 Sass
CSS 功能拓展
注释 /* */ 与 //
SassScript
@-Rules 与指令
控制指令
混合指令
函数指令
输出格式
拓展 Sass
注释 /* */ 与 // - Sass基础文档 - 笔下光年
网站首页
注释 /* */ 与 //
Sass 支持标准的 CSS 多行注释 `/* */`,以及单行注释 `//`,前者会 被完整输出到编译后的 CSS 文件中,而后者则不会,例如: ```sass /* 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; } ``` 编译为 ```sass /* 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 文件中,通常用于添加版权信息。 插值语句 (interpolation) 也可写进多行注释中输出变量值: ```sass $version: "1.2.3"; /* This CSS is generated by My Snazzy Framework version #{$version}. */ ``` 编译为 ```sass /* This CSS is generated by My Snazzy Framework version 1.2.3. */ ```
上一篇:
CSS 功能拓展
下一篇:
SassScript