2016-10-11 106 views
0

我決定開始學習青菜,但我仍然在掙扎了一下對我的PC.I下載運行青菜和已經安裝了的圖片顯示:如何觀看SASS文件

enter image description here

enter image description here

我擁有該項目的文件夾位於xampp文件夾中的htdocs文件夾內。 我在命令行輸入了C:\ Users \ Thulani> sass --watch C:\ xampp \ htdocs \ ruby​​ \ lib \ sass \ style.scss:style.css,但它只能說sass正在監視更改。

enter image description here

如何,實際上可以在我的style.scss的變化,看到這些變化?

這裏我的html:

<html> 
<head> 
    <title> Import example of sass</title> 
    <link rel="stylesheet" type="text/css" href="style.css"/> 
</head> 
<body> 
    <h1>Simple Example</h1> 
    <h3>Welcome to TutorialsPoint</h3> 
</body> 
</html> 

請幫

+0

你試過更改您的style.scss?如果您正在運行'--watch'任務,則對輸入所做的任何更改都將被編譯並輸出到您選擇的目標。 http://sass-lang.com/documentation/file.SASS_REFERENCE.html#using_sass – imjared

+0

是的,我嘗試改變style.scss上的內容,但沒有任何反應 –

回答

0

從你給我只能說,也許你已經不實際調用從你的CSS文件中的任何class和id的錯誤是什麼。如果您也可以上傳這些內容,本來會很好,但是我會推測您只試圖設計<h1><h3>元素。既然你是新手,我會給你寫一些應該運行的非常簡單的測試代碼。

這裏是我的HTML文件:

<!DOCTYPE html> 
    <html lang="en-GB"> 
    <head> 
    <meta charset="utf-8"> 
    <meta name="description" content=""> 
    <meta name="keywords" content=""> 
    <meta name="viewport" content="initial-scale=1"> 

    <title>Test</title> 

    <link type="text/css" rel="stylesheet" href="style.css"/> 
</head> 
<body> 
    <div id="red"> 
     <h1>I am red !</h1> 
    </div> 
    <div id="blue"> 
     <h2>I am blue</h2> 
    </div> 
    </body> 

我SCSS文件:

//@import "Filename"; 
// use import if you want to link two or more style sheets together (makes one big css file) 

/* Colours used */ 
$red: red; 
$blue: blue; 

html, body{ 
    width: 100%; 
    overflow-x:hidden; 
    margin: 0; 
    padding: 0; 
} 
body { 
    background-color: white; 
    font-family: sans-serif; 
} 
#red { 
    color: $red; 
} 
#blue { 
    color: $blue; 
} 

SCSS to CSS conversion test pass

1

使用此命令你想要觀看的文件夾中。

sass -w src/assets 

,如果你不想地圖文件可以使用這個

sass -w src/assets --sourcemap=none