Open brgrz opened 11 years ago
What version of SquishIt are you using?
Can you post your CSS block before and after SquishIt rewrites the paths?
This is the correct block:
@font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?23384653');
src: url('../font/fontello.eot?23384653#iefix') format('embedded-opentype'),
url('../font/fontello.woff?23384653') format('woff'),
url('../font/fontello.ttf?23384653') format('truetype'),
url('../font/fontello.svg?23384653#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
And this is SquishIt minimized:
@font-face {
font-family: 'fontello';
src: url('fonts/font/fontello.eot?23384653');
src: url('fonts/font/fontello.eot?23384653#iefix') format('embedded-opentype'),url('fonts/font/fontello.woff?23384653') format('woff'),url('fonts/font/fontello.ttf?23384653') format('truetype'),url('fonts/font/fontello.svg?23384653#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
My fonts are at root/fonts and minimized css is stored to root/css, so it should still keep the leading ".." dots.
It also rewrites the codes from this
.icon-facebook-squared:before { content: '\e804'; } /* '' */
.icon-calendar:before { content: '\e801'; } /* '' */
to this
.icon-facebook-squared:before {
content: '';
}
.icon-calendar:before {
content: '';
}
What minifier are you using? I suspect that is what is squashing your special characters, I just wrote this test and it passes:
[Test]
public void WontEncodeSpecialCharacters()
{
var css = @".icon-facebook-squared:before { content: '\e804'; } /* '' */
.icon-calendar:before { content: '\e801'; } /* '' */";
var sourceFile = TestUtilities.PreparePath(@"C:\somepath\myFile.css");
var destinationFile = TestUtilities.PreparePath(@"C:\somepath\somesubpath\myRewrittenFile.css");
var result = CSSPathRewriter.RewriteCssPaths(destinationFile, sourceFile, css, null);
Assert.AreEqual(css, result);
}
On the subject of fonts, what is the original location of your source file prior to combination?
Were you able to get this working by switching minifiers?
Apparently SquishIt incorrectly handles the URLs below which already include cache busting param (the random number):
Request for the Fontello font returns 404 when using SquishIt (compilation debug=false in web.config).