![](/img/trans.png)
[英]Failed to deploy Rails app with gem bootstrap-sass 3.0.3.0 on heroku
[英]Including css components of bootstrap-sass gem in rails app
我在包含gem'bootstrap gem 'bootstrap-sass'
Gemfile中,以及在app/assets/stylesheets/custom.css.scss
中,位於頂部的@import "bootstrap";
但這包括引導的所有css膨脹css文件的下載大小。 有沒有辦法只包含我正在使用的引導程序的css組件?
導入“ bootstrap”樣式時,實際上是從gem導入此文件: bootstrap.scss
如您所見,它僅導入其他文件,因此可以替換: @import "bootstrap";
與:
// Core variables and mixins
@import "bootstrap/variables"; // Modify this for custom colors, font-sizes, etc
@import "bootstrap/mixins";
// …
// Components: common
@import "bootstrap/sprites";
@import "bootstrap/dropdowns";
嘗試使用縮小的CSS代碼。 同樣,當您導入引導文件時,它也會全部導入,為什么要使用自定義CSS文件時只想要CSS組件!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.