... | @@ -2,25 +2,6 @@ h1. Introduction |
... | @@ -2,25 +2,6 @@ h1. Introduction |
|
|
|
|
|
CSSEmbed is a simple utility to automate creation of CSS files with embedded data URIs. It can read in any CSS file, detect the image files referenced, and then replace them with data URIs. The result is a CSS file that is exactly the same as the original with the exception that all valid image files have been replaced with data URIs.
|
|
CSSEmbed is a simple utility to automate creation of CSS files with embedded data URIs. It can read in any CSS file, detect the image files referenced, and then replace them with data URIs. The result is a CSS file that is exactly the same as the original with the exception that all valid image files have been replaced with data URIs.
|
|
|
|
|
|
h1. Related Reading
|
|
|
|
|
|
|
|
h2. Posts About CSSEmbed
|
|
|
|
|
|
|
|
* "Automatic data URI embedding in CSS files":http://www.nczonline.net/blog/2009/11/03/automatic-data-uri-embedding-in-css-files/
|
|
|
|
* "Convert CSS images to data URIs automatically with CSSEmbed":http://www.ravelrumba.com/blog/convert-css-images-to-data-uris-automatically-with-cssembed/
|
|
|
|
* "CSSEmbed - automatically data: URI-ize":http://www.stevesouders.com/blog/2009/11/16/cssembed-automatically-data-uri-ize/
|
|
|
|
* " How to reduce the number of HTTP requests":http://robertnyman.com/2010/01/15/how-to-reduce-the-number-of-http-requests/
|
|
|
|
|
|
|
|
h2. Posts About Data URIs
|
|
|
|
|
|
|
|
* "Data URIs explained":http://www.nczonline.net/blog/2009/10/27/data-uris-explained/
|
|
|
|
* "Data URI browser issues":http://sharovatov.wordpress.com/2008/05/13/data-uri-browser-issues/
|
|
|
|
* "Data URI theory and practice":http://sharovatov.wordpress.com/2008/05/11/data-uri-theory-and-practice/
|
|
|
|
* "Data URLs - what are they and how to use them":http://phpied.com/data-urls-what-are-they-and-how-to-use
|
|
|
|
* "RFC-2397: The 'data' URL scheme":http://tools.ietf.org/html/rfc2397
|
|
|
|
* "MHTML – when you need data: URIs in IE7 and under":http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/
|
|
|
|
|
|
|
|
|
|
|
|
h1. Basic Usage
|
|
h1. Basic Usage
|
|
|
|
|
|
CSSEmbed is used as follows:
|
|
CSSEmbed is used as follows:
|
... | @@ -56,6 +37,14 @@ bc. java -jar cssembed-x.y.z.jar --root http://www.nczonline.net/images styles.c |
... | @@ -56,6 +37,14 @@ bc. java -jar cssembed-x.y.z.jar --root http://www.nczonline.net/images styles.c |
|
|
|
|
|
This causes all image URLs to be prepended with @http://www.nczonline.net/images@ before attempting resolution (this happens only for those URLs that don't already have "http://" at the beginning.
|
|
This causes all image URLs to be prepended with @http://www.nczonline.net/images@ before attempting resolution (this happens only for those URLs that don't already have "http://" at the beginning.
|
|
|
|
|
|
|
|
h1. Skipping Images
|
|
|
|
|
|
|
|
You can specify that an image should be skipped by adding a special comment after the image:
|
|
|
|
|
|
|
|
bc. background: url(foo.png); /*CSSEmbed:SKIP*/
|
|
|
|
|
|
|
|
This ensures that the given image will not be converted to a data URI regardless of command line settings.
|
|
|
|
|
|
h1. MHTML Support
|
|
h1. MHTML Support
|
|
|
|
|
|
Version 0.3.0 introduces initial support for generating MHTML CSS files (for more information on MHTML files, see "MHTML - when you need data: URIs in IE7 and under":http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/). When you specify the @--mhtml@ option, this puts CSSEmbed into MHTML mode and the resulting CSS file is generated for use with Internet Explorer 7 and lower using the format specified in the linked article.
|
|
Version 0.3.0 introduces initial support for generating MHTML CSS files (for more information on MHTML files, see "MHTML - when you need data: URIs in IE7 and under":http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/). When you specify the @--mhtml@ option, this puts CSSEmbed into MHTML mode and the resulting CSS file is generated for use with Internet Explorer 7 and lower using the format specified in the linked article.
|
... | @@ -90,6 +79,25 @@ at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) |
... | @@ -90,6 +79,25 @@ at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) |
|
|
|
|
|
p. This means that you're attempting to run CSSEmbed on an earlier version of the JVM. CSSEmbed requires Java 1.5 to execute.
|
|
p. This means that you're attempting to run CSSEmbed on an earlier version of the JVM. CSSEmbed requires Java 1.5 to execute.
|
|
|
|
|
|
|
|
h1. Related Reading
|
|
|
|
|
|
|
|
h2. Posts About CSSEmbed
|
|
|
|
|
|
|
|
* "Automatic data URI embedding in CSS files":http://www.nczonline.net/blog/2009/11/03/automatic-data-uri-embedding-in-css-files/
|
|
|
|
* "Convert CSS images to data URIs automatically with CSSEmbed":http://www.ravelrumba.com/blog/convert-css-images-to-data-uris-automatically-with-cssembed/
|
|
|
|
* "CSSEmbed - automatically data: URI-ize":http://www.stevesouders.com/blog/2009/11/16/cssembed-automatically-data-uri-ize/
|
|
|
|
* " How to reduce the number of HTTP requests":http://robertnyman.com/2010/01/15/how-to-reduce-the-number-of-http-requests/
|
|
|
|
|
|
|
|
h2. Posts About Data URIs
|
|
|
|
|
|
|
|
* "Data URIs explained":http://www.nczonline.net/blog/2009/10/27/data-uris-explained/
|
|
|
|
* "Data URI browser issues":http://sharovatov.wordpress.com/2008/05/13/data-uri-browser-issues/
|
|
|
|
* "Data URI theory and practice":http://sharovatov.wordpress.com/2008/05/11/data-uri-theory-and-practice/
|
|
|
|
* "Data URLs - what are they and how to use them":http://phpied.com/data-urls-what-are-they-and-how-to-use
|
|
|
|
* "RFC-2397: The 'data' URL scheme":http://tools.ietf.org/html/rfc2397
|
|
|
|
* "MHTML – when you need data: URIs in IE7 and under":http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/
|
|
|
|
|
|
|
|
|
|
h1. Copyright and License
|
|
h1. Copyright and License
|
|
|
|
|
|
Copyright (C) 2009 Nicholas C. Zakas. All rights reserved.
|
|
Copyright (C) 2009 Nicholas C. Zakas. All rights reserved.
|
... | | ... | |