0

I have a Django application with which I am using the django-pipeline package and bootstrap.css:

PIPELINE_CSS = {
'myCSS': {
    'source_filenames': (
        'css/bootstrap.css',
        'css/bootstrapoverride.css',

    ),
    'output_filename': 'bootmin.css',
    'variant': 'datauri',
},

}

As you can see above I have included an additional file "bootstrapoverride.css" which I was hoping to use to override some features of Bootstrap, for instance in my override file:

.navbar {
min-height: 100px;
        }

So I thought this may work, but no override is happening, maybe this is not possible using pipeline. I would like to avoid editing the bootstrap.css file directly. Thank you for any insight here.

McVenco
  • 1,011
  • 1
  • 17
  • 30
Dennis
  • 401
  • 5
  • 17

1 Answers1

1

You can do this, but I would set your project up a bit differently. I would have a vendor bundle and and a separate company or project specific bundle.

An example would look something like this;

PIPELINE_CSS = {
'vendor': {
    'source_filenames': (
        'css/bootstrap.css',

    ),
    'output_filename': 'vendor.css',
    'variant': 'datauri',
},
'project': {
    'source_filenames': (
        'css/bootstrapoverride.css',

    ),
    'output_filename': 'project.css',
    'variant': 'datauri',
},
}

And then include them in this order in your base.html file:

{% stylesheet 'vendor' %}
{% stylesheet 'project' %}
josephmisiti
  • 9,862
  • 11
  • 56
  • 72
  • @josephmisti Thank you for the reply, really good suggestion; however I am not seeing an override. I noticed that in the console I am not seeing bootstrapoverride.css in a GET like the other assets. Any thoughts on this? – Dennis Oct 13 '15 at 19:40
  • This works, however for whatever reason I had to rename my project file from bootstrapoverride.css to "myAppStyleSheet.css" *or whatever you want to call it. Not sure if there was some sort of collision with the "bootstrap" prefix, I do not know enough about how django-pipeline works. Thank you Joseph – Dennis Oct 13 '15 at 21:46
  • 1
    django-pipeline is pretty confusing but once you get the hang of it - it is much better than the alternatives (jammit,etc). no problem - give me an upvote :) – josephmisiti Oct 14 '15 at 22:36