Skip to content

Commit 1ec1c88

Browse files
committed
Add more example for fallback color and more explanation for the goal of the Image Sprites section
1 parent d577859 commit 1ec1c88

2 files changed

Lines changed: 70 additions & 12 deletions

File tree

css3-images/Overview.html

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
<h1>CSS Image Values Module Level 3</h1>
1717

18-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 9 June 2009</h2>
18+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 24 June 2009</h2>
1919

2020
<dl>
2121
<dt>This version:</dt>
22-
<!-- <dd><a href="http://www.w3.org/TR/2009/CR-css3-images-20090609/">http://www.w3.org/TR/2009/CR-css3-images-20090609/</a></dd> -->
22+
<!-- <dd><a href="http://www.w3.org/TR/2009/CR-css3-images-20090624/">http://www.w3.org/TR/2009/CR-css3-images-20090624/</a></dd> -->
2323

2424
<dd><a
2525
href="http://dev.w3.org/csswg/css3-images/">http://dev.w3.org/csswg/css3-images/</a>
@@ -104,9 +104,8 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
104104
<li><a href="#image"><span class=secno>3 </span>The &lt;image&gt; value
105105
type</a>
106106

107-
<li><a href="##url"><span class=secno>4 </span>Simple Image References and
108-
Image Slices: the &lsquo;<code class=css>url()</code>&rsquo; notation</a>
109-
107+
<li><a href="##url"><span class=secno>4 </span>Image References and Image
108+
Slices: the &lsquo;<code class=css>url()</code>&rsquo; notation</a>
110109

111110
<li><a href="##image"><span class=secno>5 </span>Image Fallbacks: the
112111
&lsquo;<code class=css>image()</code>&rsquo; notation</a>
@@ -206,8 +205,8 @@ <h2 id=image><span class=secno>3 </span>The &lt;image&gt; value type</h2>
206205
rel=biblioentry>[CSS21]<!--{{!CSS21}}--></a>.
207206

208207
<div>
209-
<h2 id="#url"><span class=secno>4 </span>Simple Image References and
210-
Image Slices: the &lsquo;<code class=css>url()</code>&rsquo; notation</h2>
208+
<h2 id="#url"><span class=secno>4 </span>Image References and Image
209+
Slices: the &lsquo;<code class=css>url()</code>&rsquo; notation</h2>
211210

212211
<p>The simplest way to indicate an image is to reference an image file by
213212
URI. This is done with the <a
@@ -288,9 +287,22 @@ <h2 id="#image"><span class=secno>5 </span>Image Fallbacks: the
288287
single-color image with no intrinsic dimensions.
289288

290289
<div class=example>
291-
<p>Some examples:</p>
290+
<p>For example, the rule below would tell the UA to load &lsquo;<code
291+
class=css>wavy.svg</code>&rsquo; if it can; failing that to load
292+
&lsquo;<code class=css>wavy.png</code>&rsquo; and display it at 150dpi;
293+
failing that to display &lsquo;<code class=css>wavy.gif</code>&rsquo;;
294+
and finally, if none of the images can be loaded and displayed, to use
295+
the color &lsquo;<code class=css>blue</code>&rsquo; to create a
296+
dimensionless background image.
292297

293298
<pre>background-image: image(wavy.svg, 'wavy.png' 150dpi, "wavy.gif" or blue);</pre>
299+
300+
<p>The &lsquo;<code class=property>background-image</code>&rsquo;
301+
property specifies that dimensionless images must stretch to cover the
302+
entire background positioning area [[CSS3BACKGROUND]], so if none of
303+
the specified images can be displayed the background will be painted
304+
blue. As with any image, this fallback will be painted over the
305+
&lsquo;<code class=property>background-color</code>&rsquo; (if any).
294306
</div>
295307

296308
<p>If the URL for the image ends in a file extension (a period followed
@@ -308,6 +320,27 @@ <h2 id="#image"><span class=secno>5 </span>Image Fallbacks: the
308320
<div>
309321
<h2 id=image-sprites><span class=secno>6 </span>Image Sprites</h2>
310322

323+
<p>The image sprites syntax is different from image slices noted above.
324+
Image slice syntax allows you to specify the coordinates of a region in
325+
the image and use that as a standalone image, but all the coordinates
326+
must be specified inline. This is great for one-off cutouts, but becomes
327+
unnecessarily verbose when the slices fit into a grid structure. The
328+
goal of this section is to define a syntax that:
329+
330+
<ul>
331+
<li>Makes it easy to specify an image slice and swap it out in later
332+
subclass or :hover rules.
333+
334+
<li>Makes it easy to maintain a sprite image, so that adding or shifting
335+
sections of the image don't require crawling through and modifying the
336+
entire style sheet.
337+
338+
<li>Has straightforward handling of strict grids, but can also handle
339+
more irregular sprite organization.
340+
341+
<li>(Any other use cases/requirements?)
342+
</ul>
343+
311344
<div class=issue>
312345
<p>As yet unwritten. Discussions/proposals include:</p>
313346

css3-images/Overview.src.html

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ <h2 id="image">The &lt;image&gt; value type</h2>
112112
'background-image', 'list-style-image', 'cursor' properties [[!CSS21]].
113113

114114
<div>
115-
<h2 id="#url">Simple Image References and Image Slices: the ''url()'' notation</h2>
115+
<h2 id="#url">Image References and Image Slices: the ''url()'' notation</h2>
116116

117117
<p>The simplest way to indicate an image is to reference an image file
118118
by URI. This is done with the
@@ -178,9 +178,17 @@ <h2 id="#image">Image Fallbacks: the ''image()'' notation</h2>
178178
is treated as a single-color image with no intrinsic dimensions.
179179

180180
<div class="example">
181-
<p>Some examples:</p>
182-
183-
<pre>background-image: image(wavy.svg, 'wavy.png' 150dpi, "wavy.gif" or blue);</pre>
181+
<p>For example, the rule below would tell the UA to load ''wavy.svg'' if
182+
it can; failing that to load ''wavy.png'' and display it at 150dpi;
183+
failing that to display ''wavy.gif''; and finally, if none of the images
184+
can be loaded and displayed, to use the color ''blue'' to create a
185+
dimensionless background image.
186+
<pre>background-image: image(wavy.svg, 'wavy.png' 150dpi, "wavy.gif" or blue);</pre>
187+
<p>The 'background-image' property specifies that dimensionless images
188+
must stretch to cover the entire background positioning area
189+
[[CSS3BACKGROUND]], so if none of the specified images can be displayed
190+
the background will be painted blue. As with any image, this fallback
191+
will be painted over the 'background-color' (if any).
184192
</div>
185193

186194
<p>If the URL for the image ends in a file extension (a period followed by
@@ -196,6 +204,23 @@ <h2 id="#image">Image Fallbacks: the ''image()'' notation</h2>
196204
<div>
197205
<h2>Image Sprites</h2>
198206

207+
<p>The image sprites syntax is different from image slices noted above.
208+
Image slice syntax allows you to specify the coordinates of a region
209+
in the image and use that as a standalone image, but all the coordinates
210+
must be specified inline. This is great for one-off cutouts, but becomes
211+
unnecessarily verbose when the slices fit into a grid structure. The goal
212+
of this section is to define a syntax that:
213+
<ul>
214+
<li>Makes it easy to specify an image slice and swap it out in later
215+
subclass or :hover rules.
216+
<li>Makes it easy to maintain a sprite image, so that adding or shifting
217+
sections of the image don't require crawling through and modifying the
218+
entire style sheet.
219+
<li>Has straightforward handling of strict grids, but can also handle
220+
more irregular sprite organization.
221+
<li>(Any other use cases/requirements?)
222+
</ul>
223+
199224
<div class="issue">
200225
<p>As yet unwritten. Discussions/proposals include:</p>
201226
<ul>

0 commit comments

Comments
 (0)