Live data from Hacker News

Glue is a simple command line tool to generate CSS sprites

github.com

11–20 of 34 posts

Re: Glue is a simple command line tool to generate CSS sprites

#13
so I am actually wondering why you would even still use a spriting based approach. It seems as if a data-uri based approach would, for all uses I can think of, be more flexible and better, especially if you are using something like compass ( http://compass-style.org/reference/compass/helpers/inline-da... ). for more info:

http://www.nczonline.net/blog/2010/07/06/data-uris-make-css-...

this stack overflow answer brings up 2 possible drawbacks of a data-uri based approach: http://stackoverflow.com/a/3525961/897583 but it seems like if you are worried about your other css rules being blocked by your data-uri background-images, either put them in a css file that loads after your important rules, or just put them at the bottom of the css file. and it seems like with gzip the increase in size is negligible.

Re: Glue is a simple command line tool to generate CSS sprites

#14
post #12

I don't get the sprite thing. How is it better for optimization to load every single image of the website right away, and to reload the same picture when the image is modified?

For lots of tiny images like icons, you're often better off loading one 200kb image than 100 2kb images. HTTP requests have significant overhead.

Re: Glue is a simple command line tool to generate CSS sprites

#15

This makes no sense to me. It assumes that I'll attach the icon to it's own HTML element because it sets the width and height explicitly. Adding icons to your links won't work this way. Generating useful sprites is much harder than this guy thinks IMHO.

Sprites are used for a lot more than just adding icons to links.

Re: Glue is a simple command line tool to generate CSS sprites

#16

This makes no sense to me. It assumes that I'll attach the icon to it's own HTML element because it sets the width and height explicitly. Adding icons to your links won't work this way. Generating useful sprites is much harder than this guy thinks IMHO.

Sprites are used for a lot more than just adding icons to links.

Adding icons to links was just one example. If you're coding semantic correct HTML you very rarely have background images that are exactly the size of your HTML element. The way that glue generates sprites makes them only useful for when you're replacing img tags.

Re: Glue is a simple command line tool to generate CSS sprites

#17

so I am actually wondering why you would even still use a spriting based approach. It seems as if a data-uri based approach would, for all uses I can think of, be more flexible and better, especially if you are using something like compass ( http://compass-style.org/reference/compass/helpers/inline-da... ). for more info: http://www.nczonline.net/blog/2010/07/06/data-uris-make-css-... this stack overflow answer bring…

Caching is probably a good reason for using the sprite approach. Sprites are probably less dynamic than the HTML being generated, so the client will likely be able to just pull up the sprite from Cache.

Re: Glue is a simple command line tool to generate CSS sprites

#18

so I am actually wondering why you would even still use a spriting based approach. It seems as if a data-uri based approach would, for all uses I can think of, be more flexible and better, especially if you are using something like compass ( http://compass-style.org/reference/compass/helpers/inline-da... ). for more info: http://www.nczonline.net/blog/2010/07/06/data-uris-make-css-... this stack overflow answer bring…

You limit the number of connections necessary to download the sprites, you avoid having the client 'hickup' in when you show a new button and you only have to have on cache-hit.

Re: Glue is a simple command line tool to generate CSS sprites

#20

so I am actually wondering why you would even still use a spriting based approach. It seems as if a data-uri based approach would, for all uses I can think of, be more flexible and better, especially if you are using something like compass ( http://compass-style.org/reference/compass/helpers/inline-da... ). for more info: http://www.nczonline.net/blog/2010/07/06/data-uris-make-css-... this stack overflow answer bring…

IE7 doesn't support data-URIs. If you still support IE7 (it's not dead yet), sprites are still your friend. Not to mention, data in the css can get kind of unwieldy if you're encoding many or large images. Keeping it in a sprite keeps it tidy.
Post reply on HN