<?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>Tue, 31 Jan 2012 15:18:44 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <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 variations in how 2 devices (Galaxy  Tab and Kindle Fire given as examples in the [...]]]></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 and who&#8217;s going to stop me? That&#8217;s right, here we go&#8230; Some of my favorite [...]]]></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 goodness right? I&#8217;m really looking forward to working with the folks at Carsonified, who always [...]]]></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 remember, like clearleft.com/is/richardrutter (one of the best all time). But as we build complex ajax [...]]]></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. Description Carrying the Web wherever you go is the future, we can all agree on [...]]]></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 mentioned using yepnope for this instead of loading the jQuery validation plugin by default. Since [...]]]></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 (FF4, Safari, Opera, etc) but in older browsers, form validation isn&#8217;t something you can really [...]]]></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 did send me a free copy of the book with the intention of writing up [...]]]></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> <item><title>Send it through Twitter</title><link>http://www.csskarma.com/blog/twitterfeed/</link> <comments>http://www.csskarma.com/blog/twitterfeed/#comments</comments> <pubDate>Tue, 24 May 2011 12:47:50 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[social]]></category> <category><![CDATA[lastfm]]></category> <category><![CDATA[music]]></category> <category><![CDATA[pandora]]></category> <category><![CDATA[sharing]]></category> <category><![CDATA[twitter]]></category> <category><![CDATA[youtube]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=911</guid> <description><![CDATA[I get a lot of questions about how I share articles on Twitter, so I though I would just write it up real quick since I just synced up some more accounts to my stream. I do most of my article gathering through Google Reader, which has a &#8220;share&#8221; option at the bottom of each [...]]]></description> <content:encoded><![CDATA[<p>I get a lot of questions about how I share <a
href="https://twitter.com/#!/csskarma/status/72737431920713728">articles on Twitter</a>, so I though I would just write it up real quick since I just synced up some more accounts to my stream.</p><p>I do most of my article gathering through <a
href="http://google.com/reader">Google Reader</a>, which has a &#8220;share&#8221; option at the bottom of each article you read. If you follow me on Google, you probably get these articles in the &#8220;shared by others&#8221; category, but for those of you who don&#8217;t, I use the RSS feed of shared items that Reader puts out piped through an RSS to Twitter service (personally, I use <a
href="http://twitterfeed.com">TwitterFeed</a>).</p><p>It&#8217;s not a perfect service, it will only push out articles every 30mins or so, but I find it more than adequate for my purposes. If something really great comes along and TwitterFeed isn&#8217;t an option, I sometimes push it out by hand to Twitter. And I actually think the 30mins delay is a good buffer so I don&#8217;t flood anyone&#8217;s Twitter stream with articles.</p><p>Google Reader also has a bookmarklet for things you want to share that&#8217;s outside your subscriptions. It&#8217;s very nice, I highly recommend it. You can get the RSS feed and &#8220;Note in Reader&#8221; bookmarklet from the &#8220;<a
href="http://twitpic.com/20tk6e">Share</a>&#8221; tab down the left side of the page.</p><p>That&#8217;s how you get the Tweets formatted like &#8220;Currently reading&#8221; and &#8220;From CSSKarma&#8221;. I also recently hooked up Pandora, LastFM and YouTube to the services&#8230; so look out.</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/twitterfeed/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Setting up shortcuts in Terminal</title><link>http://www.csskarma.com/blog/shortcuts-in-terminal/</link> <comments>http://www.csskarma.com/blog/shortcuts-in-terminal/#comments</comments> <pubDate>Fri, 20 May 2011 12:33:01 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Development]]></category> <category><![CDATA[terminal]]></category> <category><![CDATA[unix]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=907</guid> <description><![CDATA[Let me just start off my saying I hate using the command line. That being said, I&#8217;m all for making the experience tolerable with a few tweaks. Today I set up some aliases in Terminal so I don&#8217;t have to remember some of the weirder commands I use often. I thought I&#8217;d share the process [...]]]></description> <content:encoded><![CDATA[<p>Let me just start off my saying <strong>I hate using the command line</strong>.</p><p>That being said, I&#8217;m all for making the experience tolerable with a few tweaks. Today I set up some aliases in Terminal so I don&#8217;t have to remember some of the weirder commands I use often.</p><p>I thought I&#8217;d share the process for my fella command line haters / mac users.</p><h3>The process</h3><p>In your home directory, there&#8217;s a file name <tt>.profile</tt>. It&#8217;s hidden from the finder by default so you can get to it a few different ways:</p><ul><li>use a program that displays hidden files (like <a
href="http://www.macupdate.com/app/mac/26729/houdini">Houdini</a>)</li><li>Navigate to it through a text editor (I use <a
href="http://www.panic.com/coda/">coda</a>)</li><li>Open terminal and type <tt>cd ~</tt>, then press enter</li></ul><p>Once you find it, open the file, it&#8217;s probably blank. If you&#8217;re in terminal you&#8217;d type <tt>vi .profile</tt>, then <tt>i</tt> to being editing.</p><p>Alias syntax goes like this: &#8220;<tt>alias [alias name]='[really long normal command]'</tt>&#8221;</p><p>And you&#8217;d put one per line. For example, my .profile file currently looks like this:</p><pre><code>alias ..= 'cd ..'
alias ll='ls -al'
alias ls='ls -l'
alias home='cd ~</code></pre><p>So if I want to navigate to my home directory I type &#8220;home&#8221; rather than &#8220;cd ~&#8221;. A small addition (and actually the same character count), but as you use these more and more to customize your environment you&#8217;ll see how much time and frustration you can save.</p><p>Anyway, save that file, restart terminal, and you&#8217;re good to go.<br
/> If you&#8217;re doing all this in terminal first hit [esc] to exit edit mode, then type <tt>:wq</tt> to save your changes.</p><p>Hope that helps some folks, I know it helps me, and I like posting stuff like this if for nothing else but having a place I can remember to go to find it.</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/shortcuts-in-terminal/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 2/11 queries in 0.024 seconds using disk: basic

Served from: www.csskarma.com @ 2012-02-04 00:19:02 -->
