通過鮑爾安裝Materialise的,你應該能夠運行gulp
,看到Materialise的證據後,但也有我們需要解決的幾個問題:
The main
property of the Materialize project指向一個CSS文件和精縮JS文件,這兩個都不是理想的,我們會覆蓋它們。
上面的第一個問題也意味着,在運行gulp
後加載網站時,您會看到控制檯404s,因爲我們也需要重寫字體。
這是最後的bower.json
文件我結束了:
{
"name": "sage",
"homepage": "https://roots.io/sage/",
"authors": [
"Ben Word <[email protected]>"
],
"license": "MIT",
"private": true,
"dependencies": {
"materialize": "^0.97.7"
},
"overrides": {
"materialize": {
"main": [
"./dist/js/materialize.js",
"./sass/materialize.scss",
"./fonts/**/*"
]
}
}
}
$roboto-font-path: "../fonts/";
覆蓋可以改進,只使用您需要的單個SCSS組件而不是所有的人。 JS源代碼也是如此(儘管JS文件肯定需要包含在特定的順序中,其中有很多,而且我還沒有看到它們需要訂購的列表)。
編輯
如果你想加入JS文件單獨,我已經想通了的順序,只需提防依賴的,如果你刪除任何東西和測試徹底。
{
"name": "sage",
"homepage": "https://roots.io/sage/",
"authors": [
"Ben Word <[email protected]>"
],
"license": "MIT",
"private": true,
"dependencies": {
"materialize": "^0.97.7"
},
"overrides": {
"materialize": {
"main": [
"./js/initial.js",
"./js/jquery.easing.1.3.js",
"./js/animation.js",
"./js/velocity.min.js",
"./js/hammer.min.js",
"./js/jquery.hammer.js",
"./js/global.js",
"./js/collapsible.js",
"./js/dropdown.js",
"./js/leanModal.js",
"./js/materialbox.js",
"./js/parallax.js",
"./js/tabs.js",
"./js/tooltip.js",
"./js/waves.js",
"./js/toasts.js",
"./js/sideNav.js",
"./js/scrollspy.js",
"./js/forms.js",
"./js/slider.js",
"./js/cards.js",
"./js/chips.js",
"./js/pushpin.js",
"./js/buttons.js",
"./js/transitions.js",
"./js/scrollFire.js",
"./js/date_picker/picker.js",
"./js/date_picker/picker.date.js",
"./js/character_counter.js",
"./js/carousel.js",
"./sass/materialize.scss",
"./fonts/**/*"
]
}
}
}