2014-05-12 40 views
-1

使用基金會5幾個小項目後,我想切換到Bootstrap 3的薩斯版本,但我卡在設置和無法找到互聯網上的「如何」...設置Bootsrap 3 Sass版本,不可能?

我已經下載安裝了bootstrap-sass-master,ruby和compass。 然後我用「指南針創建MyProject」的Ruby命令提示符。 然後,我將bootstrap-sass-master \ vendor \ assets中的所有內容複製到由羅盤創建的MyProject文件夾中。 然後,我使用來自bootstrap網站的模板中的代碼在該文件夾內創建了一個index.html。 這是頭的外觀:

<!DOCTYPE html> 
<html lang="en"> 
    <head> 
    <meta charset="utf-8"> 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <meta name="description" content=""> 
    <meta name="author" content=""> 
    <link rel="shortcut icon" href="../../assets/ico/favicon.ico"> 

    <title>Starter Template for Bootstrap</title> 

    <!-- Bootstrap core CSS --> 
    <link href="/stylesheets/screen.css" rel="stylesheet"> 

    <!-- Custom styles for this template --> 
    <link href="starter-template.css" rel="stylesheet"> 

    <!-- Just for debugging purposes. Don't actually copy this line! --> 
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]--> 

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> 
    <!--[if lt IE 9]> 
     <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> 
     <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> 
    <![endif]--> 
    </head> 

基本上我跟着這個兩歲的例子: http://webdesign.tutsplus.com/articles/quick-tip-working-with-sass-and-bootstrap--webdesign-9153

但我現在卡住了,因爲我沒有style.css的只是一個screen.css但withthat文件時,它不起作用... 我的index.html顯示沒有應用任何樣式。

你能幫我,我確定我做錯了什麼設置了一切......

回答

0

你必須第一件事情就是給一個接入點。

隨着指南針,你要編譯sass文件,最後,你會得到一個.css文件。

因此,可以說你的目標是有一個main.css文件。

你必須用指南針編譯它並提供這個。在main.scss上,你應該導入所有的引導scss。您需要調用bootstrap.scss,並且在那裏,該文件將負責導入所有需要的文件。 (手錶路由)

您可以控制您需要的人數。而且,請記住在自舉的底部編寫代碼,以便覆蓋它。

再看看_variables.scss,你修改bootstrap的地方。建議在導入引導程序之前創建另一個_variables.scss,以便引導程序將使用您的變量而不是默認的變量。

希望它有幫助。