Search code examples
twitter-bootstrapwebpacksassglyphicons

remove bootstrap glyphicons from bootstrap css


I want to remove Bootstrap icon pack from the Bootstraop css because it is too heavy and I am using font awesome. Is there any way to remove it.

I am using web pack to compile scss files to css.

I am using the latest version of bootstrap. I have installed bootstrap-sass and @import "~bootstrap-sass/assets/stylesheets/bootstrap"; to import bootstrap.

If you require any further information please comment.


Solution

  • In stead of importing the bootstrap-sass/assets/stylesheets/bootstrap just create a custom file in whitch you import evrything without glyphicon like this

    Content of the bootstrap-sass/assets/stylesheets/bootstrap is like this and I put some modification on the line where glyphicon is import

    // 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";
    

    ```