亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

詳解CSS的Sass框架中代碼注釋的編寫方法

WEB前端開發(fā)   發(fā)布時間:2016-04-11 10:05:46   作者:愚人碼頭   我要評論
這篇文章主要介紹了CSS的Sass框架中代碼注釋的編寫方法,Sass完全支持CSS基本的單行注釋與多行注釋,需要的朋友可以參考下

在 Sass 中注釋有兩種方式:
1、類似 CSS 的注釋方式,使用 ”/* ”開頭,結屬使用 ”*/ ”
2、類似 JavaScript 的注釋方式,使用“//”
Sass 支持標準的CSS多行注釋以/* */以及單行注釋 //。

兩者區(qū)別:前者會在編譯出來的 CSS 顯示,后者在編譯出來的 CSS 中不會顯示

在盡可能的情況下,多行注釋會被保留在輸出的CSS中,而單行注釋會被刪除。 例如:

CSS Code復制內容到剪貼板
  1. /* This comment is  
  2.  * several lines long.  
  3.  * since it uses the CSS comment syntax,  
  4.  * it will appear in the CSS output. */  
  5. body { colorblack; }   
  6.     
  7. // These comments are only one line long each.   
  8. // They won't appear in the CSS output,   
  9. // since they use the single-line comment syntax.   
  10. a { colorgreen; }  

編譯為:

CSS Code復制內容到剪貼板
  1. /* This comment is  
  2.  * several lines long.  
  3.  * since it uses the CSS comment syntax,  
  4.  * it will appear in the CSS output. */  
  5. body {   
  6.   colorblack; }   
  7.     
  8. a {   
  9.   colorgreen; }  

如果多行注釋的第一個字母是 !,那么注釋總是會被保留到輸出的CSS中,即使在壓縮輸出模式下。這可用于在你生成的CSS中添加版權聲明。

使用插值語句 (interpolation) ,可以將變量值輸出到多行注釋中,例如:

CSS Code復制內容到剪貼板
  1. $version: "1.2.3";   
  2. /* This CSS is generated by My Snazzy Framework version #{$version}. */  

編譯為:

CSS Code復制內容到剪貼板
  1. /* This CSS is generated by My Snazzy Framework version 1.2.3. */  

相關文章

最新評論