jetheredge / SquishIt

Lets you *easily* bundle some css and javascript! Check out the Google group if you have questions!
http://groups.google.com/group/squishit
MIT License
459 stars 119 forks source link

Squishit ignores Bootstrap 3.3.0 stylesheet #304

Open peaeater opened 9 years ago

peaeater commented 9 years ago

In Bootstrap 3.3.0 a workaround for Mobile Safari is introduced for temporal inputs, then an "IE 11 hack" reverses the workaround. The latter produces styles like the following:

_:-ms-fullscreen,
:root input[type="date"],
_:-ms-fullscreen,
:root input[type="time"],
_:-ms-fullscreen,
:root input[type="datetime-local"],
_:-ms-fullscreen,
:root input[type="month"] {
  line-height: 1.42857143;
}

Squishit ignores the Bootstrap source stylesheet when this syntax is present. In my case I am calling Squishit in an ASP.NET MVC Razor view:

@SquishIt.Framework.Bundle.Css()
.Add("bootstrap-3.3.0.css")
.MvcRender("styles.css")

Commenting out the offending styles makes Squishit include the Bootstrap source again. Bootstrap 3.3.1 does not include the "IE 11 hack" with the naughty syntax, so upgrading Bootstrap is another way to avoid this issue.

AlexCuse commented 9 years ago

Can you try a couple things for me?

  1. Do other files show up in the combined output if included?
  2. Does it work if you use the null minifier? (call .WithMinifier() on the bundle)?

I'm assuming this is ajaxmin choking on your input CSS. I think using the YUI minifiers might help also.

peaeater commented 9 years ago
  1. Other files do show up in the combined output, yes.
  2. It works if I call .WithMinifier<NullMinifier>(), yes. Nothing gets compressed, of course.

Just for fun, I did try .WithMinifier<YuiMinifier>(), and that worked, so your surmise re ajaxmin seems correct.

AlexCuse commented 9 years ago

I would recommend using YUI for everything. The only reason AjaxMin is the default is because it has been for so long and I don't want to pull the rug out from under people in a release. You can call

Bundle.ConfigureDefaults()
    .UseYuiForCssMinification()
    .UseYuiForJsMinification();

in app_start and they will be used for every bundle in your app unless overridden on an individual bundle instance.

kipusoep commented 9 years ago

We had the same issue with responsivebp v4, thanks for the work-around :+1:

drewfreyling commented 9 years ago

This appears to be broader issue then if the maximum version of AjaxMin supplied with SquishIt causes issues with this and #313 E5-Shim.