<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Thoughts From Eric &#187; CSS</title>
	<atom:link href="http://meyerweb.com/eric/thoughts/category/tech/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://meyerweb.com/eric/thoughts</link>
	<description>Things that Eric A. Meyer, CSS expert, writes about on his personal Web site; it&#039;s largely Web standards and Web technology, but also various bits of culture, politics, personal observations, and other miscellaneous stuff</description>
	<lastBuildDate>Fri, 25 May 2012 13:41:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>A Precise CSS3 Color Table</title>
		<link>http://meyerweb.com/eric/thoughts/2012/05/18/aprecise-css3-color-table/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/05/18/aprecise-css3-color-table/#comments</comments>
		<pubDate>Fri, 18 May 2012 20:26:02 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1863</guid>
		<description><![CDATA[I couldn’t find the exact table of CSS colors that I wanted, so I created my own.  (Now with sorting!)]]></description>
			<content:encoded><![CDATA[<p>In the course of expanding my documentation of color values, I failed to find a table that listed all 147 SVG-and-CSS3-defined keywords along with the equivalent RGB decimal, RGB percent, HSL, hexadecimal, and (when valid) short-hex values.  There were some tables that listed some but not all of those value types, and one that listed all the value types (plus CMYK) along with a few hundred other keywords, but none that listed all of the CSS keywords and value types.  And none that I saw used precise values for the RGB percent and HSL types, preferring instead to round off at the expense of some subtle differences in color.</p>

<p>So I <a href="http://meyerweb.com/eric/css/colors/">created my own table, which you can now find</a> in <a href="http://meyerweb.com/eric/css/">the CSS area of meyerweb</a>.  Most of it is dynamically generated, taking a list of keywords and RGB decimal equivalents and then calculating the rest of the values from there.  The presentation is still a work in progress, and may change a little or a lot.  In particular, if I can’t find a better algorithm for determining which rows should have white text instead of black, I’ll probably shift away from the full-row background colors to some other presentation.  <ins>(Update: it’s been greatly improved, so I’m sticking with the full-row backgrounds.  For now, anyway.)</ins></p>

<p>My thanks to <a href="http://www.xanthir.com/">Tab Atkins</a> for his donation of the RGB-to-HSL routine I adapted as well as help improving the pick-light-or-dark-text algorithm; and to the people who responded positively on Twitter when I mused about the idea there.</p>

<p><strong>Update 25 May 12:</strong> the table now allows sorting (both directions) on the Keyword, RGB Decimal, and HSL columns.  The sorting and styling code uses methods like <code>el.classList.remove()</code> so it may not function well, or at all, in older versions of Internet Explorer.  The numeric sorts also appear to be borked in Opera and Chrome for no reason I can discern, and it’s not like I did anything fancy in the JavaScript—exactly the opposite, I’d wager.  (Speaking of which, I’m sure my JavaScript is an non-stop amateur-hour horrorshow.  I’m okay with that.  If you aren’t, you might want to avert your gaze.)  If there’s a simple fix that doesn’t screw up other browsers, like Safari and Firefox, I’m interested.  If not, then we’ll all just have to live with it.</p>

<p>As always: share and enjoy!</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/05/18/aprecise-css3-color-table/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Backgrounds, Shadows, Fonts, and the Cascade</title>
		<link>http://meyerweb.com/eric/thoughts/2012/05/16/background-shadows-fonts-and-the-cascade/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/05/16/background-shadows-fonts-and-the-cascade/#comments</comments>
		<pubDate>Wed, 16 May 2012 14:11:57 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1851</guid>
		<description><![CDATA[In the cascade, all other things being equal, the last one declared is the winner.  In backgrounds and shadows, the reverse is true.]]></description>
			<content:encoded><![CDATA[<p>The fact that this:</p>

<pre><code>h1 {color: red;}
h1 {color: green;}
</code></pre>

<p>…results in green <code>h1</code> text, but this:</p>

<pre><code>h1 {background:
	url(red-wave.gif) repeat,
	url(green-wave.gif) repeat;}
</code></pre>

<p>…results in a red wavy <code>h1</code> background does my head in <strong>every single time</strong>.  And it’s the same with text and box shadows, too!  In cases where backgrounds or shadows overlap, the <em>first</em> one you write “wins”, by virtue of being “in front of” the background images that are listed after it.</p>

<p>I know that font stacks are also done in order of most-to-least preferred, but I don’t see them as being equivalent.  The reason is that a font stack is a list of fallbacks—use this face unless it can’t render the glyph or doesn’t exist, in which case try the next one in the list, etc., etc.  Multiple background images and multiple shadows, on the other hand, are <strong>not</strong> a series of fallbacks.  I expect to see them all, unless I made a mistake of some kind; and I do, constantly, because of this disconnect.  Sure, one <em>could</em> use the multiple background image syntax to create a series of fallbacks—first an SVG file, second a PNG, third a GIF—but that’s not its primary purpose, and I certainly wouldn’t teach multiple background images that way.  That’s not what they’re designed to do.</p>

<p>Maybe writing the problem down here will purge this daemon, but in all honesty, my hopes are not terribly high.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/05/16/background-shadows-fonts-and-the-cascade/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Defining ‘ch’</title>
		<link>http://meyerweb.com/eric/thoughts/2012/05/15/defining-ch/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/05/15/defining-ch/#comments</comments>
		<pubDate>Tue, 15 May 2012 13:37:03 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1838</guid>
		<description><![CDATA[I’m working my way through a rewrite of Two Salmon (more on that anon), and I just recently came to the <code>ch</code> unit.]]></description>
			<content:encoded><![CDATA[<p>I’m working my way through a rewrite of Two Salmon (more on that anon), and I just recently came to the <code>ch</code> unit.  Its definition in <a href="http://w3.org/TR/2012/WD-css3-values-20120308/">the latest CSS Values and Units module</a> is as follows:</p>

<blockquote cite="http://w3.org/TR/2012/WD-css3-values-20120308/#ch-unit">
<dl>
<dt><dfn id=ch-unit title=ch>ch unit</dfn></dt>
<dd><p>Equal to the advance measure of the &#8220;0&#8243; (ZERO, U+0030) glyph found in the font used to render it.</p></dd>
</dl>
</blockquote>

<p>…and that’s it.  I had never heard the term “advance measure” before, and a bit of Googling for <kbd>font "advance measure"</kbd> only led me to copies of the CSS Values and Units module and some configuration files for <a href="https://www.panda3d.org/">the Panda 3D game engine</a>.  So I asked the editor and it turns out that “advance measure” is a CSS-ism that corresponds to the term “advance width”, which I had also never heard before but which yielded <em>way</em> more Google results.  Wikipedia’s <a href="http://en.wikipedia.org/wiki/Font">entry for “Font”</a> has this definition:</p>

<blockquote cite="http://en.wikipedia.org/wiki/Font#Metrics">
<p>Glyph-level metrics include … the advance width (the proper distance between the glyph&#8217;s initial pen position and the next glyph&#8217;s initial pen position)…</p>
</blockquote>

<p>My question for the font geeks in the room is this:  is that the generally accepted definition for “advance width”?  If not, is there a better definition out there; and if so, where?  I’d like to be able to recommend the best known definition for inclusion in the specification; or, if there’s no agreement as to the best, then at least a good one.  The Wikipedia definition certainly sounds good, assuming it’s accurate.  Is it?</p>

<p>In CSS terms, if I’ve understood things correctly, <code>1ch</code> is equal to the width of the character box for the glyph for “0”.  In other words, if I were to create a floated element with just a “0” and no whitespace between it and the element’s open and close tags, then the float’s width would be precisely <code>1ch</code>.  But that’s if I’ve understood things correctly.  If I haven’t, I hope I’ll be corrected soon!</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/05/15/defining-ch/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Vendor Tokens</title>
		<link>http://meyerweb.com/eric/thoughts/2012/05/08/vendor-tokens/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/05/08/vendor-tokens/#comments</comments>
		<pubDate>Tue, 08 May 2012 17:55:02 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1832</guid>
		<description><![CDATA[It may be that from the ashes of vendor prefixes will arise a new way forward.]]></description>
			<content:encoded><![CDATA[<p>It may be that from the ashes of vendor prefixes will arise a new way forward.  As <a href="http://lists.w3.org/Archives/Public/www-style/2012Apr/0797.html">proposed by François Remy</a>, vendor tokens would serve the same basic purpose as prefixes with a different syntactical approach, and with at east a couple of extra benefits.  Instead of prefixing properties, you’d instead add vendor tokens to the end of a single declaration, much as you do <code>!important</code> (which of course we <em>never ever</em> use, amirite?).</p>

<p>For example, you might write:</p>

<pre><code>border-radius: 1em !webkit-draft !moz-draft !o-draft;</code></pre>

<p>That’s it.  The prefixed alternative, of course, runs to multiple lines and has spawned a whole subindustry of framework plugins and mixins and what-all just to take the repetitive authoring burden off our shoulders.</p>

<p>I’ve been contemplating this proposal all morning, and perhaps not too surprisingly I’ve come down in favor of the idea.  I’m <a href="http://alistapart.com/articles/prefix-or-posthack">on record as being a fan of vendor prefixes</a>, but what I was truly a fan of was the capabilities they offer.  The syntax was never a core interest for me, and the ugliness was pretty apparent.  Vendor tokens are less tortuous, and even make it much simpler to build in versioning, like so:</p>

<pre><code>border-radius: 1em !webkit-draft-2 !moz-draft !o-draft;</code></pre>

<p>Not that I’m saying this proposal will or even should get to that point, but the ability is there and it feels cleaner than trying to do the same thing with prefixes.  I feel they ought to drop the <code>-draft</code> part of the tokens; just saying <code>!webkit !moz !o</code> or possibly <code>!x-webkit !x-moz !x-o</code> should be sufficient.  I’m also not a fan of the bang, but then I never have been, and I figure any token marker would suffice.  As before, it’s not the syntax I care about so much as the capabilities.</p>

<p>There is a discussion ongoing at <a href="http://lists.w3.org/Archives/Public/www-style/">www-style</a>, if you’re interested in adding your perspective or even just following along as various stakeholders thrash at the idea.  I’m cautiously optimistic.  It’s kind of a nice feeling!</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/05/08/vendor-tokens/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Linear Gradient Keywords</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/26/lineargradient-keywords/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/04/26/lineargradient-keywords/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 18:54:52 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1800</guid>
		<description><![CDATA[Linear gradients in CSS can lead to all kinds of wacky, wacky results—some of them, it sometimes seems, in the syntax itself.]]></description>
			<content:encoded><![CDATA[<p>Linear gradients in CSS can lead to all kinds of wacky, wacky results—some of them, it sometimes seems, in the syntax itself.</p>

<p>Let me note right up front that some of what I’m talking about here isn’t widely deployed yet, nor for that matter even truly set in stone.  Close, maybe, but there could still be changes.  Even if nothing actually does change, this isn’t a “news you can use <strong>RIGHT NOW</strong>” article.  Like so much of what I produce, it’s more of a stroll through a small corner of CSS, just to see what we might see.</p>

<p>For all their apparent complexity, linear gradients are pretty simple.  You define a direction along which the gradient progresses, and then list as many color stops as you like.  In doing so, you describe an image with text, sort of like SVG does.  That’s an important point to keep in mind:  a linear (or radial) gradient is an image, just as much as any GIF or PNG.  That means, among other things, that you can mix raster images and gradient images in the background of an element using the multiple background syntax.</p>

<p>But back to gradients.  Here’s a very simple gradient image:</p>

<pre><code>linear-gradient(45deg, red, blue)</code></pre>

<p>The <code>45deg</code> defines the <em>gradient line</em>, which is the line that defines how the gradient progresses.  The gradient line <strong>always</strong> passes through the center of the background area, and its specific direction is declared by you, the author.  In this case, it’s been declared to point toward the 45-degree angle.  <code>red</code> and <code>blue</code> are the color stops.  Since the colors don’t have stop distances defined, the distances are assumed to be <code>0%</code> and <code>100%</code>, respectively, which means you get a gradient blend from red to blue that progresses along the gradient line.</p>

<p>You can create hard stops, too:</p>

<pre><code>linear-gradient(45deg, green 50%, lightblue 50%)</code></pre>

<img src="http://meyerweb.com/pix/2012/04gradients01.gif" alt="Figure 1" class="pic" />

<p>That gets you the result shown in Figure 1, to which I’ve added (in Photoshop) an arrow showing the direction of the gradient line, as well as the centerpoint of the background area.  Each individual “stripe” in the gradient is perpendicular to the gradient line; that’s why the boundary between the two colors at the 50% point is perpendicular to the gradient line.  This perpendicularness is <em>always</em> the case.</p>

<p>Now, degrees are cool and all (and they’ll be changing from math angles to compass angles in order to harmonize with animations, but that’s a subject for another time), but you can also use directional keywords.  Two different kinds, as it happens.</p>

<p>The first way to use keywords is to just declare a direction, mixing and matching from the terms <code>top</code>, <code>bottom</code>, <code>right</code>, and <code>left</code>.  The funky part is that in this case, you’re declaring the direction the gradient line comes <em>from</em>, not that toward which it’s going; that is, you specify its origin instead of its destination.  So if you want your gradient to progress from the bottom left corner to the top right corner, you actually say <code>bottom left</code>:</p>

<pre><code>linear-gradient(bottom left, green 50%, lightblue 50%)</code></pre>

<img src="http://meyerweb.com/pix/2012/04gradients02.gif" alt="Figure 2" class="pic" />

<p>But <code>bottom left</code> does not equal <code>45deg</code>, unless the background area is exactly square.  If the area is not square, then the gradient line goes from one corner to another, with the boundary lines perpendicular to that, as shown in Figure 2.  Again, I added a gradient line and centerpoint in Photoshop for clarity.</p>

<p>Of course, this means that if the background area resizes in either direction, then the angle of the gradient line will also change.  Make the element taller or more narrow, and the line will rotate counter-clockwise (UK: anti-clockwise); go shorter or wider and it will rotate clockwise (UK: clockwise).  This might well be exactly what you want.  It’s certainly different than an degree angle value, which will never rotate due to changes in the background’s size.</p>

<p>The second way to use keywords looks similar, but has quite different results.  You use the same top/bottom/left/right terms, but in addition you prepend the <code>to</code> keyword, like so:</p>

<pre><code>linear-gradient(to top right, green 50%, lightblue 50%)</code></pre>

<img src="http://meyerweb.com/pix/2012/04gradients03.gif" alt="Figure 3" class="pic" />

<p>In this case, it’s clear that you’re declaring the gradient line’s destination and not its origin; after all, you’re saying <code>to top right</code>.  However, when you do it this way, you are <em>not</em> specifying the top right corner of the background area.  You’re specifying a general topward-and-rightward direction.  You can see the result of the previous sample in Figure 3; once more, Photoshop was used to add the gradient line.</p>

<p>Notice the hard-stop boundary line.  It’s actually stretching from top left to bottom right (neither of which is <code>top right</code>).  That’s because with the <code>to</code> keyword in front, you’re triggering what’s been referred to as “magic corners” behavior.  When you do this, no matter how the background area is (re)sized, that boundary line will always stretch from top left to bottom right.  Those are the magic corners.  The gradient line thus doesn’t point into the top right corner, unless the background area is perfectly square—it points into the top right quadrant (quarter) of the background area.  Apparently the term “magic quadrants” was not considered better than “magic corners”.</p>

<p>The effect of changing the background area’s size is the same as before; decreasing the height or increasing the width of the background area will deflect the gradient line clockwise, and the opposite change to either axis will produce the opposite deflection.  The only difference is the starting condition.</p>

<p>Beyond all this, if you want to use keywords that always point <em>toward</em> a corner, as in Figure 2 except specifying the destination instead of the origin, that doesn’t appear to be an option.  Similarly, neither can you declare an origin quadrant.  Having the gradient line always traverse from corner to corner means declaring the origin of the gradient line (Figure 2).  If you want the “magic corners” effect where the 50% color-stop line points from corner to corner, with the gradient line’s destination flexible, then you declare a destination quadrant (Figure 3).</p>

<p>As for actual support:  as of this writing, only Firefox and Opera support “magic corners”.  All current browsers—in Explorer’s case, that means IE10—support angles and non-magic keywords, which means Opera and Firefox support <em>both</em> keyword behaviors.  Nobody has yet switched from math angles to compass angles.  (I used <code>45deg</code> very intentionally, as it’s the same direction in either system.)</p>

<p>That’s the state of things with linear gradients right now.  I’m interested to know what you think of the various keyword patterns and behaviors—I know I had some initial trouble grasping them, and having rather different effects for the two patterns seems like it will be confusing.  What say you?</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/04/26/lineargradient-keywords/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Whitespace in CSS Calculations</title>
		<link>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 15:00:12 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1747</guid>
		<description><![CDATA[I’ve been messing around with native calculated values in CSS, and there’s something a bit surprising buried in the value format.]]></description>
			<content:encoded><![CDATA[<p>I’ve been messing around with native calculated values in CSS, and there’s something a bit surprising buried in the value format.  To quote the <a href="http://www.w3.org/TR/css3-values/">CSS3 Values and Units specification</a>:</p>

<blockquote cite="http://www.w3.org/TR/css3-values/#calc"><p>Note that the grammar requires spaces around binary ‘+’ and ‘-’ operators. The ‘*’ and ‘/’ operators do not require spaces.</p></blockquote>

<p>In other words, two out of four calculation operators require whitespace around them, and for the other two it doesn’t matter.  Nothing like consistency, eh?</p>

<p>This is why you see examples like this:</p>

<pre><code>width: calc(100%/3 - 2*1em - 2*1px);</code>
</pre>

<p>That’s actually the minimum number of characters you need to write that particular expression, so far as I can tell.  Given the grammar requirements, you could legitimately rewrite that example like so:</p>

<pre><code>width: calc(100% / 3 - 2 * 1em - 2 * 1px);</code>
</pre>

<p>…but <strong>not</strong> like so:</p>

<pre><code>width: calc(100%/3-2*1em-2*1px);</code>
</pre>

<p>The removal of the spaces around the ‘-’ operators means the whole value is invalid, and will be discarded outright by browsers.</p>

<p>We can of course say that this last example is kind of unreadable and so it’s better to have the spaces in there, but the part that trips me up is the general inconsistency in whitespace requirements.  There are apparently very good reasons, or at least very historical reasons, why the spaces around ‘+’ and ‘-’ are necessary.  In which case, I personally would have required spaces around all the operators, just to keep things consistent.  But maybe that’s just me.</p>

<p>Regardless, this is something to keep in mind as we move forward into an era of wider browser support for <code>calc()</code>.</p>

<p>Oh, and by the way, the specification also says:</p>

<blockquote cite="http://www.w3.org/TR/css3-values/#calc"><p>The ‘calc()’ expression represents the result of the mathematical calculation it contains, using standard operator precedence rules.</p></blockquote>

<p>Unfortunately, the specification doesn’t seem to actually define these “standard operator precedence rules”.  This makes for some interesting ambiguities because, as with most standards, <a href="http://en.wikipedia.org/wiki/Order_of_operations#Mnemonics">there are so many to choose from</a>.  For example, <code>3em / 2 * 3</code> could be “three em divided by two, with the result multiplied by three” (thus 4.5em) or “three em divided by six” (thus 0.5em), depending on whether you privilege multipliers over dividers or vice versa.</p>

<p>I’ve looked around the Values and Units specification but haven’t found any text defining the actual rules of precedence, so I’m going to assume US rules (which would yield 4.5em) unless proven otherwise.  <a href="http://meyerweb.com/eric/css/tests/calc.html">Initial testing</a> seems to bear this out, but not every browser line supports these sorts of expressions yet, so there’s still plenty of time for them to introduce inconsistencies.  If you want to be clear about how you want your operators to be resolved, use parentheses: they trump all.  If you want to be sure <code>3em / 2 * 3</code> resolves to 4.5em, then write it <code>(3em / 2) * 3</code>, or <code>(3em/2)*3</code> if you care to use inconsistent whitespacing.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/04/10/whitespace-in-css-calculations/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Negative Proximity</title>
		<link>http://meyerweb.com/eric/thoughts/2012/03/07/negative-proximity/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/03/07/negative-proximity/#comments</comments>
		<pubDate>Wed, 07 Mar 2012 16:00:37 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1691</guid>
		<description><![CDATA[There’s a subtle aspect of CSS descendant selectors that most people won’t have noticed because it rarely comes up.]]></description>
			<content:encoded><![CDATA[<p>There’s a subtle aspect of CSS descendant selectors that most people won’t have noticed because it rarely comes up: selectors have no notion of element proximity.  Here’s the classic demonstration of this principle:</p>

<pre>body h1 {color: red;}
html h1 {color: green;}</pre>

<p>Given those styles, all <code>h1</code> elements will be green, not red.  That’s because the selectors have equal specificity, so the last one wins.  The fact that the <code>body</code> element is “closer to” the <code>h1</code> than the <code>html</code> element in the document tree is irrelevant.  CSS has no mechanism for measuring proximity within the tree, and if I had to place a bet on the topic I’d bet that it never will.</p>

<p>I bring this up because it can get you into trouble when you’re using <a href="http://www.w3.org/TR/css3-selectors/#negation">the negation pseudo-class</a>.  Consider:</p>

<pre>div:not(.one) p {font-weight: bold;}
div.one p {font-weight: normal;}

&lt;div class="one"&gt;
  &lt;div class="two"&gt;
    &lt;p&gt;Hi there!&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>

<p>Given these styles, the paragraph will <em>not</em> be boldfaced.  That’s because both rules match, so the last one wins.  The paragraph will be normal-weight.</p>

<p>“AHA!” you cry.  “But the first rule has a higher specificity, so it wins regardless of the order they’re written in!”  You’d think so, wouldn’t you?  But it turns out that the negation pseudo-class isn’t counted as a pseudo-class.  It, like the univseral selector, doesn’t contribute to specificity at all:</p>

<blockquote cite="http://w3.org/TR/css3-selectors/#specificity"><p>Selectors inside the negation pseudo-class are counted like any other, but the negation itself does not count as a pseudo-class.</p></blockquote>
<p class="quoteattrib">—Selectors Level 3, section 9: <a href="http://w3.org/TR/css3-selectors/#specificity">Calculating a selector’s specificity</a></p>

<p>If you swapped the order of the rules, you’d get a boldfaced paragraph thanks to the “all-other-things-being-equal-the-last-rule-wins” step in the cascade.  However, that wouldn’t keep you from getting a red-on-red paragraph in this case:</p>

<pre>div:not(.one) p {color: red;}
div.one p {background: red;}

&lt;div class="one"&gt;
  &lt;div class="two"&gt;
    &lt;p&gt;Hi there!&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
</pre>

<p>The paragraph is a child of a <code>div</code> that doesn’t have a <code>class</code> of <code>one</code>, but it’s <em>also</em> descended from a <code>div</code> that has a <code>class</code> of <code>one</code>.  Both rules apply.</p>

<p>(Thanks to <a href="http://stephaniehobson.ca/" rel="acquaintance met">Stephanie Hobson</a> for first bringing this to my attention.)</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/03/07/negative-proximity/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The Web Ahead, Episode #18: Me!</title>
		<link>http://meyerweb.com/eric/thoughts/2012/03/05/the-web-ahead-episode-18-me/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/03/05/the-web-ahead-episode-18-me/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 15:54:23 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Interviews]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1681</guid>
		<description><![CDATA[I had the rare honor and privilege of chatting with <a href="http://jensimmons.com/" rel="acquaintance met">Jen Simmons</a> as a guest on <a href="http://5by5.tv/webahead/"><img src="http://meyerweb.com/pix/2012/webahead.jpg" alt="" class="pic" /> The Web Ahead </a>.]]></description>
			<content:encoded><![CDATA[<p>Last Thursday, I had the rare honor and privilege of chatting with <a href="http://jensimmons.com/" rel="acquaintance met">Jen Simmons</a> as a guest on <a href="http://5by5.tv/webahead/"><img src="http://meyerweb.com/pix/2012/webahead.jpg" alt="" class="pic" /> The Web Ahead </a>.  (I’ve also chatted with Jen <em>in real life</em>.  That’s even awesomer!)  As is my wont, I completely abused that privilege by chatting for <strong>two hours</strong>—making it the second-longest episode of The Web Ahead to date—about the history of the web and CSS, what’s coming up that jazzes me the most, and all kinds of stuff.  I even revealed, toward the end of the conversation, the big-picture projects I dearly wish I had time to work on.</p>

<p>The finished product was published last Friday morning.  I know it’s a bit of a lengthy beast, but if you’re at all interested about how we got to where we are with CSS, you might want to give this a listen:  <a href="http://5by5.tv/webahead/18">The Web Ahead, Episode #18</a>.  Available for all your finer digital audio players via embedded Flash player, iTunes, RSS, and MP3 download.</p>

<p>My deepest thanks to Jen for inviting me to be part of the show!</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/03/05/the-web-ahead-episode-18-me/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>“The Vendor Prefix Predicament” at ALA</title>
		<link>http://meyerweb.com/eric/thoughts/2012/02/14/the-vendor-prefix-predicament-at-ala/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/02/14/the-vendor-prefix-predicament-at-ala/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 18:11:36 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1652</guid>
		<description><![CDATA[Published this morning in A List Apart #344: an interview I conducted with Tantek Çelik, web standards lead at Mozilla, on the subject of Mozilla’s plan to honor -webkit- prefixes on some properties in their mobile browser. Even better: Lea Verou’s Every Time You Call a Proprietary Feature ‘CSS3,’ a Kitten Dies. Please—think of the [...]]]></description>
			<content:encoded><![CDATA[<p>Published this morning in <a href="http://alistapart.com/">A List Apart</a> #344: <a href="http://www.alistapart.com/articles/the-vendor-prefix-predicament-alas-eric-meyer-interviews-tantek-celik/">an interview I conducted with Tantek Çelik</a>, web standards lead at Mozilla, on the subject of Mozilla’s plan to honor <code>-webkit-</code> prefixes on some properties in their mobile browser.  Even better: Lea Verou’s <a href="http://www.alistapart.com/articles/every-time-you-call-a-proprietary-feature-css3-a-kitten-dies/">Every Time You Call a Proprietary Feature ‘CSS3,’ a Kitten Dies</a>.  Please—think of the kittens!</p>

<p>My hope is that the interview brings clarity to a situation that has suffered from a number of misconceptions.  I do not necessarily hope that you agree with Tantek, nor for that matter do I hope you disagree.  While I did press him on certain points, my goal for the interview was to provide him a chance to supply information, and insight into his position.  If that job was done, then the reader can fairly evaluate the claims and plans presented.  What conclusion they reach is, as ever, up to them.</p>

<p>We’ve learned a lot over the past 15-20 years, but I’m not convinced the lessons have settled in deeply enough.  At any rate, there are interesting times ahead.  If you care at all about the course we chart through them, be involved now.  Discuss.  Deliberate.  Make your own case, or support someone else’s case if they’ve captured your thoughts.  Debate with someone who has a different case to make.  Don’t just sit back and assume everything will work out—for while things usually do work out, they don’t always work out for the best.  Push for the best.</p>

<p>And fix your browser-specific sites already!</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/02/14/the-vendor-prefix-predicament-at-ala/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Unfixed</title>
		<link>http://meyerweb.com/eric/thoughts/2012/02/09/unfixed/</link>
		<comments>http://meyerweb.com/eric/thoughts/2012/02/09/unfixed/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 18:37:49 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1622</guid>
		<description><![CDATA[Vendor prefixes may soon be a thing of the past, and in the worst possible way.]]></description>
			<content:encoded><![CDATA[<p>Right in the middle of AEA Atlanta—which was <em>awesome</em>, I really must say—there were two announcements that stand to invalidate (or at least greatly alter) portions of the talk I delivered.  One, which I believe came out as I was on stage, was the publication of <a href="http://www.w3.org/TR/2012/WD-css3-positioning-20120207/">the latest draft of the CSS3 Positioned Layout Module</a>.  We’ll see if it triggers change or not; I haven’t read it yet.</p>

<p>The other was the publication of <a href="http://lists.w3.org/Archives/Public/www-style/2012Feb/0313.html">the minutes of the CSS Working Group meeting in Paris</a>, where it was revealed that several vendors are about to support the <code>-webkit-</code> vendor prefix in their own very non-WebKit browsers.  Thus, to pick but a single random example, Firefox would throw a drop shadow on a heading whose entire author CSS is <code>h1 {-webkit-box-shadow: 2px 5px 3px gray;}</code>.</p>

<p>As an author, it sounds good as long as you haven’t really thought about it very hard, or if perhaps you have a very weak sense of the history of web standards and browser development.  It fits right in with the recurring question, “Why are we screwing around with prefixes when vendors should just implement properties completely correctly, or not at all?”  Those idealized end-states always sound great, but years of evidence (and reams upon reams of bug-charting material) indicate it’s an unrealistic approach.</p>

<p>As a vendor, it may be the least bad choice available in an ever-competitive marketplace.  After all, if there were a few million sites that you could render as intended if only the authors used your prefix instead of just one, which would you rather: embark on a protracted, massive awareness campaign that would probably be contradicted to death by people with their own axes to grind; or just support the damn prefix and move on with life?</p>

<p>The practical upshot is that browsers “supporting alien CSS vendor prefixes”, <a href="http://www.netmagazine.com/news/css-vendor-prefixes-threaten-open-web-121757">as Craig Grannell put it</a>, seriously cripples the whole concept of vendor prefixes.  It may well reduce them to outright pointlessness.  I am <a href="http://alistapart.com/articles/prefix-or-posthack/">on record as being a fan of vendor prefixes</a>, and furthermore as someone who advocated for the formalization of prefixing as a part of the specification-approval process.  Of course I still think I had good ideas, but those ideas are currently being sliced to death on the shoals of reality.  Fingers can point all they like, but in the end what matters is what happened, not what should have happened if only we’d been a little smarter, a little more angelic, whatever.</p>

<p>I’ve seen a proposal that vendors agree to only support other prefixes in cases where they are un-prefixing their own support.  To continue the previous example, that would mean that when Firefox starts supporting the bare <code>box-shadow</code>, they will also support <code>-webkit-box-shadow</code> (and, one presumes, <code>-ms-box-shadow</code> and <code>-o-box-shadow</code> and so on).  That would mitigate the worst of the damage, and it’s probably worth trying.  It could well buy us a few years.</p>

<p>Developers are also trying to help repair the damage before it’s too late.  Christian Heilmann has <a href="http://christianheilmann.com/2012/02/09/now-vendor-prefixes-have-become-a-problem-want-to-help-fix-it/">launched an effort to get GitHub-based projects updated</a> to stop being WebKit-only, and Aarron Gustafson <a href="http://blog.easy-designs.net/archives/2012/02/09/this-must-not-happen/">has published a UNIX command to find all your CSS files containing <code>webkit</code></a> along with a call to update anything that’s not cross-browser friendly.  Others are making similar calls and recommendations.  You could use <a href="http://leaverou.github.com/prefixfree/">PrefixFree</a> as a quick stopgap while going through the effort of doing manual updates.  You could make sure your CSS pre-processor, if that’s how you swing, is set up to do auto-prefixing.</p>

<p>Non-WebKit vendors are in a corner, and we helped put them there.  If the proposed prefix change is going to be forestalled, we have to get them out.  Doing that will take a lot of time and effort and awareness and, above all, widespread interest in doing the right thing.</p>

<p>Thus my fairly deep pessimism.  I’d love to be proven wrong, but I have to assume the vendors will push ahead with this regardless.  It’s <a href="http://meyerweb.com/eric/thoughts/2008/01/24/almost-target/">what we did at Netscape ten years ago</a>, and almost certainly would have done despite any outcry.  I don’t mean to denigrate or undermine any of the efforts I mentioned before—they’re absolutely worth doing even if every non-WebKit browser starts supporting <code>-webkit-</code> properties next week.  If nothing else, it will serve as evidence of your commitment to professional craftsmanship.  The real question is: how many of your fellow developers come close to that level of commitment?</p>

<p>And I identify that as the real question because it’s the question vendors are asking—<em>must</em> ask—themselves, and the answer serves as the compass for their course.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2012/02/09/unfixed/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>CSS Modules Throughout History</title>
		<link>http://meyerweb.com/eric/thoughts/2011/09/27/css-modules-timelines/</link>
		<comments>http://meyerweb.com/eric/thoughts/2011/09/27/css-modules-timelines/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 13:03:10 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1559</guid>
		<description><![CDATA[For very little reason other than I was curious to see what resulted, I've compiled a list of various CSS modules' version histories, and then used CSS to <a href="http://meyerweb.com/eric/css/timelines/">turn it into a set of timelines</a>.]]></description>
			<content:encoded><![CDATA[<p>For very little reason other than I was curious to see what resulted, I&#8217;ve compiled a list of various CSS modules&#8217; version histories, and then used CSS to <a href="http://meyerweb.com/eric/css/timelines/">turn it into a set of timelines</a>.  It&#8217;s kind of a low-cost way to visualize the life cycle of and energy going into various CSS modules.</p>

<p>I&#8217;ll warn you up front that as of this writing the user interaction is not ideal, and in some places the presentation suffers from too much content overlap.  This happens in timelines where lots of drafts were released in a short period of time.  (In one case, two related drafts were released on the same day!)  I intend to clean up the presentation, but for the moment I&#8217;m still fiddling with ideas.  The obvious one is to rotate every other spec name by -45 degrees, but that looked kind of awful.  I suspect I&#8217;ll end up doing some sort of timestamp comparison and if they&#8217;re too close together, toss on a class that invokes a <code>-45deg</code> rotation.  Or maybe I&#8217;ll get fancier!</p>

<p>The interaction is a little tougher to improve, given what&#8217;s being done here, but I have a few ideas for making things, if not perfect, at least less twitchy.</p>

<p>I should also note that not every module is listed as I write this:  I intentionally left off modules whose last update was 2006 or earlier.  I may add them at the end, or put them into a separate set of timelines.  The historian in me definitely wants to see them included, but the shadow of a UX person who dwells somewhere in the furthest corners of my head wanted to avoid as much clutter as possible.  We&#8217;ll see which one wins.</p>

<p>Anyway, somewhat like the <a href="http://meyerweb.com/eric/browsers/timeline-structured.html">browser release timeline</a>, which is probably going to freeze in the face of the rapid-versioning schemes that are all the rage these days, I had fun combining my love of the web and my love of history.  I should do it more often, really.  The irony is that I don&#8217;t really have the time.</p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2011/09/27/css-modules-timelines/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Un-fixing Fixed Elements with CSS Transforms</title>
		<link>http://meyerweb.com/eric/thoughts/2011/09/12/un-fixing-fixed-elements-with-css-transforms/</link>
		<comments>http://meyerweb.com/eric/thoughts/2011/09/12/un-fixing-fixed-elements-with-css-transforms/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 15:54:45 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1556</guid>
		<description><![CDATA[In the course of experimenting with some new artistic scripts to follow up "Spinning the Web", I ran across an interesting interaction between positioning and tranforms.]]></description>
			<content:encoded><![CDATA[<p>In the course of experimenting with some new artistic scripts to follow up &#8220;<a href="http://meyerweb.com/eric/thoughts/2011/06/03/spinning-the-web/">Spinning the Web</a>&#8220;, I ran across an interesting interaction between positioning and transforms.</p>

<p>Put simply: as per <a href="http://www.w3.org/TR/2009/WD-css3-2d-transforms-20091201/#introduction">the Introduction of the latest CSS 2D Transforms draft</a>, a transformed element creates a containing block for <strong>all</strong> its positioned descendants.  This occurs in the absence of any explicit positioning of the transformed element.</p>

<p>Let&#8217;s walk through that.  Say you have a document whose <code>body</code> contains nothing except a <code>position: static</code> (normal-flow) <code>div</code> that contains some absolutely-positioned descendants.  The containing block for those positioned elements will be the root element.  Nothing unusual or unexpected there.</p>

<p>But then you decide to declare <code>div {transform: rotate(10deg);}</code>.  (Or even <code>0deg</code>, which will have the same result.)  Now the <code>div</code> is the containing block for the absolutely-positioned elements that descend from it.  It&#8217;s as though transforming an element force-adds <code>position: relative</code>.  The positioned elements will rotate with their ancestor <em>and</em> be placed according to its containing block—not that of the root element.</p>

<p>Okay, so that&#8217;s a little unusual but perhaps not unexpected.  I could make arguments both ways, and some of the arguments could get pretty complex.  To pick one example, if the transformed element <em>didn&#8217;t</em> generate a containing block, how would translate transforms be handled?</p>

<p>Either way, here&#8217;s where things got really troublesome for me:  a transformed element creates a containing block <em>even for descendants that have been set to <code>position: fixed</code></em>.  In other words, the containing block for a fixed-position descendant of a transformed element is the transformed element, <em>not</em> the viewport.  Furthermore, if the transformed element is in the normal flow, it will scroll with the document <em>and the fixed-position descendants will scroll with it</em>. You can see <a href="http://meyerweb.com/eric/css/tests/css3-trans-an/nested-fixed.html">my test case</a>, where the red and blue boxes would overlap each other and stay fixed in place, except the second green <code>div</code> has been rotated.</p>

<p>Obviously this makes the fixed-position elements something less than fixed-position.  In effect, not only does the transformed element act as if it&#8217;s been force-assigned <code>position: relative</code>, the fixed descendants behave as if they&#8217;ve been force-changed to <code>position: absolute</code>. </p>

<p>I find this not only unusual and unexpected, but also a wee bit unsettling.  Personally, I think it goes too far.  Fixed-position elements should be fixed to the viewport, regardless of the transformation of their ancestors.  Of course, if you agree with my thinking there, realize that opens a whole new debate about how, or even whether, transforms of ancestors should be carried to fixed-position descendants.</p>

<p>I have my own intuitions about that, but this is definitely territory where intuitions are to be treated with caution.  There are a lot of interacting behaviors no matter what you do, and no matter what you do someone&#8217;s going to find the results baffling in some way or other.</p>

<p>But since I do have intuitions, here&#8217;s what they are:  transformed elements in the normal flow or floated do not establish containing blocks for absolutely- and fixed-position descendants.  This means that any transforms you apply to the transformed element are not applied to the positioned descendants, because transforms don&#8217;t inherit.</p>

<p>What if you want a normal-flow transformed element to be a containing block?  Use <code>position: relative</code>, same as you would if there were no transform.  And if you want the transforms to be passed on to the descendants even though no containing block is established?  The <code>inherit</code> value would work in some cases, though not all.  That&#8217;s where my approach runs aground, and I&#8217;m not yet sure how to get it back to sea.</p>

<p>Okay, so that&#8217;s what I think.  What do you think?</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2011/09/12/un-fixing-fixed-elements-with-css-transforms/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Spinning the Web</title>
		<link>http://meyerweb.com/eric/thoughts/2011/06/03/spinning-the-web/</link>
		<comments>http://meyerweb.com/eric/thoughts/2011/06/03/spinning-the-web/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 15:19:42 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1526</guid>
		<description><![CDATA[Can CSS create art?  That's a question I set out to explore recently, and I like to think that the answer is yes, but you can judge for yourself.]]></description>
			<content:encoded><![CDATA[<p>Can CSS create art?  That&#8217;s a question I set out to explore recently, and I like to think that the answer is yes.  You can judge for yourself: <a href="http://www.flickr.com/photos/meyerweb/sets/72157626750845115/">Spinning the Web</a>, a gallery on Flickr.</p>

<a href="http://www.flickr.com/photos/meyerweb/5793617592/" title="cnn by meyerweb, on Flickr"><img src="http://farm4.static.flickr.com/3647/5793617592_8ff99b7482.jpg" width="350" height="200" alt="cnn" class="pic"/></a>

<p>To be clear, when I say &#8220;Can CSS create art?&#8221; I don&#8217;t mean that in the sense of wondering if art, or artful designs, can be accomplished with CSS.  I think we all know the answer there, and have known at least since <a href="http://csszengarden.com/">the Zen Garden</a> got rolling.  What I&#8217;m doing here is using some basic CSS to generate art, using web sites as the medium.  For the series I linked, I spun all of the elements on a page using <code>transform: rotate()</code> to see what resulted.  Any time I saw something I liked, I took a screenshot.  After I was done, I winnowed the shots down to the best ones.</p>

<p>As some of you old-schoolers will probably have recognized, I&#8217;m absolutely following in the footsteps of <a href="http://joshuadavis.com/" rel="met">Joshua Davis</a> here, and in fact my working title for this effort was &#8220;Once Upon a Browser&#8221;.  I saw Josh speak years ago, and clearly remember his description of how he generated a lot of his art.  My process is almost identical, albeit with a bit less automation and computational complexity.</p>

<p>Because this is me, I built a little commentary joke into the first images in the series.  It&#8217;s not terribly subtle, but with luck one or two of you will get the same chuckle I did.</p>

<p>I&#8217;m already thinking about variants on this theme, so there may be more series to come.  In the meantime, as I surf around I&#8217;ll stop every now and again to spin what I see.  I&#8217;ll definitely mention any new additions <a href="http://twitter.com/meyerweb/">via Twitter</a>, and new series both there and here.  And of course if you follow <a href="http://flickr.com/photos/meyerweb/">me on Flickr</a>, you&#8217;ll see new pieces as they go up.</p>

<p>I hope you enjoy them half as much as I enjoyed creating them.  <ins datetime="2011-06-03T20:41:59+00:00">And if anyone wants to use the originals as desktop wallpapers, <a href="http://meyerweb.com/eric/thoughts/2011/06/03/spinning-the-web/#comment-558734">as Tim proposed</a>, feel free!</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2011/06/03/spinning-the-web/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Seeing the matrix()</title>
		<link>http://meyerweb.com/eric/thoughts/2011/04/12/seeing-the-matrix/</link>
		<comments>http://meyerweb.com/eric/thoughts/2011/04/12/seeing-the-matrix/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 14:41:39 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1511</guid>
		<description><![CDATA[<a href="http://easy-designs.net/">Aaron Gustafson</a> and I created a tool for anyone who wants to resolve a series of CSS transforms into a <code>matrix()</code> value representing the same end state.  Behold: <a href="http://meyerweb.com/eric/tools/matrix/">The Matrix Resolutions</a>.]]></description>
			<content:encoded><![CDATA[<p>Over the weekend, <a href="http://aaron-gustafson.com/" rel="friend colleague met">Aaron Gustafson</a> and I created a tool for anyone who wants to resolve a series of CSS transforms into a <code>matrix()</code> value representing the same end state.  Behold: <strong><a href="http://meyerweb.com/eric/tools/matrix/">The Matrix Resolutions</a></strong>.  (You knew that was coming, right?)  It should work fine in various browsers, though due to the gratuitous use of keyframe animations on the <code>html</code> element&#8217;s multiple background images it looks best in WebKit browsers.</p>

<p>The way it works is you input a series of transform functions, such as <code>translateX(22px) rotate(33deg) scale(1.13)</code>.  The end-state and its <code>matrix()</code> equivalent should update whenever you hit the space bar or the return key, or else explicitly elect to take the red pill.  If you want to wipe out what you&#8217;ve input and go back to a state of blissful ignorance, take the blue pill. </p>

<p>There is one thing to note: the <code>matrix()</code> value you get from the tool is equivalent to the end-state placement of all the transforms you input.  That value most likely does <em>not</em> create an equivalent animation, particularly if you do any rotation.  For example, animating <code>translateX(75px) rotate(1590deg) translateY(-75px)</code> will not appear the same as animating <code>matrix(-0.866025, 0.5, -0.5, -0.866025, 112.5, 64.9519)</code>.  The two values will get the element to the same destination, but via very different paths.  If you&#8217;re just transforming, not animating, then that&#8217;s irrelevant.  If you are, then you may want to stick to the transforms.</p>

<p>This tool grew out of the first <a href="http://r4g.co/">Retreats 4 Geeks</a> (which was <strong>AWESOME</strong>) just outside of Gatlinburg, TN.  After some side conversations betwen me and Aaron during the CSS training program, we hacked this together in a few hours on Saturday night.  Hey, who knows how to <em>party</em>?  Aaron of course wrote the JavaScript.  Early on we came up with the punny name, and of course once we did that the visual design was pretty well chosen for us.  A free TTF webfont (for the page title), a few background images, and a whole bunch of RGBa colors later we had arrived.  Creating the visual appearance was a lot of fun, I have to say.  CSS geeks, please feel free to view source and enjoy.  No need to say &#8220;whoa&#8221;—it&#8217;s actually not that complicated.</p>

<p>So anyway, there you go.  If you want to see the <code>matrix()</code>, remember: we can only show you <a href="http://meyerweb.com/eric/tools/matrix/">the door</a>. You&#8217;re the one that has to walk through it.</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2011/04/12/seeing-the-matrix/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>CSS Pocket Reference: The Cutting Room</title>
		<link>http://meyerweb.com/eric/thoughts/2011/04/06/css-pocket-reference-the-cutting-room/</link>
		<comments>http://meyerweb.com/eric/thoughts/2011/04/06/css-pocket-reference-the-cutting-room/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 21:11:54 +0000</pubDate>
		<dc:creator>Eric Meyer</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://meyerweb.com/eric/thoughts/?p=1506</guid>
		<description><![CDATA[I just shipped off the last of my drafts for <cite>CSS Pocket Reference, 4th Edition</cite> to my editor.  Here are the properties I cut.]]></description>
			<content:encoded><![CDATA[<p>I just shipped off the last of my drafts for <cite>CSS Pocket Reference, 4th Edition</cite> to my editor.  In the process of writing the entries, I set up an <a href="http://meyerweb.com/eric/css/tests/css3/">ad-hoc test suite</a> and made determinations about what to document and what to cut.  That&#8217;s what you do with a book, particularly a book that&#8217;s meant to fit into a pocket.  My general guide was to cut anything that isn&#8217;t supported in any rendering engine, though in a few cases I decided to cut properties that were supported by a lone browser but had no apparent prospects of being supported by anyone else, ever.</p>

<p>For fun, and also to give fans of this or that property a chance to petition for re-inclusion, here are the properties and modules I cut.  Think of it as the blooper reel, which can be taken more than one way.  I&#8217;ve organized them by module because it&#8217;s easier that way.</p>

<ul>
<li>The <a href="http://w3.org/TR/css3-3d-transforms/#backface-visibility-property">backface-visibility</a> property from the 3D Transforms module.  This is one I&#8217;m already reconsidering, but I haven&#8217;t found any indication that anyone besides Webkit will be picking it up in the near future.  Still, I did document the rest of the 3D Transforms module so I may add this back in during the tech review stage.</li>
<li><a href="http://w3.org/TR/css3-box/#rotating"><code>rotation</code></a> and <a href="http://w3.org/TR/css3-box/#rotating"><code>rotation-point</code></a> from the CSS3 Box module.  These have been effectively replaced by the 2D Transforms module, but the Box module hasn&#8217;t been updated since that happened.</li>
<li>Everything in the <a href="http://www.w3.org/TR/css3-flexbox/">Flexible Box Layout module</a>.  There are, as of now, just too many sections bearing notes, warnings, questions, and general feelings of instability and future change for me to feel comfortable including the properties from this module.  I&#8217;m probably going to catch some flak for that.</li>
<li><a href="http://w3.org/TR/css3-grid/#grid-columns">grid-columns</a> and <a href="http://w3.org/TR/css3-grid/#grid-rows">grid-rows</a> from the Grid Positioning Module Level 3, which effectively means means excluding the entire module.  Some day maybe I&#8217;ll write a separate pocket reference just for the various CSS layout systems.</li>
<li><a href="http://w3.org/TR/css3-fonts/#font-stretch">font-stretch</a>.  Its continued exclusion saddens me, because I am exactly the sort of sheep-stealing lowlife who would programmatically stretch and compress font faces and <em>like</em> it, but so far as I can tell nobody&#8217;s supporting the property.  Alas.</li>
<li>Basically, the entirety of the <a href="http://www.w3.org/TR/css3-gcpm/">Generated Content for Paged Media module</a>.</li>
<li>The Behavioral Extensions module, which means the <a href="http://w3.org/TR/becss/#the-binding">binding</a> property as well as the <code>:bound-element</code> pseudo-class.</li>
<li>All the properties in <a href="http://www.w3.org/TR/css3-marquee/">CSS Marquee module</a>.  I&#8217;d love to see someone make a compelling case for re-instating them.</li>
<li>The following properties from <a href="http://www.w3.org/TR/css3-text/">CSS Text Level 3</a>: 
<a href="http://w3.org/TR/css3-text/#hanging-punctuation"><code>hanging-punctuation</code></a>, 
<a href="http://w3.org/TR/css3-text/#punctuation-trim"><code>punctuation-trim</code></a>, 
<a href="http://w3.org/TR/css3-text/#text-align-last"><code>text-align-last</code></a>, 
<a href="http://w3.org/TR/css3-text/#text-emphasis-position"><code>text-emphasis-position</code></a>, 
<a href="http://w3.org/TR/css3-text/#text-emphasis-style"><code>text-emphasis-style</code></a>, 
<a href="http://w3.org/TR/css3-text/#text-emphasis"><code>text-emphasis</code></a>, 
<a href="http://w3.org/TR/css3-text/#text-justify"><code>text-justify</code></a>, 
<a href="http://w3.org/TR/css3-text/#text-outline"><code>text-outline</code></a>, 
<a href="http://w3.org/TR/css3-text/#text-wrap"><code>text-wrap</code></a>, 
<a href="http://w3.org/TR/css3-text/#white-space-collapse"><code>white-space-collapsing</code></a>, 
and <a href="http://w3.org/TR/css3-text/#word-break"><code>word-break</code></a>.</li>
<li>The following properties from <a href="http://www.w3.org/TR/css3-ui/">the Basic User Interface module</a>, dated 2004:
<a href="http://w3.org/TR/css3-ui/#appearance0"><code>appearance</code></a>, 
<a href="http://w3.org/TR/css3-ui/#icon"><code>icon</code></a>, 
<a href="http://w3.org/TR/css3-ui/#nav-dir"><code>nav-down</code></a>, 
<a href="http://w3.org/TR/css3-ui/#nav-dir"><code>nav-left</code></a>, 
<a href="http://w3.org/TR/css3-ui/#nav-dir"><code>nav-right</code></a>, 
<a href="http://w3.org/TR/css3-ui/#nav-dir"><code>nav-up</code></a>, 
and <a href="http://w3.org/TR/css3-ui/#nav-index0"><code>nav-index</code></a>.</li>
<li>The <a href="http://www.w3.org/TR/css3-hyperlinks/">Hyperlink Presentation module</a>, dated 2004.</li>
<li>The <a href="http://www.w3.org/TR/css3-preslev/">Presentation Levels module</a>, dated 2003.</li>
<li><a href="http://w3.org/TR/css3-content/#moving">move-to</a> and 
<a href="http://w3.org/TR/css3-content/#the-crop">crop</a> from the CSS3 Generated and Replaced Content module, dated 2003.</li>
<li>The <a href="http://www.w3.org/TR/css3-linebox/">Line module</a>, dated 2002 and bearing my name for no reason I can recall.  The one property listed there which I kept is <code>vertical-align</code>, and I just used the CSS2.1 definition.</li>
</ul>

<p>After all that, I imagine you&#8217;re going to laugh uproariously when I tell what I <em>did</em> include:  paged and aural properties.  I know—I&#8217;m kind of poleaxed by my own double standard on that score.  I included them for historical reasons (they&#8217;ve long been included) and also because they&#8217;re potentially very useful to a more accessible future.  Besides, if we run out of pages, they&#8217;re in their own section and so very easy to cut.</p>

<p>I&#8217;m pretty sure I listed everything that I explicitly dropped, so if you spot something that I absolutely have to reinstate, here&#8217;s your chance to let me know!</p>]]></content:encoded>
			<wfw:commentRss>http://meyerweb.com/eric/thoughts/2011/04/06/css-pocket-reference-the-cutting-room/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
