News for hackers. Stuff that matters.
Re:Data URIs make CSS sprites obsolete by benbeltran on Tuesday July 06, 2010 @12:42PM (#1491502)
Is anyone else but me worried about the legibility of the CSS with Data URIs? I mean, I can see how it can be useful, but I think the code is more readable with "spritesheet.png" than with: iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0 vr4MkhoXe0rZigAAAABJRU5ErkJggg==

Now if only there was a way to define a data URI in a similar manner to @font-face. Maybe @data-object or something like that.

Re:Data URIs make CSS sprites obsolete by chc on Tuesday July 06, 2010 @01:16PM (#1491612)
I certainly wouldn't write it inline in the CSS. I'd use a preprocessor to keep the style itself readable and have the base64 inserted for the deployment version.

I personally like Sass, but for this purpose CPP or a knocked-together Ruby script would be just as good.