CSS Overrides from Grails Twitter-Bootstrap Plugin

I have a Grails 2.2.1 application that uses the Twitter-Bootstrap plugin that provides the basic CSS and javascript elements of Bootstrap applications for Grails, as well as a lib tag and some other features.

The thing is, I want to use a custom CSS file that offers the colors of our company, and right now I can do this by pulling my own CSS from an application that overrides elements in the plugin's own bootstrap.css file, which means that the plugin first uploads its CSS file, and the application downloads it secondly. And these files are very large and heavy.

My users, especially on mobile devices, don’t need extra 125 kg CSS along with the extra processing that comes with executing each rule twice.

Failed to create my own version of the plugin, is there anything I can do that will prevent the bootstrap.css plugin boot file from getting to the webpage with my own boostrap.css file?

+5
source share
1 answer

The plugin uses resources to declare twitter boot files. Fortunately, resources have the option of overriding the definitions of declared modules.

So, in your ApplicationResources.groovy application, add:

modules = {
    overrides {
        'bootstrap-css' {
            resource id: 'bootstrap-css', url:'/css/mycustombootstrap.css'
        }
    } 
}
+12
source

All Articles