<?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>existdissolve.com &#187; CSS3</title>
	<atom:link href="http://existdissolve.com/category/web-design/css3/feed/" rel="self" type="application/rss+xml" />
	<link>http://existdissolve.com</link>
	<description>the singularity of being and nothingness</description>
	<lastBuildDate>Wed, 16 May 2012 12:54:03 +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>CSS3 Infographic</title>
		<link>http://existdissolve.com/2012/01/css3-infographic/</link>
		<comments>http://existdissolve.com/2012/01/css3-infographic/#comments</comments>
		<pubDate>Sun, 22 Jan 2012 20:26:28 +0000</pubDate>
		<dc:creator>existdissolve</dc:creator>
				<category><![CDATA[Cool Stuff]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Flex-box]]></category>
		<category><![CDATA[Infographic]]></category>

		<guid isPermaLink="false">http://existdissolve.com/?p=2356</guid>
		<description><![CDATA[There&#8217;s something with me, the weekend, and CSS3&#8230;hmm&#8230; On Saturday, Google Politics &#38; Elections posted an interesting infographic about search trends over the last week related to the four remaining GOP Presidential candidates. Here&#8217;s the infographic: Overall, pretty nice. It makes good use of color, highlights the important details, and avoids loading the graphic with&#8230;]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s something with me, the weekend, and CSS3&#8230;hmm&#8230;</p>
<p>On Saturday, <a href="https://plus.google.com/u/0/114401727024677849167/posts">Google Politics &amp; Elections</a> posted an interesting infographic about search trends over the last week related to the four remaining GOP Presidential candidates.</p>
<p>Here&#8217;s the infographic:</p>
<div class="wp-caption alignnone" style="width: 624px"><img class=" " title="Top 4 Candidate Search Gains (1/14 - 1/21)" src="https://lh6.googleusercontent.com/-i9HmVaMuS3Q/TxsJSXk-8tI/AAAAAAAACHg/d9t9nX6FPXs/s1024/gingrich%2Bsurge%2B2.jpg" alt="" width="614" height="346" /><p class="wp-caption-text">From Google Politics &amp; Elections</p></div>
<p>Overall, pretty nice. It makes good use of color, highlights the important details, and avoids loading the graphic with needless frills, pointless content, etc.</p>
<p>The one problem, though, is that it&#8217;s simply an image. While it&#8217;s nice to look at, it&#8217;s kind of boring.</p>
<h2>Some CSS3 Up In Here</h2>
<p>So as I was internally complaining about how boring the image qua image is, it occurred to me that some simple CSS3 flourishes could really make this nice.</p>
<p><strong><a href="http://existdissolve.com/demos/css3/infographic/">Check Out the Example</a> </strong>(note: you&#8217;ll need a more recent version of Webkit or Firefox for this to work&#8230;)</p>
<p>In this experiment, I&#8217;m using a few things I&#8217;ve not messed with much in the past: <strong>keyframes</strong> and the <strong>flex-box model</strong>.</p>
<h3>Flex-Box Model</h3>
<p>If you&#8217;re a web designer, you&#8217;ve no doubt spent endless hours trying to coax HTML and CSS to do simple things like expand &#8220;columns&#8221; a particular percentage in width and height. This is a horrible nightmare to endure, and it usually ends in a lot of hacks and more cursing, just to get content to line up correctly.</p>
<p>Enter the flex-box model. WIth the flex-box model, you can create dynamic, &#8220;flexible&#8221; areas of content that not only &#8220;flex&#8221; to fill space based on your precise specification, but can also have intrinsic relationships to other elements.</p>
<p>In my example, I used the flex-box model to handle laying out the &#8220;name&#8221; and &#8220;percentage&#8221; content in each candidate&#8217;s &#8220;bar.&#8221; Here&#8217;s the HTML:</p>
<pre>&lt;div class="bar"&gt;
    &lt;img src... /&gt;
    &lt;div class="name"&gt;Newt Gingrich&lt;/div&gt;
    &lt;div class="total"&gt;+688%&lt;/div&gt;
&lt;/div&gt;</pre>
<p>Very simple. In fact, the flex-box doesn&#8217;t really require much in the way of mark-up&#8230;you can easily use the basic structures that you would normally implement.</p>
<p>Since there&#8217;s nothing special about the markup, the real magic happens in CSS:</p>
<pre>// flex box styles for "bar" container
.bar {
    display: -webkit-box;
    display: -moz-box;
}
// flex box styles for "name" content
.name {
    -webkit-box-flex: 1;
    -moz-box-flex:1;
}</pre>
<p><strong>That&#8217;s it?</strong> Yep, that&#8217;s it. When we add &#8220;display:box;&#8221; to the parent element, we are telling it that it should behave according to the flex-box model. By default, this will lay out all of its children along the horizontal axis. Notice we didn&#8217;t have to float anything. That is awesome.</p>
<p>And for the &#8220;name&#8221; content, we&#8217;ve added the &#8220;box-flex&#8221; attribute and given it a value of &#8220;1&#8243;. This tells the individual item that not only should it be laid out horizontally with its siblings, but that moreover it should take up additional space. Since we&#8217;ve applied &#8220;box-flex&#8221; to only 1 element, this will take up any remaining space in the parent&#8211;if other siblings had &#8220;box-flex&#8221; as well, the value of &#8220;1&#8243; would change in relation to the box-flex of the other siblings.</p>
<p>In essence, what this does it to give us a really nice horizontal layout of 3 items (the image, the &#8220;name&#8221; and the &#8220;percentage&#8221;) without needing floats, positioning, or any other nonsense. Since &#8220;name&#8221; is the only content with &#8220;box-flex&#8221; assigned, it will greedily gobble up the remaining space left over in the parent, resulting in a nice right-alignment of the variable-width &#8220;percentage&#8221; content. Did I mention no floats? Hooray.</p>
<h3>Keyframe Animations</h3>
<p>Besides the super-sweet flex-box utilization, this example also uses the super-fancy keyframe animation specification. What are keyframes? Think about when you used to create animations in Flash, and you created keyframes at specified points along a timeline where you wanted specific events to occur. Keyframes in CSS3 animations are very similar.</p>
<p>In this example, I wanted to animate the background of the main content area (the gradients behind each candidate). WIth the keyframe specification, this is stupid simple. Here&#8217;s some CSS:</p>
<pre>@-webkit-keyframes expanding {
    0%   { width:0;}
    100% { width:100%;}
}
.bar {
    -webkit-animation-iteration-count: 1;
    -webkit-animation-name: expanding;
    -webkit-animation-duration: .25s;
    -webkit-animation-timing-function:ease-in-out;
    -webkit-animation-fill-mode: forwards;
}</pre>
<p>This is a bit more involved than the flex-box model, so let&#8217;s take a look piece by piece.</p>
<p>The first chunk of code is where we define the keyframe to be used in the animation. You use the <strong>@-webkit-keyframes</strong> directive, and then provide a name (&#8220;expanding&#8221;, in this example). Then, within the object, you simply define the style rules that should be applied at each &#8220;frame&#8221; of the animation. In this example, we have a very simple definition. At the start of the animation (0%), the width of the element will be 0; at the end (100%) the width will be 100%. The cool part is that the browser takes care of the animation in between each keyframe, and this is why we get the horizontal bar &#8220;expansion&#8221; animation in this example.</p>
<p>The next chunk of code is how we 1.) apply the keyframe specification to the particular element (&#8220;animation-name&#8221;) and 2.) additionally configure how the animation will behave, such as the duration, why kind of timing function should be applied, how many times the animation should run, etc.</p>
<p>Pretty cool stuff.</p>
<h2>Some Caveats</h2>
<p>Unfortunately, support in browsers for some of the cooler stuff in this demo is currently pretty limited. To the best of my knowledge, both the flex-box and keyframe specification are only implemented in Webkit and Firefox.</p>
<p>Moreover, I didn&#8217;t bother with a graceful degradation to other browsers. So if you open this example in IE, Opera, etc., you&#8217;re out of luck. If you feel like implementing a graceful degradation, feel free to <a href="https://github.com/existdissolve/InfoGraphic">grab the source from GitHub</a>.</p>
<h2>Wrapping Up</h2>
<p>While a lot of these features are still not yet ready for primetime, I think this example shows ways in which these new aspects of CSS3 can help to improve the experience of the internet. Does this application of CSS3 radically improve the infographic? Probably not. However, it does show the promise of how simple interactivity can be added without much pain at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://existdissolve.com/2012/01/css3-infographic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sencha Touch Theming: 1.1.0</title>
		<link>http://existdissolve.com/2011/04/sencha-touch-theming-1-1-0/</link>
		<comments>http://existdissolve.com/2011/04/sencha-touch-theming-1-1-0/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 05:05:01 +0000</pubDate>
		<dc:creator>existdissolve</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Sencha Touch]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://existdissolve.com/?p=2087</guid>
		<description><![CDATA[In my last article, I showed how to get setup and started with creating custom stylesheets. After a significant release (1.1.0) and several reader requests, I&#8217;m updating the walkthrough with screenshots and instructions for v1.1.0. This version will be strictly business: for discussion about the more interesting points of what&#8217;s going on, refer back to&#8230;]]></description>
			<content:encoded><![CDATA[<p>In my last article, I showed how to <a href="http://existdissolve.com/2011/03/sencha-touch-theming-getting-started/">get setup and started with creating custom stylesheets</a>. After a significant release (1.1.0) and several reader requests, I&#8217;m updating the walkthrough with screenshots and instructions for v1.1.0. This version will be strictly business: for discussion about the more interesting points of what&#8217;s going on, refer back to the original post <img src='http://existdissolve.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Step 1: Install Ruby</h2>
<p>To get SASS setup, you’ll first need to install Ruby and Ruby Gems (SASS is bundled with something called “Compass”, and Compass is a “Gem” that can be added into Ruby). You can go the painful route and install Ruby and then add Gems into it. However, if you’re stupid about these things, you can do what I did and just grab the Ruby 1.92 installer–it comes pre-built with Gems already configured.</p>
<h3>Get the <a href="http://rubyforge.org/frs/download.php/74298/rubyinstaller-1.9.2-p180.exe">Ruby 1.92 Installer</a></h3>
<p><a href="http://existdissolve.com/wp-content/uploads/2011/04/rubysplash.jpg"><img class="size-full wp-image-2088" style="display: block;" title="rubysplash" src="http://existdissolve.com/wp-content/uploads/2011/04/rubysplash.jpg" alt="" width="350" height="267" /></a></p>
<h3>When prompted, choose “”Add Ruby executables to you PATH”</h3>
<p><a href="http://existdissolve.com/wp-content/uploads/2011/04/ruby-exec.jpg"><img class="size-full wp-image-2090" title="ruby-exec" src="http://existdissolve.com/wp-content/uploads/2011/04/ruby-exec.jpg" alt="" width="350" height="267" /></a></p>
<p><a href="http://existdissolve.com/wp-content/uploads/2011/04/ruby-exec.jpg"></a>I installed to the default directory on Windows (C:\Ruby192\)</p>
<h2>Step 2: Setup Compass</h2>
<p>Now that Ruby is installed, the next step is to get Compass (e.g., SASS) setup. This step actually took me the longest, simply because I’m stupid about command-line stuff. So here’s a play-by-play of what to do (this is for Windows…I assume Mac is similar), just in case you suffer from a similar level of stupidity:</p>
<ul>
<li>Open a new Command Shell (Start -&gt; Run -&gt; type “cmd”)</li>
<li>Navigate to your Ruby installation directory (cd/ruby192)</li>
<li>Type “<span style="color: #ff0000;"><strong>gem install compass &#8211;pre</strong></span>” – if it works, you should see a bunch of text appear about things being installed, configured, and what not.</li>
<li>BTW, we&#8217;re using &#8220;&#8211;pre&#8221; to get a beta version (0.11) of Compass. This is necessary, as the latest non-beta will break when compiling.</li>
</ul>
<p><a href="http://existdissolve.com/wp-content/uploads/2011/04/compass-install.jpg"><img class="size-medium wp-image-2091" title="compass-install" src="http://existdissolve.com/wp-content/uploads/2011/04/compass-install-300x124.jpg" alt="" width="300" height="124" /></a></p>
<h3>Step 3: Done!</h3>
<p>You&#8217;re done. The next step is to actually <a href="http://existdissolve.com/2011/03/sencha-touch-theming-building-our-custom-stylesheet-with-sass/">start customizing some sassy stylesheets</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://existdissolve.com/2011/04/sencha-touch-theming-1-1-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fun with CSS3: RGBA</title>
		<link>http://existdissolve.com/2010/06/fun-with-css3-rgba/</link>
		<comments>http://existdissolve.com/2010/06/fun-with-css3-rgba/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 17:04:45 +0000</pubDate>
		<dc:creator>existdissolve</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Opacity]]></category>

		<guid isPermaLink="false">http://existdissolve.wordpress.com/?p=1516</guid>
		<description><![CDATA[If you&#8217;re a web designer, there are times (I&#8217;m sure) when you&#8217;ve wanted to have a transparent background for something.  After all, Web 2.0 is all about transparency and rounded corners, right? In CSS2, there were generally two ways to go about this.  The easiest was to use the &#8220;opacity&#8221; property.  Sure, it didn&#8217;t validate,&#8230;]]></description>
			<content:encoded><![CDATA[<p><!-- .opaque {opacity:.7} --></p>
<p>If you&#8217;re a web designer, there are times (I&#8217;m sure) when you&#8217;ve wanted to have a transparent background for something.  After all, Web 2.0 is all about transparency and rounded corners, right? <img src='http://existdissolve.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>In CSS2, there were generally two ways to go about this.  The easiest was to use the &#8220;opacity&#8221; property.  Sure, it didn&#8217;t validate, and you had to use an alternate syntax for IE7, but still&#8230;super easy.</p>
<pre>.opacity {opacity:.7;}</pre>
<p><a href="http://existdissolve.files.wordpress.com/2010/06/simple.jpg"><img class="alignnone size-full wp-image-1517" title="simple" src="http://existdissolve.files.wordpress.com/2010/06/simple.jpg" alt="" width="640" height="150" /></a></p>
<p>The major downside (besides lack of support) of this approach is that the opacity is applied to the entire element.  So, if you have a div with a bunch of text in it, any opacity setting applied to it will rollup to whatever content is contained within the element to which the opacity is applied.  Especially with text, this can make for some washed-out-looking content:</p>
<p><a href="http://existdissolve.files.wordpress.com/2010/06/simple-text.jpg"><img class="alignnone size-full wp-image-1518" title="simple-text" src="http://existdissolve.files.wordpress.com/2010/06/simple-text.jpg" alt="" width="640" height="150" /></a></p>
<p>In this example, the heading has a simple color of &#8220;white&#8221;, yet it looks very washed out.  This is simply because it inherits the opacity of its parent element.</p>
<p>So if the opacity of the content is important, the next best option is to use a .png as a background image.  With this approach, we get all the benefits of background-opacity, while still preserving the natural opacity of any content:</p>
<pre>.opacity-alt {background:url(images/smoke.png) repeat;}</pre>
<p><a href="http://existdissolve.files.wordpress.com/2010/06/image-text.jpg"><img class="alignnone size-full wp-image-1519" title="image-text" src="http://existdissolve.files.wordpress.com/2010/06/image-text.jpg" alt="" width="640" height="150" /></a></p>
<p>Of course, the major drawback to this approach is the extra overhead of having to create the image.  While not a big deal for one or two elements, if at some point in the future you want to change the opacity slightly, you&#8217;ll have to open up Photoshop, rework the background image, and, well, it&#8217;s a pain.</p>
<h2>Something New with CSS3</h2>
<p>With CSS3, we come into a whole new collection of wonderful properties that help to get around some of these less than ideal issues with opacity.  The most significant one is the expansion of the rgb() property to include a fourth &#8220;channel&#8221;: alpha.  The syntax is almost exactly similar to the old rgb(), but simply adds an additional specification.  Here&#8217;s the two side-by-side:</p>
<pre>.opacity {background-color:rgb(0,0,0);}
.opacity {background-color:rgba(0,0,0,.6)}</pre>
<p>The &#8220;alpha&#8221; specification allows us to change the opacity of the color of the element, not the element itself.  What these means, in a nutshell, is that the old problem of washed out text is completely wiped away.  Here&#8217;s the finished example with rgba() applied:</p>
<p><a href="http://existdissolve.files.wordpress.com/2010/06/rgba.jpg"><img class="alignnone size-full wp-image-1520" title="rgba" src="http://existdissolve.files.wordpress.com/2010/06/rgba.jpg" alt="" width="640" height="150" /></a></p>
<p>Now, of course, since Microsoft hates people, this approach won&#8217;t do you any good in IE 8 or below.  However, if you&#8217;re running a <em><strong>real </strong></em>browser like Firefox 3.6, Chrome 4, or even Safari 4, you&#8217;re golden.</p>
<p>So that brings up a good question: since IE sucks and doesn&#8217;t support this, what are my options for cross-browser support?  Well, fortunately, since IE doesn&#8217;t have any idea about rgba(), you can simply use the standard approaches if targeting IE is important to you (remember, per the specs, unrecognized properties will be ignored).  So in our final example, we can modify it slightly to have full cross-browser support by either:</p>
<p>Defaulting to solid color (will take care of IE and other browsers that don&#8217;t support rgba():</p>
<pre>background-color:#000;
background-color:rgba(0,0,0,.6);</pre>
<p>Using a background image (same results as above):</p>
<pre>background:transparent url(images/smoke.png);
background:rgba(0,0,0,.6) none;</pre>
<p>Or just target IE:</p>
<pre>background-color:#000;
filter: alpha(opacity = 60);
background-color:rgba(0,0,0,.6);
</pre>
<p>As you can see, there&#8217;s some cool stuff coming of age in CSS3.  Sure, many browsers are still WAY behind (not to mention the problem of user adoption&#8230;), but this is something web designers have had to deal with from day one, right?  Nevertheless, these changes are coming eventually, so I hope this was an interesting introduction to some of what is in store for the future of web design.</p>
]]></content:encoded>
			<wfw:commentRss>http://existdissolve.com/2010/06/fun-with-css3-rgba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

