1

We are having a weird problem when publishing an asp.net MVC project. After publishing in Release mode, this CSS:

.appTitle {
    font-size: calc(1vw + 1vh - .1vmin) !important;
}

becomes this:

.appTitle {
    font-size: calc(1vw+ 1vh- .1vmin) !important;
}

The difference is in the spacing before the '+' and '-' signs. This absence of spaces is making the style not apply.

This does not happen when publishing in Debug mode.

The strange thing is, we have another project with almost identical CSS that does not do this when publishing.

So my question is: why is this happening, and what can I do to avoid it?

Aravind
  • 40,391
  • 16
  • 91
  • 110
Window
  • 1,377
  • 2
  • 13
  • 23
  • Some plugin is possibly minifying your CSS when you compile in release mode? – Zack Sep 28 '16 at 20:18
  • try clean solution, rebuild and publish again into a new location – Aravind Sep 28 '16 at 20:19
  • http://stackoverflow.com/questions/24823259/css-js-bundle-in-single-file-in-mvc-when-publish-with-release-option?rq=1 Guess this post will help you.. Check out! – Aravind Sep 28 '16 at 20:21
  • @Zack I thought about that, but the CSS on the other site is getting minified as well. – Window Sep 28 '16 at 20:24
  • @Aravind tried what you said, no luck – Window Sep 28 '16 at 20:24
  • @Aravind I looked at that post and tried the only suggestion that seemed like it would work and it didn't change anything. – Window Sep 28 '16 at 20:29
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/124466/discussion-between-aravind-and-hashtagnatty). – Aravind Sep 28 '16 at 20:31
  • is this CSS included via a bundle? – Neil N Sep 28 '16 at 20:34
  • @NeilN Yes, this is included via a bundle. – Window Sep 29 '16 at 11:57
  • The bundling process is probably the issue. You will likely have to include this CSS file directly or put this particular style in-line. – Neil N Sep 29 '16 at 12:47
  • @NeilN I was thinking that, but do you know why it does this? Is there some feature I can turn off in order to avoid it? The other site I mention above is bundled in the same fashion, yet it does not have this problem. I am going to try and mess with the bundle, see if changing the order in which the .CSS files are bundled will change anything. – Window Sep 29 '16 at 12:53

0 Answers0