Search code examples
asp.netfirefoxcssmicrosoft-ajax-minifiercassette

Is it possible to deny minify one line (or region) in css file by Microsoft Ajax Minifier?


I started use Cassette library in our project. This library use Microsoft Ajax Minifier by default. I face problems breaking html layout on some pages only in firefox browser. I found that problem is related to CSS3 function calc(). The + and - operators must always be surrounded by whitespace in this function. I can redefine this properties somewhere out of this minify area but I don`t want to do that. I want to fix it inside file. Is it possible?


Solution

  • I found that using -moz- prefix for calc function leaves it untouched after minifier. Example:

    .some_class {
      width: calc(24.3% - 30px);
      width: -webkit-calc(24.3% - 30px);
      width: -moz-calc(24.3% - 30px);
    }
    

    Becomes:

    .some_class{width:calc(24.3%- 30px);width:-webkit-calc(24.3% - 30px);width:-moz-calc(24.3% - 30px)}