Skip to content Skip to sidebar Skip to footer

Bundling Css Even If Using @import

I'm developing an application in C# and Asp.Net MVC. I have various css files one called base.css which I then import into other css files using @import rule as: @import url('base.

Solution 1:

Because the MVC Bundler creates an entirely new file in a potentially different location (see the full path in your bundle name), the location of those import statements now becomes inaccurate.

What you can do instead is to create a separate CSS file (or static declaration on your _Layout page that includes only those import statements), and include that outside of any bundle.

Post a Comment for "Bundling Css Even If Using @import"