我正在使用 Mac 10.7.2、Ruby 1.9.3 和 SASS 3.2.1。我正在尝试在多级 CSS 之间获取多行注释和注释。我知道我们可以在 SASS 中实现多行注释,如下所示:
SASS
/*
Multiline
comments
goes here
CSS
/* Multiline
* comments
* goes here */
但是我在我的样式表中使用了不同的注释来突出/识别我的 CSS 中的多个级别和不同的东西,其中两个如下:
我的样式表以下面的评论开头:
/***************************************************************
Theme Name: Theme name goes here
Theme URI: Theme URL goes here
Description: Discription related to theme will goes here
Version: 1.1
Author: Author name goes here
Author URI: Authour url goes here
***************************************************************/
我的应用程序索引评论如下:
/*
---------------------------------------
---------------------------------------
--- Table of Contents: ---
--- ---
--- 1. HEADER ---
--- -1.1 Navigation Bar ---
--- ---
--- ---
--- 2. MAIN SECTION ---
--- -2.1 Home page ---
--- --2.1.1 Sections ---
--- ---2.1.1.1 sub section ---
--- ---
--- ---
--- 3. FOOTER ---
---------------------------------------
---------------------------------------
*/
我可以找到更接近它的评论,但无法将其完全作为编译后的 CSS 评论
SASS
/*
---------------------------------------
---------------------------------------
--- Table of Contents: ---
--- ---
--- 1. DEFAULT ELEMENTS ---
--- 2. LINKS ---
--- 3. TABLE ---
--- 4. FORM ---
--- 5. GLOBAL CLASSES ---
---------------------------------------
---------------------------------------
CSS
/* ---------------------------------------
* ---------------------------------------
* --- Table of Contents: ---
* --- ---
* --- 1. DEFAULT ELEMENTS ---
* --- 2. LINKS ---
* --- 3. TABLE ---
* --- 4. FORM ---
* --- 5. GLOBAL CLASSES ---
* ---------------------------------------
* --------------------------------------- */
还有一些时候我们需要多层次的评论
.firstLavel
background: #f00
/* comeent goes here before second level */
.secondLavel
font-size: 20
color: #ddd
/* comeent goes here before third level
.secondLavel
font-size: 70
color: #ded
但我得到了结果:
background: red;
/* comeent goes here before second level */
/* comeent goes here before third level */ }
.firstLavel .secondLavel {
font-size: 20;
color: #dddddd; }
.firstLavel .secondLavel {
font-size: 70;
color: #ddeedd; }
它应该是:
.firstLavel {
background: red; }
/* comment goes here before second level */
.firstLavel .secondLavel {
font-size: 20;
color: #dddddd; }
/* comment goes here before third level */
.firstLavel .secondLavel {
font-size: 70;
color: #ddeedd; }