Reputation: 9167
Currently I've got the following code in my BundleConfig.cs:
bundles.Add(new StyleBundle("~/Content/css").Include(
"~/Content/site.css",
"~/Content/ie8.css"
));
Obviously, I only want the "ie8.css" stylesheet to be displayed for IE8. I can do this quite easily by taking this out of my BundleConfig.cs file and adding the standard HTML tags to achieve this in my Layout Views.
However, I'm wondering if there's any way to achieve this same result in the BundleConfig.cs file and keep the file auto-minification? I'm guessing the code-behind doesn't know anything about the user's browser so it isn't possible, but figured I'd ask some of the experts out there!
Upvotes: 2
Views: 534
Reputation: 102
I've only got round this by adding custom css overriding the required styles in the normal was with the IF browser checks.
Upvotes: 0
Reputation: 427
I don't think the framework provides for variant based bundles. It is global all or nothing. You could make various bundles per browser.
Upvotes: 2