sourcebitsllc / chocolatechip-ui

Mobile Web App Framework
www.chocolatechip-ui.com
MIT License
617 stars 88 forks source link

URL encoded SVGs get messed up by YUI compressor #27

Closed mholtzberg closed 10 years ago

mholtzberg commented 10 years ago

Hi,

the YUI compressor removes the whitespaces from the URL encoded SVGs which seems legitimate since whitespaces aren't allowed in URLs. What do you think about encoding them base64?

Max

sourcebits-robertbiggs commented 10 years ago

ChocolateChip-UI uses LESS for changing color values in the resulting CSS. Converting the SVGs to 64bit will disable that ability to change the colors of any SVG images. That said, I'm using CSSMin with Grunt to minify the CSS files. You can run it in the terminal to minify your files. Is your server automatically running YUI on the CSS files in your project when it serves it up? If so, I'd look at finding a way to disable that and use the default minified CSS files created with the build script. Please look at the README, and feel free to pop open the Gruntfile to see the various ways you can build the CSS from the LESS files.

You could do something like: // Build all three themes by process the LESS and minifying it: grunt less cssmin

By default grunt, and grunt chuijquery will build the complete framework along with minified CSS files.

mholtzberg commented 10 years ago

I'm using chui for a deeply embedded project with just a few kb of ROM (stm32f103), that's why I tried to squeeze it as much as possible. I think I will now go for CSSMin. Thank you for pointing me to this!

sourcebits-robertbiggs commented 10 years ago

Hey buddy,

So I looked at doing 64 bit encoding, that didn’t work. What I was able to do is do url encoding. That worked. Unfortunately, I could have any CSS animation code in the SVG that was url encoded, so I had to change the way the busy control works on iOS and Android. If you check out commit 0aa181025f you can see how the CSS is. I’m pretty sure this will solve the issue you were having with YUI compressor.

On Dec 12, 2013, at 1:15 PM, mholtzberg notifications@github.com wrote:

Hi,

the YUI compressor removes the whitespaces from the URL encoded SVGs which seems legitimate since whitespaces aren't allowed in URLs. What do you think about encoding them base64?

Max

— Reply to this email directly or view it on GitHub.

mholtzberg commented 10 years ago

Thank you, works like a charm!