Skip to content
This repository has been archived by the owner on Nov 16, 2018. It is now read-only.

Option to output data URIs to separate stylesheet #8

Closed
robflaherty opened this issue Nov 30, 2009 · 3 comments
Closed

Option to output data URIs to separate stylesheet #8

robflaherty opened this issue Nov 30, 2009 · 3 comments
Labels

Comments

@robflaherty
Copy link

An option to place all of the converted images in a separate stylesheet would be very useful. http://duris.ru/ does this, by default I believe. Isolating the data URIs helps keep the original CSS clean and maintainable, allows images to be cached separately from styles, and makes it easier to set up workarounds for IE6/7.

@nzakas
Copy link
Owner

nzakas commented Nov 30, 2009

I'm not sure I understand what you're asking for. Can you explain in more detail how you envision this working and what the use case is?

@robflaherty
Copy link
Author

Apologies. It may be beyond the scope of the project. Instead of embedding the data URIs in the main stylesheet, the background image declarations would be removed from the main stylesheet and recreated in a separate, dedicated data URI stylesheet.

Here's an example:
http://getpepperminted.com/dev2/css/data-uris.css

Placing the data URIs in a separate file provides the option of serving alternate content to non-supportive browsers. It also allows the main CSS and the data URIs to be cached separately, which can be useful.

@nzakas
Copy link
Owner

nzakas commented Nov 30, 2009

Ah I see, thanks for the explanation. I do think this is beyond the scope of what CSSEmbed should do, as it's a pretty specific use case and this tool was really intended to be general-purpose. If someone wanted to do that, what I'd probably recommend is that they create the core style sheet and the images style sheet, and then use CSSEmbed to create the data URI-based style sheet by processing the already-existing images one.

What you're asking for would require CSSEmbed to fully parse the CSS to determine which styles belong where, and that's far beyond the scope of what I envisioned this tool to be.

That being said, I could see another tool being built on CSSEmbed to do just that.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants