我想从Bootstraop css中删除Bootstrap图标包,因为它太重了,我使用字体很棒。有没有办法删除它。
我使用web pack将scss文件编译为css。
我正在使用最新版本的bootstrap。我已经安装了bootstrap-sass
和@import "~bootstrap-sass/assets/stylesheets/bootstrap";
来导入bootstrap。
如果您需要任何进一步的信息,请发表评论。
答案 0 :(得分:2)
而不是导入bootstrap-sass/assets/stylesheets/bootstrap
只需创建一个自定义文件,即可导入没有像这样的字形图的文件
bootstrap-sass/assets/stylesheets/bootstrap
的内容是这样的,我对glyphicon导入的行进行了一些修改
// Core variables and mixins
@import "bootstrap/variables";
@import "bootstrap/mixins";
// Reset and dependencies
@import "bootstrap/normalize";
@import "bootstrap/print";
// Here is where the glyphicons are import
// I comment just this line and every thing will work like you want without the glyphicons
//@import "bootstrap/glyphicons";
// Core CSS
@import "bootstrap/scaffolding";
@import "bootstrap/type";
@import "bootstrap/code";
@import "bootstrap/grid";
@import "bootstrap/tables";
@import "bootstrap/forms";
@import "bootstrap/buttons";
// Components
@import "bootstrap/component-animations";
@import "bootstrap/dropdowns";
@import "bootstrap/button-groups";
@import "bootstrap/input-groups";
@import "bootstrap/navs";
@import "bootstrap/navbar";
@import "bootstrap/breadcrumbs";
@import "bootstrap/pagination";
@import "bootstrap/pager";
@import "bootstrap/labels";
@import "bootstrap/badges";
@import "bootstrap/jumbotron";
@import "bootstrap/thumbnails";
@import "bootstrap/alerts";
@import "bootstrap/progress-bars";
@import "bootstrap/media";
@import "bootstrap/list-group";
@import "bootstrap/panels";
@import "bootstrap/responsive-embed";
@import "bootstrap/wells";
@import "bootstrap/close";
// Components w/ JavaScript
@import "bootstrap/modals";
@import "bootstrap/tooltip";
@import "bootstrap/popovers";
@import "bootstrap/carousel";
// Utility classes
@import "bootstrap/utilities";
@import "bootstrap/responsive-utilities";
```