2017-10-12 95 views
0

我想在我的sass文件中擴展boostrap類。我正在編輯我的雜誌,如example擴展bootstrap創建反應的應用程序

我已經將boostrap文件複製到我的/src文件夾中。

然而,使用這種簡單的例子:

@import "bootstrap/*"; 

.header{ 
    @extend .container; 
    background-color:red; 

} 

我得到的錯誤:

{ 「狀態」:1, 「文件」:「C:/網站/ mharrisweb - 終極版/src/sass/style.scss「, 」line「:1, 」column「:1, 」message「:」要導入的文件未找到或不可讀:bootstrap/。\ n父類型表:C:/ sites/mharrisweb-redux/src/sass/style.scss「, 」格式化「:」錯誤:導入未找到或無法讀取的文件:bootstrap/。\ n父類型表:C:/sites/mharrisweb-redux/src/sass/style.scss \ n在src/sass/style.scss \ N >> @import \ 「引導/ * \」; \ n^\ n」個 }

回答

1

如果你有這樣的文件結構:

src     
    bootstrap 
    sass 
    style.scss      

你應該使用:

@import "../bootstrap/scss/bootstrap"; 

如果您使用軟件包管理器(npm或紗線)安裝Bootstrap,可以使用:

@import "~bootstrap/scss/bootstrap";