<?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>CSSKarma</title>
	<atom:link href="http://www.csskarma.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csskarma.com/blog</link>
	<description>display your style</description>
	<lastBuildDate>Fri, 11 May 2012 13:32:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Detecting for Bandwidth with the Network Information API</title>
		<link>http://www.csskarma.com/blog/detecting-for-bandwidth/</link>
		<comments>http://www.csskarma.com/blog/detecting-for-bandwidth/#comments</comments>
		<pubDate>Fri, 11 May 2012 13:26:54 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=1053</guid>
		<description><![CDATA[First things first: view the demo. One of the principles we build sites by is to never resize an image in HTML but rather size the image appropriately in Photoshop, Fireworks, or whatever you use. We do this so the user doesn&#8217;t &#8230; <a href="http://www.csskarma.com/blog/detecting-for-bandwidth/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>First things first: <a href="http://www.csskarma.com/lab/_javascript/network-connection/">view the demo</a>.</strong></p>
<p>One of the principles we build sites by is to never resize an image in HTML but rather size the image appropriately in Photoshop, Fireworks, or whatever you use. We do this so the user doesn&#8217;t have to waste bandwidth by downloading a larger image than is necessary for the situation. Sounds great right? Totally reasonable.</p>
<p>When media queries and responsive design began to get heavy traction images started to present a real problem because using a single image on a large screen with high bandwidth didn&#8217;t necessarily work on a small screen with low bandwidth (let&#8217;s face it, we&#8217;re talking about a phone here). Using a single image makes sense in theory, but maybe not so much in practice. The famous <a href="http://unstoppablerobotninja.com/entry/the-boston-globe/">Boston Globe redesign</a> was the first (notable) site to try and tackle this problem on a large scale. I&#8217;m not exactly sure why it&#8217;s apparently ok now to resize image with CSS, but still bad to do it in HTML, but that seems like a topic for another day.</p>
<p>I won&#8217;t get into the specifics about how they did it because I heard there were a lot of problems with the method (and I forget exactly what went on). The important thing that came out of successes and failures of that project was that it kick-started the discussion about what exactly we should do to deal with this image (or really asset management) problem.</p>
<p>Scott Jehl came up with an interesting solution via the <a href="https://github.com/scottjehl/picturefill">picture element</a>. While I don&#8217;t think inventing new standards is quite the answer, the method seems sound.</p>
<h3>The Detection Stack</h3>
<p>When I&#8217;m building a site I can generally boil an interface down to a couple detection points:</p>
<ul>
<li>detect screen size to modify the design</li>
<li>detect for touch capabilities for modify the interface</li>
</ul>
<p>I&#8217;d like to add one more to that: <strong>detect bandwidth level for asset management</strong>.</p>
<h3>Detecting for Bandwidth</h3>
<p>The focus of image loading, so far has been based on image dimensions and screen-size; I think what really matters there is <strong>file size</strong> and <strong>available bandwidth</strong>. Just because browser window is small doesn&#8217;t necessarily mean it can&#8217;t handle a high-res image.</p>
<p>On a recent project I was looking for a way to test online/offline state, I came across <a href="http://davidbcalhoun.com/2010/using-navigator-connection-android">Using navigator.connection in Android</a>. Which is a blog post covering the <a href=" http://www.w3.org/TR/netinfo-api/">Network Information API</a>.</p>
<p>I built out a simple demo based off the blog post which checks bandwidth and returns another image version. To set up the HTML, we&#8217;re using a normal &lt;img&gt; tag and loading in the small version of the image incase nothing works, you&#8217;ll get the small version:</p>
<h4>HTML</h4>
<pre><code>&lt;img src="images/small-fella.jpg" <strong>data-large="images/large-fella.jpg</strong>"&gt;</code></pre>
<p>Using the data-large attribute let&#8217;s use store the image inside the &lt;img&gt; tag, so it feels more natural.</p>
<p>The JavaScript will check the bandwidth using the network information API, loop through all the img[data-large] and re-set the image src attribute.</p>
<h4>JavaScript</h4>
<pre><code>(function(){

    <strong>// initialize some variables</strong>
    var connection,
        connectionSpeed,
        images = document.querySelectorAll("img[data-large]"),
        imageCount = images.length,
        i;

    <strong>// create a custom object if navigator.connection isn't available</strong>
    connection = navigator.connection || { 'type': '0' };

    <strong>// if statement checking for WIFI, ETHERNET or UNKNOWN</strong>
    if(imageCount > 0 &#038;&#038; connection.type === '0' || connection.type === '1' || connection.type === '2') {

        <strong>// loop through each image with the data-large attribute</strong>
        for (i = 0; i < imageCount; i = i + 1) {

            var obj = images[i],
                largeImg = obj.getAttribute('data-large');

            <strong>// reset the image src to the larger version of the image</strong>
            obj.setAttribute('src', largeImg);

        }

    }
})();</code></pre>
<p>In the <a href="http://www.csskarma.com/lab/_javascript/network-connection/">demo</a> there&#8217;s also a switch statement outputting a string for the connection type. I&#8217;m adding it to the HTML, but you could easily add it as a class to the body so it&#8217;s globally available and usable with the CSS.</p>
<p>Cool right?</p>
<h3>Support</h3>
<p>It doesn&#8217;t really work anywhere. There are rumors of Android support but I personally testing the demo I built for this write-up on the latest Android OS and it didn&#8217;t work. Hopefully we&#8217;ll get there soon because I think this a great API.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/detecting-for-bandwidth/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Carroll Center for the Blind</title>
		<link>http://www.csskarma.com/blog/carroll-center/</link>
		<comments>http://www.csskarma.com/blog/carroll-center/#comments</comments>
		<pubDate>Thu, 10 May 2012 12:25:10 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[accessibility]]></category>
		<category><![CDATA[gaad]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=1072</guid>
		<description><![CDATA[Building Web sites isn&#8217;t a noble profession. Most of us don&#8217;t contribute to society in a truly meaningful way. We had a hobby that turned into a career, and we&#8217;re extremely fortunate to be able to do that. Sure, some &#8230; <a href="http://www.csskarma.com/blog/carroll-center/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Building Web sites isn&#8217;t a noble profession. Most of us don&#8217;t contribute to society in a truly meaningful way. We had a hobby that turned into a career, and we&#8217;re extremely fortunate to be able to do that. Sure, some of us work on products that do good in the world, I don&#8217;t want to completely dismiss that.</p>
<p>We&#8217;re not heart surgeons, or nurses, or even fire fighters; no one&#8217;s life depends on what we do and no one dies if we screw up. I try and remind myself of that fact when I get overly frustrated during a project as it helps keep complaining to a minimum and a little perspective (which is always good).</p>
<p>Yesterday was the first annual <a href="http://www.mysqltalk.com/gaad.html">Global Accessibility Awareness Day</a> (GAAD) and even though there was only about a month&#8217;s notice, cities around the world participated. Obviously, I wasn&#8217;t able to attend them all, but I <em>was</em> able to sit in on Boston&#8217;s version at <a href="http://carroll.org">The Carroll Center for the Blind</a>, there really couldn&#8217;t have been a better venue.</p>
<p>I like to think that the sites and applications I build are as accessible as possible. I mean, it really doesn&#8217;t take any time to throw ARIA roles in there and make sure your alt text is meaningful. It&#8217;s actually one of my pet peeves when developers/designers take accessibility shortcuts. It&#8217;s so easy to dimiss these standards because we so rarely meet the people they effect.</p>
<p>Last night I met some of these people. I watched a visually impaired gentleman navigate <a href="http://nyt.com">New York Times</a> with a screen reader. It was awful. I saw first hand why using &#8220;click here&#8221; and &#8220;read more&#8221; are terrible for link text (I had heard about it, but never saw it first-hand). I got confirmation that sometimes it&#8217;s best to leave alt text blank and why we leave the attribute empty rather than removing it (screen readers announce the file path if the alt attribute is missing).</p>
<p>Going into last night, I knew a lot about accessibility because it&#8217;s been a focal point of my career for years. But there is a huge difference between reading a blog post about Web accessibility and watching a visually impaired person go through 20 minutes of struggling to reach the main content of a Web site you would normally find in under a second if you could see.</p>
<p>I won&#8217;t lie, it&#8217;s pretty rattling to see folks with actual problems struggle to use a medium that we take for granted. Not just the Web either, we had a fairly full discussion about on-screen TV menus as well. A lot of things, I&#8217;ll admit, I don&#8217;t really think about in my day-to-day life.</p>
<p>Overall, I think the GAAD event was a great success and I hope it grows for years to come. It&#8217;s aways nice to have a reminder that even though we don&#8217;t save lives there&#8217;s one small part of our jobs that can positively effect the lives of others.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/carroll-center/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>The Problem with Media Queries</title>
		<link>http://www.csskarma.com/blog/the-problem-with-media-queries/</link>
		<comments>http://www.csskarma.com/blog/the-problem-with-media-queries/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 14:01:03 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Interaction Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=1042</guid>
		<description><![CDATA[I finally got around to reading the new article on A List Apart this morning , &#8220;A Pixel Identity Crisis&#8220;. It basically talks about how some pixels are defined differently than others (based on the &#8220;reference pixel&#8221;), so there can be &#8230; <a href="http://www.csskarma.com/blog/the-problem-with-media-queries/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I finally got around to reading the new article on A List Apart this morning , &#8220;<a href="http://www.alistapart.com/articles/a-pixel-identity-crisis/">A Pixel Identity Crisis</a>&#8220;. It basically talks about how some pixels are defined differently than others (based on the &#8220;reference pixel&#8221;), so there can be variations in how 2 devices (Galaxy  Tab and Kindle Fire given as examples in the article) with the exact same dimensions can display responsive content differently. A solution was proposed in the form of this absurdly complex media query:</p>
<pre><code>@media screen and (device-pixel-ratio: 1.5) and (device-width: 683px) and (orientation: landscape), screen and (device-pixel-ratio: 1.5) and (device-width: 400px) and (orientation: portrait) { /* css */ }</code></pre>
<p>And that&#8217;s not even the whole thing, you still need vendor prefixes to get it to work.<strong> This brings me to my point.</strong></p>
<p>This intense form of a media query is getting dangerously close to targeting a specific device, which defeats the entire point of responsive design. It&#8217;s all about setting breakpoints, but if your breakpoints get too granular, it&#8217;s no better than targeting an iPhone directly. We have starting points because you need to have starting points, something like 800px, 480px, 320px, right? Typical breakpoints for your media queries. We&#8217;re missing the mark a little with using them out of the box like that though.</p>
<p><em>Not to point blame at any boilerplates, I think they&#8217;re actually really great to get you started, but when you use them out of the box, you start to get in trouble. They&#8217;re meant to be customized. &#8212; and wow, at least change that pink highlight.</em></p>
<p>The intention of breakpoints is to identify points where your design gets a little messed up, let&#8217;s say at 600px wide your design gets too cramped. In that case your first breakpoint would be at 600px. It&#8217;s different for every design. If you follow that basic model, you don&#8217;t have to worry about what a reference pixel for a device is. If the resolution for a device is 800px and your breakpoint is at 600px, it will look at intended. <strong>Don&#8217;t worry so much, you&#8217;re already doing it right</strong>.</p>
<p>As some may know, I&#8217;ve been writing a JavaScript book and I&#8217;ve been studying a lot of the basic history of the Web. Since its early conception we (as a community) have been hacking things together to deal with a device market that is struggling to get its sea legs. Normally what happens is that we&#8217;ll have a period of instability followed by developers &amp; designers scrambling to rethink what they do and hacking something together to make it 100%, then it will get standardized and all the work you did to take a project from 95% to 100% is seen as a pile of dirty hacks (anyone remember the war between JavaScript and jScript?).</p>
<p><em>Now we use something called <a href="http://www.modernizr.com/">feature detection</a>, which is <strong>a million times better</strong>.</em></p>
<p>When you work in the browser vs. on the server there are certain things you can&#8217;t control and you need to manage bottlenecks in the process rather than forcing control over an uncontrollable situation. The devices will do what they&#8217;ll do and if you try and plan for them all you&#8217;ll:</p>
<ol>
<li>Go insane</li>
<li>Go broke purchasing all the devices</li>
<li>Create so much extra code that it will be unmanageable</li>
<li>Bog down performance</li>
<li>Ruin your JavaScript</li>
<li>Get to a point where it&#8217;s more efficient to detect for a device and serve up new markup on the server (<strong>and nobody wants crap that again</strong>)</li>
</ol>
<p>What the moral of the story? I don&#8217;t know, <strong>stop over-thinking everything</strong>. It&#8217;s great to explore new stuff, but even better when you can recognize when new stuff isn&#8217;t that much better than the old stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/the-problem-with-media-queries/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>On Google</title>
		<link>http://www.csskarma.com/blog/on-google/</link>
		<comments>http://www.csskarma.com/blog/on-google/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 15:34:54 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[rant]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=1014</guid>
		<description><![CDATA[I have some thoughts on Google that I&#8217;ve been mulling over ever since Google+ opened up. I don&#8217;t put a lot of opinion postings here because I normally put them on my personal site, but whatever; this is pretty relevant &#8230; <a href="http://www.csskarma.com/blog/on-google/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have some thoughts on <a href="http://google.com">Google</a> that I&#8217;ve been mulling over ever since Google+ opened up. I don&#8217;t put a lot of opinion postings here because I normally put them on <a href="http://okaytim.com">my personal site</a>, but whatever; this is pretty relevant and who&#8217;s going to stop me? That&#8217;s right, here we go&#8230;</p>
<p>Some of my favorite people to speak with about the Web are, ironically enough, non-techies. They&#8217;re just normal users, friends, my parents, whomever. Sometimes I just sit and watch them use Facebook (I bet it&#8217;s creepy as hell). They give a real insight into the future of the Web; if these people don&#8217;t get it, no level of fist banging by &#8220;us&#8221; is going to make something successful.</p>
<p>We can all see what Google did with Google+: they mashed up the models of Facebook and Twitter and rolled in some Google services that already exist. Facebook with the overall concept and Twitter with the friending model (circles). Don&#8217;t get me wrong, I think it&#8217;s a great effort and I applaud them for continuously trying to break into the social networking scene but the amount of time and effort they&#8217;re putting into the weakest part of their portfolio is <strong>mind-boggling</strong>. It&#8217;s an area that really doesn&#8217;t advance the Web at all. Not pushing any boundaries, just re-packaging something someone else had success in.</p>
<p>Google has some of the greatest services on the Web: Docs, Calendar, Gmail, Reader, Maps&#8230; the list goes on. Maybe focus on some of those?</p>
<p>I guess I&#8217;d like to see some advances in their strengths rather than a continuous focus in the social atmosphere. Breaking down Google +, we have:</p>
<ul>
<li>A profile</li>
<li>Pictures (picassa)</li>
<li>Circles</li>
<li>Posts</li>
<li>Games</li>
<li>Huddles</li>
</ul>
<p>I will say that I <strong>love</strong> being able to have group video conferences (huddle), it&#8217;s pretty awesome. I also like the idea behind circles (but dislike the implementation).</p>
<p>Most users don&#8217;t care or understand the circles concept, but other than that stuff, what&#8217;s the benefit to switching over from Facebook for most people? I don&#8217;t see it. It&#8217;s a lot of duplicated services: posting, pictures, friending, games, profiles no one reads, etc.</p>
<p>Whether the services over on Google+ are better or not is kind of a moot point because, at their core, both Facebook and Google+ (and Twitter) are broadcasting services. We use them to say &#8220;hey look what I did here&#8221;. And that&#8217;s totally fine. I&#8217;m <strong>not judging</strong> anyone who does that all, I do it myself every time I upload a photo to Facebook or <a href="http://twitter.com/#!/csskarma/status/129922721265102848">Tweet something out</a>. But the main crutch of a broadcasting service is it&#8217;s <strong>users</strong> and the users just flat-out do not exist in Google+ right now. I don&#8217;t see a clear user migration path from Facebook (or Twitter) over to Google+ especially for non-Gmail users.</p>
<h3>Yahoo Fantasy Sports</h3>
<p>On getting non-Gmail users over to Google+&#8230; I think Yahoo Fantasy Sports is a great model to look at for something like this.</p>
<p>I have a <a href="http://yahoo.com">Yahoo</a> account. The only thing I use it for is <strong>Fantasy Football</strong> (I really don&#8217;t use Flickr). Why? Because they produced the best (by a mile) service on the Web for that niche. Honestly, no one&#8217;s even close, its at a point where I won&#8217;t even play anywhere else. I&#8217;ve actually had the pleasure of sitting down with their team of developers. They ripped apart my JavaScript worse than anyone I&#8217;ve ever seen. It was impressive and humbling to scroll through hundreds of lines of code and have someone point out every missing semi-colon. They&#8217;re the best group of UI/Front-end people I&#8217;ve ever had the pleasure of speaking with and it really shows in the product(s).</p>
<p>If Google wants users to migrate to +, they need to do what Yahoo! sports did and not only be the best, but be the best by such a large margin that if doesn&#8217;t make sense for anyone to use anything else. It takes time, but it can be done. And they&#8217;ll need to take some more risks.</p>
<h3>Taking on a giant: users</h3>
<p>I&#8217;ve gone on the record a few times saying that I don&#8217;t think anyone is going to take down Twitter or Facebook with a similar application. I think we&#8217;ve evolved past that. Looking at all the &#8220;Twitter&#8221; killers that have come along, many of them were better services, I really liked Plurk; amazing interface. <strong>But no one used it</strong>. Why? Because no one was on it. Sounds circular, I know. But like I mentioned <strong>^</strong> up there, these are broadcasting services and when there isn&#8217;t anyone to broadcast to, what&#8217;s the point?</p>
<p>I do think both Facebook and Twitter will fall at some point, I don&#8217;t know to whom, but I do know that it won&#8217;t be Google+ in it&#8217;s current state. There&#8217;s nothing over there, the hype is gone and the users are bored (dazed) and confused.</p>
<p>Also, I think they should bring back Wave, it had a lot of potential, just a little too much noise. It could certainly be massaged into something awesome over time.</p>
<p>I&#8217;m really wondering what people think about this stuff, so let me know. <strong>Tell me I&#8217;m wrong</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/on-google/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Future of Web Design 2011</title>
		<link>http://www.csskarma.com/blog/fowd2011/</link>
		<comments>http://www.csskarma.com/blog/fowd2011/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 21:17:43 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[speaking]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=988</guid>
		<description><![CDATA[Hi Folks, I&#8217;m speaking at the Future of Web Design this year in New York. The talk will be on the Future of HTML5, stuff coming down the line that we have to look forward to. All sorts of wicked &#8230; <a href="http://www.csskarma.com/blog/fowd2011/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hi Folks, I&#8217;m speaking at the <a href="http://futureofwebdesign.com/new-york-2011/speakers/#csskarma">Future of Web Design</a> this year in New York.</p>
<p>The talk will be on the Future of HTML5, stuff coming down the line that we have to look forward to. All sorts of wicked goodness right? I&#8217;m really looking forward to working with the folks at <a href="http://carsonified.com/">Carsonified</a>, who always put together a great conference. I personally attended the Future of Web Apps conference in 2010 (or &#8217;09 maybe?), when it was in Miami. It really was the best conference I&#8217;ve attended and it&#8217;s a great honor to be on the stage this year. The formats and venues are so unique and the speakers are so great and dynamic, it really will leave you wanting more.</p>
<p>They have an <a href="http://futureofwebdesign.com/new-york-2011/speakers/">amazing line up</a> coming to New York and a crazy-awesome <a href="http://futureofwebdesign.com/new-york-2011/schedule/">topic list</a>.</p>
<h3>My Talk Description</h3>
<p>HTML5 is evolving very quickly and staying on the bleeding edge can sometimes feel like a full-time job. In this session we&#8217;ll talk about what&#8217;s coming down the pipeline, discuss where we&#8217;re headed on the Web and dive into some hand-picked topics about the HTML5 hotness you can expect to use in the future.</p>
<p>Kinda awesome right? I love talking about that bleeding-edge stuff, you should totally come.</p>
<p>They&#8217;ll also be recording the sessions and I think the videos should be available later on (not sure on the time-frame for that).</p>
<p>Hope to see you there.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/fowd2011/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Changing History with HTML 5</title>
		<link>http://www.csskarma.com/blog/changing-history-with-html-5/</link>
		<comments>http://www.csskarma.com/blog/changing-history-with-html-5/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 13:49:30 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=953</guid>
		<description><![CDATA[Here&#8217;s the demo for those who like to jump right in. The URL is an important piece of user experience in any Web site or application. We like using, what we call &#8220;talking URLs&#8221; so they&#8217;re easy to say and &#8230; <a href="http://www.csskarma.com/blog/changing-history-with-html-5/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://www.csskarma.com/lab/html5/history">Here&#8217;s the demo</a></strong> for those who like to jump right in.</p>
<p>The URL is an important piece of user experience in any Web site or application. We like using, what we call &#8220;talking URLs&#8221; so they&#8217;re easy to say and remember, like <a href="http://clearleft.com/is/richardrutter/">clearleft.com/is/richardrutter</a> (one of the best all time).</p>
<p>But as we build complex ajax and javascript-base apps with wild interfaces, we sometimes forget about the URL and just how important it is.</p>
<p>The HTML 5 History API aims to deal with that problem by letting you access the address bar directly and create <em>pushes</em> to change the URL and inject (same domain) history into the browser.</p>
<h3>Feature detection</h3>
<p>Step 1 to using any of the new HTML 5 goodies is testing for support. The History API works where you would expect it to (Gecko &#038; Webkit, not sure about IE9). Testing for support is pretty basic:</p>
<h4>Regular JS</h4>
<pre><code>if (typeof history.pushState !== "undefined") {
    <span>//history api is supported</span>
}</code></pre>
<h4>With modernizr</h4>
<pre><code>if (Modernizr.history) {
     <span>// history api is supported</span>
}</code></pre>
<h3>The History Push</h3>
<pre><code>if (typeof history.pushState !== "undefined") {
     history.pushState([state to track], '[page title]', '[pushed URL]');
}</code></pre>
<h4>The pieces</h4>
<p><strong>State</strong>: This data will be passed into the &#8220;popstate&#8221;, which deal with things like when the user click the back button.</p>
<p><strong>Page title</strong>: This is the title that you see when you click and hold the back button (the menu that pops up) &#8211; not totally supported yet</p>
<p><strong>Pushed URL</strong>: this is the url you want to display in the address bar. It&#8217;s only limitation is that is has to be in the same domain (security).</p>
<h4>Worked out history push</h4>
<pre><code>if (typeof history.pushState !== "undefined") {
     history.pushState(null, 'I love dogs', 'dogsrock.html');
}</code></pre>
<p><strong><a href="http://www.csskarma.com/lab/html5/history">In this demo</a></strong>, you can see the URL changing but the page not reloading.</p>
<p>This is basically a slimmed down version of the <a href="http://diveintohtml5.org/history.html">Dive in HTML5</a> documentation with some modifications to the history code, I slimmed down the detection a bit.</p>
<p>As usual, any comments, questions, criticisms are welcome. I left the back button broken so you can see it actually working.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/changing-history-with-html-5/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Creating a Unique and Scalable Mobile Experience</title>
		<link>http://www.csskarma.com/blog/creating-a-unique-and-scalable-mobile-experience/</link>
		<comments>http://www.csskarma.com/blog/creating-a-unique-and-scalable-mobile-experience/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 13:41:43 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[speaking]]></category>
		<category><![CDATA[sxsw]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=965</guid>
		<description><![CDATA[A while ago I submitted a proposal for SXSW 2012 called Creating a Unique and Scalable Mobile Experience. I think it&#8217;s a good talk folks might be interested in, if you agree a vote my way would be much appreciated. &#8230; <a href="http://www.csskarma.com/blog/creating-a-unique-and-scalable-mobile-experience/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A while ago I submitted a proposal for SXSW 2012 called <a href="http://panelpicker.sxsw.com/ideas/view/8782">Creating a Unique and Scalable Mobile Experience</a>.</p>
<p>I think it&#8217;s a good talk folks might be interested in, if you agree a <a href="http://panelpicker.sxsw.com/ideas/view/8782">vote my way</a> would be much appreciated.</p>
<h3>Description</h3>
<p>Carrying the Web wherever you go is the future, we can all agree on that, but how do you plan for the future of a technology that is still in it&#8217;s relative infancy? This session will address how to make your mobile strategy scale to the future. Should we be building for specific devices? Should be be building for the Web? What technologies should we be using to create a unique and memorable experience? We will talk about how to design and develop with scalability in mind from the start so we don&#8217;t hit roadblocks along the way which can not only derail a project but create long term problems and scope creep that can damage the user experience. We&#8217;ll also talk about jQuery, HTML5, CSS3, performance and how it all fits into the overall picture. You will hopefully leave this session with the knowledge to create a framework for the future of your portable-Web strategy while saving development, design, maintenance, and buckets of cash in the process.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/creating-a-unique-and-scalable-mobile-experience/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML 5 Form Validation with Yepnope Fallback</title>
		<link>http://www.csskarma.com/blog/form-validate-yepnope-fallback/</link>
		<comments>http://www.csskarma.com/blog/form-validate-yepnope-fallback/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 13:39:03 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=940</guid>
		<description><![CDATA[In my last post about creating a proper fallback when using the new HTML 5 form validation I mentioned using modernizr to detect for support, then creating an if statement to call the jQuery validate plugin. One of the commentors &#8230; <a href="http://www.csskarma.com/blog/form-validate-yepnope-fallback/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://www.csskarma.com/blog/required-input-fallback/" title="Required input fields with JS fallback">last post</a> about creating a proper fallback when using the new HTML 5 form validation I mentioned using modernizr to detect for support, then creating an if statement to call the jQuery validate plugin.</p>
<p>One of the commentors mentioned using yepnope for this instead of loading the jQuery validation plugin by default. Since modernizr has yepnope now anyway, I thought it was a good idea. And here we are with some ne code to look at.</p>
<p><a href="http://www.csskarma.com/lab/_javascript/no_require/">View the demo</a></p>
<h3>Dependencies</h3>
<ul>
<li><a href="http://www.jquery.com">jQuery</a></li>
<li><a href="http://www.modernizr.com/">Modernizr (with yepnope)</a></li>
<li><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validate plugin</a></li>
</ul>
<h3>The HTML</h3>
<pre><code>&lt;form action="" method="post"&gt;

    &lt;ul&gt;
        &lt;li&gt;
            &lt;label for="name"&gt;Name&lt;/label&gt;
            &lt;input type="text" name="name" id="name" required&gt;
        &lt;/li&gt;
        
        &lt;li&gt;
            &lt;label for="email"&gt;Email&lt;/label&gt;
            &lt;input type="email" name="email" id="email" required&gt;
        &lt;/li&gt;
    
        &lt;li&gt;
            &lt;button type="submit"&gt;Submit&lt;/button&gt;
        &lt;/li&gt;
    &lt;/ul&gt;
    
&lt;/form&gt;</code></pre>
<h3>The JS</h3>
<pre><code>(function ($) {

	<span>// set and cache some variables, change var forms to whatever forms you want to validate</span>
	var forms = $('form'),
		formsCount = forms.length,
		items = forms.find('input[required]'),
		count = items.length;

	<span>// check for "required" input support with modernizr</span>
	if (Modernizr.input.required) {

		<span>// do something else, maybe customize the output messages?</span>

	} else {

		<span>// loop though each required input and set the required and type class jQuery validate needs</span>
		for (var i = 0; i < count; i += 1) {
			var obj = items[i];
			$(obj).attr('class', 'required ' + obj.getAttribute('type')).removeAttr('required');
		};

		<span>// after the classes are set, load in the plugin with yepnope , you can do this with Modernizr.load as well</span>
		yepnope([{
			load: 'js/validate.js',
			complete: function () {

				<span>// after the plugin is loaded, call the method on each form listed at the top</span>
				for (var i = 0; i < formsCount; i += 1) {
					$(forms[i]).validate();
				}
			}
		}]);

	} <span>// if required supported</span>

}(jQuery));
</code></pre>
<p>I&#8217;m not really a fan of script loaders, especially when using them to load a core script file, like jQuery, but I think this is actually a pretty good use of yepnope.</p>
<p>I don&#8217;t know about you folk(s), but I&#8217;ll be using this moving forward. Any comments/corrections are obviously welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/form-validate-yepnope-fallback/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Required input fields with JS fallback</title>
		<link>http://www.csskarma.com/blog/required-input-fallback/</link>
		<comments>http://www.csskarma.com/blog/required-input-fallback/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 01:22:26 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=924</guid>
		<description><![CDATA[View the demo One of my favorite features of the HTML 5 forms is the &#8220;required&#8221; attribute. But unfortunately, support isn&#8217;t totally there yet. So we need to create fallbacks. It works in the modern browsers you&#8217;d expect it to &#8230; <a href="http://www.csskarma.com/blog/required-input-fallback/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.csskarma.com/lab/html5/input.required/">View the demo</a></p>
<p>One of my favorite features of the HTML 5 forms is the &#8220;required&#8221; attribute. But unfortunately, support isn&#8217;t totally there yet. So we need to create fallbacks.</p>
<p>It works in the modern browsers you&#8217;d expect it to (FF4, Safari, Opera, etc) but in older browsers, form validation isn&#8217;t something you can really ignore (like border-radius) or you&#8217;ll get flooded with all sorts of nastiness and spam. Sure we should be doing it at the server level anyway, but you still want that client side layer to add a bit of UX charm to your form.</p>
<p>We can still use the new required attribute effectively by creating a JavaScript fallback for unsupported browsers.</p>
<p>In this <a href="http://www.csskarma.com/lab/html5/input.required/">demo</a>, I&#8217;m using:</p>
<ul>
<li><a href="http://jquery.com/">jQuery</a></li>
<li><a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation</a></li>
<li><a href="http://www.modernizr.com/">Modernizr</a></li>
</ul>
<h3>The HTML</h3>
<p>The HTML is very basic, just an HTML5 form, with 2 inputs: text (name), and email (email). I&#8217;m using 2 form types to show how we add classes to support the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery Validation</a>. You can, of course, use whatever validation method you&#8217;d like.</p>
<pre><code>&lt;form action=&quot;&quot; method=&quot;post&quot;&gt;
&lt;label for=&quot;name&quot;&gt;Name&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;name&quot; id=&quot;name&quot; required&gt;

&lt;label for=&quot;email&quot;&gt;Email&lt;/label&gt;
&lt;input type=&quot;email&quot; name=&quot;email&quot; id=&quot;email&quot; required&gt;

&lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;
&lt;/form&gt;</code></pre>
<h3>The JavaScript</h3>
<p>With the JavaScript, we first make the check for &#8220;required&#8221; support. I&#8217;m using <a href="http://www.modernizr.com/">Modernizr</a> for this.</p>
<p>I left an open block in the if statement in case you want to do something else in there, but you could remove the <code>else</code> and replace the first line with it&#8217;s inverse <code>if (!Modernizr.input.required) {</code> if you don&#8217;t plan on using it for anything.</p>
<p>If &#8220;required&#8221; isn&#8217;t supported I&#8217;m running through all the form inputs on the page with a &#8220;required&#8221; attribute, adding a class of &#8220;required&#8221;, and the type of input (email, text, etc.). Setting the input type helps you use the validation plugin a little better and can also aid in styling for IE6.</p>
<p><strong>NOTE:</strong> I&#8217;m using JavaScript&#8217;s native getAttribute() method to grab the input type because  jQuery&#8217;s <code>attr('type')</code> returns &#8220;text&#8221; on the &#8220;email&#8221; input for some reason.</p>
<p>After all the appropriate classes are added, we can call the plugin. I&#8217;m doing it on each form, but targeting one specific form by it&#8217;s ID value is more traditional.</p>
<pre><code>(function ($) {

	<span>// check for "required" input support with modernizr</span>
	if (Modernizr.input.required) {

		<span>// do something else</span>

	} else {

		<span>// parse through each required input</span>
		$('form').find('input[required]').each(function () {

			<span>// add a class to each required field with "required" &#038; the input type</span>
			<span>// using the normal "getAttribute" method because jQuery's attr always returns "text"</span>
			$(this).attr('class', 'required ' + this.getAttribute('type')).removeAttr('required');

		});

		<span>// call jQuery validate plugin on each form</span>
		$('form').each(function () {
			$(this).validate();
		});

	}<span> // if required supported</span>

}(jQuery));</code></pre>
<p>Older (unsupported) browsers will use the Validation plugin, and modern browsers will use the built-in HTML 5 validation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/required-input-fallback/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Book Review: The Book of CSS3</title>
		<link>http://www.csskarma.com/blog/review-book-of-css3/</link>
		<comments>http://www.csskarma.com/blog/review-book-of-css3/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 20:17:20 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://www.csskarma.com/blog/?p=918</guid>
		<description><![CDATA[I started reading Peter Gasston&#8217;s &#8220;The Book of CSS3&#8243; about a month ago and finally had time to finish it up this weekend. Here are my thoughts. I&#8217;d like to preface my thoughts here with a saying that the publisher &#8230; <a href="http://www.csskarma.com/blog/review-book-of-css3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I started reading <a href="http://twitter.com/#!/stopsatgreen/">Peter Gasston&#8217;s</a> &#8220;The Book of CSS3&#8243; about a month ago and finally had time to finish it up this weekend. <strong>Here are my thoughts.</strong></p>
<p>I&#8217;d like to preface my thoughts here with a saying that the publisher did send me a free copy of the book with the intention of writing up a review somewhere. However, if I thought the book was crap I would have sent it right back. You can be assured that it&#8217;s a quality book and appears to be targeting at a mid-level CSS-minded designer/developer.</p>
<p>If you don&#8217;t want to read through the whole review, I&#8217;d recommend scanning the chapter listing and if there&#8217;s anything that you need real work on, go ahead and buy it. I will say that even in something I&#8217;m researching quite a bit about, I did learn elements of media queries that I didn&#8217;t know beforehand.</p>
<h3>Chapter Listing</h3>
<ol>
<li>Introducing CSS3</li>
<li>Media Queries</li>
<li>Selectors</li>
<li>Pseudo-classes and Pseudo-elements</li>
<li>Web Fonts</li>
<li>Text Effects and Typographic Styles</li>
<li>Multiple Columns</li>
<li>Background Images</li>
<li>Border and Box effects</li>
<li>Color and Opacity</li>
<li>Gradients</li>
<li>2D Transformations</li>
<li>Transitions and Animations</li>
<li>3D Transformations</li>
<li>Flexible Box Layout</li>
<li>Template Layout</li>
<li>The Future of CSS</li>
</ol>
<h3>Overall Content Structure</h3>
<p>I really liked the chapter order for the book, it made pretty good sense. Starting off with some basic things like selectors and pseudo-classes/elements; the things that are basically &#8220;hey, this is what this looks like&#8221;. There isn&#8217;t a whole lot you can say about CSS selectors, believe me,<a href="http://www.sitepoint.com/article/tomorrows-css-today"> I&#8217;ve tried</a>.</p>
<p>Many of the selectors mentioned in the book have been around for a very long time (in Web years), and to be honest, I was confident that they where actually in the original spec for CSS 2.1. That was a small point of confusion.</p>
<p>However out of place in the overall flow, I did much prefer the chapter on media queries being so far in the front (Ch. 2). After the introduction is seemed like it was amping up to be one of those books where you don&#8217;t get to the really cool stuff until the end, and by the time you&#8217;re there, your tired of reading.</p>
<p>There are a lot of surprisingly basic things to cover in CSS3 and I think Peter did a good job of architecting the information in a meaningful manner.</p>
<h3>Things I Really Liked</h3>
<p>I really liked the chapter on media queries and Peter&#8217;s writing style; he made everything pretty easy to follow.</p>
<p>The chapter on WebFonts included very current examples like the <a href="http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/">bullproof @font-face syntax</a>, which makes the book seem very timely.</p>
<h3>Stuff I didn&#8217;t find super-useful</h3>
<p>Being completely honest, I&#8217;m tried of hearing about the <a href="http://www.w3.org/TR/2010/WD-css3-layout-20100429/">template layout model</a>. I first read about it in Andy Clarke&#8217;s Transcending CSS book&#8230; 4 years ago (?). It&#8217;s very cool, and kinda rocks, but being at a point where we can&#8217;t get border radius and gradient working in all browsers, it&#8217;s a far shot away to start using a new layout model.</p>
<p>The gradient chapter is a little out of date (I think the webkit syntax is changing), but that&#8217;s what happens with books; they get old pretty fast. Other than that there isn&#8217;t a whole lot negative about the book. It&#8217;s a little late to the game in regards to how long we&#8217;ve been dealing with CSS3, but that also means the information is pretty solidified.</p>
<h3>Conclusion</h3>
<p>Overall, I did really like the book. It was well written and put together in a unique way. I am however torn in telling you if you should go out and buy it right now because I sort of feel like we&#8217;ve all being practicing most of the techniques in the book for a long time. I found myself getting a little bored at times reading about the color formats, selectors and older things like that.</p>
<p>If you&#8217;re like me, you&#8217;re really reading a book like this for the cutting edge elements that haven&#8217;t been blogged about over and over again (chapters 13-17) and you don&#8217;t want to read through the CSS3 spec (and you shouldn&#8217;t, because it&#8217;s awful). Those chapters are actually very good and give you a strong base in what&#8217;s coming down the pipe. You can also use the other chapters to tighten up your general CSS3 knowledge.</p>
<p>I almost feel like I wasn&#8217;t the real target audience for the book, but with that being said, I did still learn enough stuff to justify the price tag. <strong>So should you buy it?</strong> Yea, you should buy it.</p>
<p>Also, I really like the cover art.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.csskarma.com/blog/review-book-of-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

