Skip to content

Commit

Permalink
Single image icons support; root-relative output directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jkphl committed Aug 22, 2013
1 parent 9c704df commit b6b53bf
Show file tree
Hide file tree
Showing 36 changed files with 439 additions and 93 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
Beta 3 (2013-08-22)
---------------------------

#### Bugs

1. Data URI Sass rules were created although not configured

#### Enhancements / Features

1. Added support for single image icon stylesheets
1. Added support for root-relative CSS directory


Beta 2 (2013-08-05)
---------------------------

Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ iconizr
=======
is an – at present: proof-of-concept – **command line tool** that helps you prepare your vector based SVG icons for use with the widest possible range of devices. It takes a [folder of SVG files](example/weather) and processes them to a bunch of files including

* possibly cleaned versions of the original **SVG icons**,
* cleaned versions of the original **SVG icons** (optional),
* a single compact **[SVG icon sprite](example/css/weather-16123200/weather-16123200.svg)**,
* single **PNG icons**,
* single **PNG icons** (optional),
* a combined **[PNG icon sprite](example/css/weather-16123200/weather-16123200.png)**,
* several **CSS files** with different formats inlcuding
* [SVG single image icons](example/css/weather-svg-single.css) (optional),
* [SVG data URIs](example/css/weather-svg-data.css),
* [SVG sprite references](example/css/weather-svg-sprite.css),
* [PNG single image icons](example/css/weather-png-single.css) (optional),
* [PNG data URIs](example/css/weather-png-data.css) and
* [PNG sprite references](example/css/weather-png-sprite.css),
* **[Sass variants](example/sass)** of these CSS files for easy inclusion into your Sass project,
Expand Down Expand Up @@ -93,6 +95,12 @@ Usage:
<td> </td>
<td>If given, iconizr will quantize PNG images (i.e. convert them to 8-bit color depth; please see the <a href="#requirements">requirements</a> for this). The quantized images are only used if they are smaller in file size than their the originals (and this is not necessarily the case for all PNG files). Quantization may also impact the visual image quality, so please make sure to compare the result to the original images.</td>
</tr>
<tr>
<td><code>-r</code></td>
<td><code>--root</code></td>
<td> </td>
<td>If given, iconizr will use the CSS output directory as root-relative path in the stylesheet loader HTML fragment (i.e. <code>/path/to/icons.css</code> instead of <code>path/to/icons.css</code>).</td>
</tr>
<tr>
<td> </td>
<td><code>--svg</code></td>
Expand Down Expand Up @@ -127,7 +135,7 @@ Usage:
<td><code>-k</code></td>
<td><code>--keep</code></td>
<td> </td>
<td>During the compilation of the SVG and PNG sprites, iconizr also creates intermediate SVG and PNG versions of each single icon. Usually, these intermediate files are deleted at the end of the compilation process. If you want to keep these files for some reason, just add this argument.</td>
<td>During the compilation of the SVG and PNG sprites, iconizr also creates intermediate SVG and PNG versions of each single icon. Usually, these intermediate files are deleted at the end of the compilation process. If you want to keep these files for some reason, just add this argument.<br/>In this case, also an additional set of stylesheets will be created (both CSS and/or Sass), which uses these single image icons (carrying the suffix <code>-single.html</code>). However, it is not recommended to use these stylesheets for production systems, and you should always prefer the CSS sprite or data URI variants for performance reasons. The single image icon stylesheets will also be ignored by the stylesheet loader JavaScript, but at least you will be able to select them explicitly using the icon kit preview documents.</td>
</tr>
<tr>
<td><code>-v</code></td>
Expand Down
2 changes: 1 addition & 1 deletion example/css/weather-loader-fragment.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<script>/* iconizr | https://github.com/jkphl/iconizr | © 2013 Joschi Kuphal | CC BY 3.0 */(function(){var a=window,b=a.document,c=arguments,d=function(a){var d=b.getElementsByTagName("script")[0],e=b.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=c[1*a|2*(b.createElementNS&&b.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"))],d.parentNode.insertBefore(e,d)},e=new a.Image;e.onerror=function(){d(0)},e.onload=function(){d(1===e.width&&1===e.height)},e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="})("css/weather-png-sprite.css","css/weather-png-data.css","css/weather-svg-sprite.css","css/weather-svg-data.css");</script><noscript><link href="css/weather-png-sprite.css" rel="stylesheet"></noscript>
<script type="text/javascript">/* iconizr | https://github.com/jkphl/iconizr | © 2013 Joschi Kuphal | CC BY 3.0 */(function(){var a=window,b=a.document,c=arguments,d=function(a){var d=b.getElementsByTagName("script")[0],e=b.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=c[1*a|2*(b.createElementNS&&b.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"))],d.parentNode.insertBefore(e,d)},e=new a.Image;e.onerror=function(){d(0)},e.onload=function(){d(1===e.width&&1===e.height)},e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=="})("/css/weather-png-sprite.css","/css/weather-png-data.css","/css/weather-svg-sprite.css","/css/weather-svg-data.css");</script><noscript><link href="css/weather-png-sprite.css" rel="stylesheet"></noscript>
1 change: 1 addition & 0 deletions example/css/weather-png-data-preview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><title>Icon kit preview | iconizr.com</title><link href="weather-png-data.css" rel="stylesheet" type="text/css"/><style type="text/css">@CHARSET "UTF-8";body{padding:0;margin:0;color:#666;background:#fafafa;font-family:Arial, Helvetica, sans-serif;font-size:1em;line-height:1.4}header{display:block;padding:3em 3em 2em 3em;background-color:#fff}header p{margin:2em 0 0 0}#logo{font-size:xx-large;font-size:3rem;padding:0;margin:0;height:53px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAA1CAMAAADMDSagAAAABGdBTUEAALGPC/xhBQAAADNQTFRFD3WVD3WVD3WVD3WVD3WVD3WVD3WVD3WVD3WVD3WVD3WVD3WVD3WVD3WVD3WVD3WVAAAA8Cs4JwAAABF0Uk5Tj2BQr89w3yAwn+8Qv4BA/wBvsGvcAAAFV0lEQVRo3tWb2aKrKgyGEZV5ev+nPRerqzIkAYW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3bAdPMzCGhesvzx1EP2l2D11aL/uillY44L1b8+zBg6rMMNVZ2fIgq05WDcEawKW7A5iy5zCOyelpruNXs6jZ2DdEawJWJdbmV7PftEZPPxtKc7AwgVLVtmjc7C6X3d41bHo+eEO9ogEaGwFLIYL1k6nZt6EpXrbm6469p3vhhL+KIfAsmIeFicEyy2FlS1hcD+0ptraZGePdjDM0E9LeQhLUoJ1rIW10SLU5k3RuQ68m+sQMK99CIuMsOJaWJkIMWpP3ls/AxoMZNEQqXRPYDEywloNa4u4xm9QFghhXpYgbuTgG/g5BYuTEZZcDSvP/CsSu5LdQUuswRrkmX9++LjimIAl6QgrPISV5ZSeCnUE499DyvwGBbKzFQ2CQ9OvZDa6DhJ7OcdhZTmlR373KAO9AxeANEQlyyltbs+02coxxmP3XAHO9k4+ZmULhZyX/lxL8N77XcD5RECucoxO+4AFW80bxNl0YBw7A+TCnTz+Jls5xihcRoK4EIBMns7yr99bn+TBV1DKYAsNRYD5+3uw0L/DDVi9CxOcest/cMOihsK/Cha5noUiv1y05VDpHqwi2Pp8WMOXvG43GBo932O+ANbo9cHbDcZGP78LVkr2bG6yavL8tL3JGvf+TVZ49ONDYPVuDufusOnfC0vGMd4/SFPXvj7W4HZRmPUyO67qlp/QDv37bfd/o0qpoArCXu0AAAAASUVORK5CYII=) center left no-repeat;white-space:nowrap;overflow:hidden;text-indent:100%}nav{font-size:.7em;display:block;width:100%;margin:0 0 2em 0}nav a{display:inline-block;text-decoration:none;margin-left:2em;color:#0f7595;white-space:nowrap}nav a:hover{text-decoration:underline}nav a.current{font-weight:bold;text-decoration:underline;color:#666}section{border-top:1px solid #eee;padding:2em 3em 0 3em}ul{margin:0;padding:0}li{display:inline;display:inline-block;background-color:#fff;position:relative;margin:0 2em 2em 0;vertical-align:top;border:1px solid #ccc;padding:1em 1em 3em 1em;cursor:default}.icon-box{margin:0;width:144px;height:144px;position:relative;background:#ccc url(data:image/gif;base64,R0lGODlhDAAMAIAAAMzMzP///yH/C1hNUCB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b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAAwADAAAAhaEH6mHmmzcgzJAUG/NVGrfOZ8YLlABADs=) top left repeat;border:1px solid #ccc;display:table-cell;vertical-align:middle;text-align:center}.icon{display:inline;display:inline-block}h2{margin:0;padding:0;font-size:1em;font-weight:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;position:absolute;left:1em;right:1em;bottom:1em}footer{display:block;margin:0;padding:0 3em 3em 3em}footer p{margin:0;font-size:.7em}footer a{color:#0f7595;margin-left:0}</style></head><body><header><h1 id="logo">iconizr</h1><p>These are the <strong>10 icons</strong> contained in your icon kit, along with their CSS class names.</p></header><section><nav>Icon type:<a href="weather-preview.html">Automatic detection</a><a href="weather-png-single-preview.html">PNG single images</a><a href="weather-png-sprite-preview.html">PNG sprite</a><a href="weather-png-data-preview.html" class="current">PNG data URIs</a><a href="weather-svg-single-preview.html">SVG single images</a><a href="weather-svg-sprite-preview.html">SVG sprite</a><a href="weather-svg-data-preview.html">SVG data URIs</a></nav><ul><li title="icon-weather-clear-night"><div class="icon-box"><div class="icon icon-weather-clear-night icon-weather-clear-night-dims"><!-- icon-weather-clear-night --></div></div><h2>icon-weather-clear-night</h2></li><li title="icon-weather-clear"><div class="icon-box"><div class="icon icon-weather-clear icon-weather-clear-dims"><!-- icon-weather-clear --></div></div><h2>icon-weather-clear</h2></li><li title="icon-weather-few-clouds-night"><div class="icon-box"><div class="icon icon-weather-few-clouds-night icon-weather-few-clouds-night-dims"><!-- icon-weather-few-clouds-night --></div></div><h2>icon-weather-few-clouds-night</h2></li><li title="icon-weather-few-clouds"><div class="icon-box"><div class="icon icon-weather-few-clouds icon-weather-few-clouds-dims"><!-- icon-weather-few-clouds --></div></div><h2>icon-weather-few-clouds</h2></li><li title="icon-weather-overcast"><div class="icon-box"><div class="icon icon-weather-overcast icon-weather-overcast-dims"><!-- icon-weather-overcast --></div></div><h2>icon-weather-overcast</h2></li><li title="icon-weather-severe-alert"><div class="icon-box"><div class="icon icon-weather-severe-alert icon-weather-severe-alert-dims"><!-- icon-weather-severe-alert --></div></div><h2>icon-weather-severe-alert</h2></li><li title="icon-weather-showers-scattered"><div class="icon-box"><div class="icon icon-weather-showers-scattered icon-weather-showers-scattered-dims"><!-- icon-weather-showers-scattered --></div></div><h2>icon-weather-showers-scattered</h2></li><li title="icon-weather-showers"><div class="icon-box"><div class="icon icon-weather-showers icon-weather-showers-dims"><!-- icon-weather-showers --></div></div><h2>icon-weather-showers</h2></li><li title="icon-weather-snow"><div class="icon-box"><div class="icon icon-weather-snow icon-weather-snow-dims"><!-- icon-weather-snow --></div></div><h2>icon-weather-snow</h2></li><li title="icon-weather-storm"><div class="icon-box"><div class="icon icon-weather-storm icon-weather-storm-dims"><!-- icon-weather-storm --></div></div><h2>icon-weather-storm</h2></li></ul></section><footer><p>Generated at Thu, 22 Aug 2013 15:05:22 GMT by <a href="http://iconizr.com" target="_blank">iconizr</a>.</p></footer></body></html>
Loading

0 comments on commit b6b53bf

Please sign in to comment.