<?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 &#187; Web Design</title> <atom:link href="http://www.csskarma.com/blog/category/web-design/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>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>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>Media Query Transition Animations</title><link>http://www.csskarma.com/blog/media-animations/</link> <comments>http://www.csskarma.com/blog/media-animations/#comments</comments> <pubDate>Wed, 11 May 2011 22:38:21 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Design]]></category> <category><![CDATA[animation]]></category> <category><![CDATA[css3]]></category> <category><![CDATA[quick tip]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=904</guid> <description><![CDATA[I&#8217;ve been doing a lot with Responsive Design, Media Queries (yea, they&#8217;re different), and light transitions with CSS 3 lately and something kind of cool happened. By sheer accident I put a transition inside a media query, resized my window and watch the padding on my &#60;article&#62; element animate to it&#8217;s new value. It was [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been doing a lot with <a
href="http://www.alistapart.com/articles/responsive-web-design/">Responsive Design</a>, Media Queries (yea, they&#8217;re different), and light transitions with CSS 3 lately and something kind of cool happened. By sheer accident I put a transition inside a media query, resized my window and watch the padding on my <code>&lt;article&gt;</code> element animate to it&#8217;s new value.</p><p>It was way cool. check out a quick <a
href="http://www.csskarma.com/lab/media-animations/">demo I threw together</a>.</p><p>I inserted 2 breakpoints in the demo. One at 800px and another at 480px, so you should see the design adjust twice.</p><h2>The CSS</h2><pre><code>header h1 a,
article h1,
article h2,
article{
     -moz-transition: all .5s linear;
     -webkit-transition: all .5s linear;
     transition: all .5s linear;
}
</code></pre><p>Put that in with the base CSS (not the media query) and you&#8217;ll get a nice animation effect as you resize the browser window.</p><p>You can&#8217;t animate all the properties, but things like: color, margin, padding, color, font-size, etc are all fair game. I&#8217;ve mostly been using transitions for softening hover effect lately, but I think this, if tastefully done, can be a nice hidden (and light weight) gem.</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/media-animations/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>CSS Performance and OOCSS</title><link>http://www.csskarma.com/blog/css-performance-and-oocss/</link> <comments>http://www.csskarma.com/blog/css-performance-and-oocss/#comments</comments> <pubDate>Mon, 18 Apr 2011 13:49:11 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Design]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[performance]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=896</guid> <description><![CDATA[I&#8217;m in the process right now of signing on for my first speaking gig in since I moved to Boston (thanks to @joedevon) and it got me thinking about performance in CSS; a topic I really haven&#8217;t address in years since I started using my single-line CSS formatting style. Tip: use spaces rather than tabbing [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m in the process right now of signing on for my first speaking gig in since I moved to Boston (thanks to <a
href="http://twitter.com/joedevon" rel="friend colleague">@joedevon</a>) and it got me thinking about performance in CSS; a topic I really haven&#8217;t address in years since I started using my <a
href="http://csskarma.com/css/csskarma.css" rel="me">single-line CSS formatting style</a>. <strong>Tip:</strong> use spaces rather than tabbing to maintain the alignment across different software since they all treat the &#8220;tab&#8221; differently.</p><p>But I digress.</p><h3>CSS Performance</h3><p>We&#8217;ve all seen the mass of articles &amp; tutorials about <a
href="http://www.youtube.com/watch?v=mHtdZgou0qU">JavaScript performance</a>, how to <a
href="http://www.alfajango.com/blog/the-difference-between-jquerys-bind-live-and-delegate/">optimize jQuery</a>, and the <a
href="http://jsperf.com/browse">JS Performance test suite</a>. The market is flooded, ok, we get it. JavaScript is a beast of the Web that needs to be constantly tamed. It&#8217;s getting better, especially with lightning-fast JS engine , <a
href="http://code.google.com/p/v8/">V8</a> looming around in Chome and NodeJS.</p><p>CSS performance is constantly overshadowed by JS performance (and rightly so), but that doesn&#8217;t mean we shouldn&#8217;t at least take a look at it every now-and-then as a form of checks and balances for our front-end code. After all, something like <a
href="http://developer.yahoo.com/performance/rules.html">90% of the load time for a site happens on the front-end</a> and unless you&#8217;re Google, it&#8217;s probably not <em>all</em> JavaScript (little bit of a big there, sorry fellas).</p><h3>OOCSS</h3><p>Object Oriented CSS goes a little like this:</p><h4>The CSS</h4><pre><code>.rounded{ border-radius:7px; }
.box-shadow{ -moz-box-shadow:0 2px 2px #333;box-shadow:0 2px 0 #333; }
.left{ float:left; }</code></pre><h4>The HTML</h4><pre><code>&lt;div class=&quot;rounded box-shadow left&quot;&gt;&lt;/div&gt; &lt;!--/.rounded .box-shadow .left--&gt;</code></pre><p>You&#8217;re basically just separating out the individual properties you&#8217;ll be using and modifying the HTML to reflect them. It&#8217;s very similar to a framework model in building and styling a site.</p><p>Whether you like it or not, there it is. There&#8217;s a lot of debate over this method, pluses and minuses, loves and hates. The most popular argument against it is that you&#8217;re embedding style information into your HTML and semi-collapses the progressive enhancement model of structure &mdash; presentation &mdash; behavior.</p><p>It&#8217;s tough for me to totally buy into OOCSS for that reason. I stick very closely to progressive enhancement while I&#8217;m building a site and really only stray from that when I&#8217;m styling for a CMS and I need classes like: &#8220;left&#8221;, &#8220;right&#8221;, &#8220;clear&#8221;, etc., which get applied by the user later on.</p><p>So, when styling for use in a CMS, I really do think OOCSS is dead-on. I&#8217;ve yet to fully use it just because I question it&#8217;s maintainability. But from a strictly performance stand point: <strong>Is OOCSS better?</strong> Yea, it&#8217;s better. <a
href="http://www.shauninman.com/archive/2008/05/05/css_qualified_selectors#comment_3940">It does perform better across the board</a> than almost all of the CSS selectors (especially the advanced ones).</p><h3>Lastly, on performance</h3><p>We can all go through ySlow and JSLint to see where we may have some front-end memory leaks but getting down to the granularity of the way we&#8217;re constructing a page (OOCSS vs. non-OOCSS) is tough without running the explicit performance tests.</p><p>As the Web gets more and more advanced and browsers like Chrome pave the way for faster sites, I have no idea what the real answer for CSS performance is, but I do know that <strong>browsers will not help you write better code</strong>. We still need to explore the best practices, be it front-end, back-end or somewhere in the middle.</p><p>I&#8217;d like to get into this in more detail, but I have a group of tourists screaming at eachother in French next to me (trying out a new coffee shop), so I defer to the comments if you&#8217;re at all interesting in the OOCSS debate.</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/css-performance-and-oocss/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Quick Tip on Global Scope and jQuery</title><link>http://www.csskarma.com/blog/global-scope-jquery/</link> <comments>http://www.csskarma.com/blog/global-scope-jquery/#comments</comments> <pubDate>Fri, 08 Apr 2011 12:34:29 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Design]]></category> <category><![CDATA[javascript]]></category> <category><![CDATA[jquery]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=890</guid> <description><![CDATA[Before launch of a new site, I always take the time to run my JavaScript through a checker. Personally, I use JS Lint. It&#8217;s not the prettiest thing, but it works great to pick up small errors and elements of bad practice. You&#8217;ll get alerts like &#8220;unused variable&#8221;, &#8220;don&#8217;t use eval(), it&#8217;s evil&#8221;, &#8220;implied global&#8221;. [...]]]></description> <content:encoded><![CDATA[<p>Before launch of a new site, I always take the time to run my JavaScript through a checker. Personally, I use <a
href="http://jslint.com/">JS Lint</a>. It&#8217;s not the prettiest thing, but it works great to pick up small errors and elements of bad practice. You&#8217;ll get alerts like &#8220;unused variable&#8221;, &#8220;don&#8217;t use eval(), it&#8217;s evil&#8221;, &#8220;implied global&#8221;.</p><p>I find that it&#8217;s best not to argue with JS Lint, just fix the problem.</p><p>One that I had encountered quite a bit while running jQuery through JS Lint was &#8220;Implied global: $&#8221;.</p><p>Up until a week or two ago, I was just blowing it off, because, I mean, come on, it&#8217;s a $, it kind of is global when using jQuery. For whatever reason I had a quick talk with <a
href="http://twitter.com/akira_x">@akira_x</a> and we figured out what was going on and how to fix it.</p><p>The solution is actually similar to how we build jQuery plugins, but without the real plugin model, just normal site code.</p><h3>Evolution of the the document.ready</h3><p>When jQuery first came out, this is how we would used document.ready as a wrapper for custom jQuery:</p><pre><code>$(document).ready(function() {
// jquery code here
 });</code></pre><p>Then we moved on to the short cut method:</p><pre><code>$(function(){
// jquery code here
});</code></pre><p>Both of these methods are technically fine, but they both leave &#8220;$&#8221; as an implied global. This may not be an issue for most of us since we only use jQuery, so who really cares is $ is global, right?</p><p>We can, however make sure (just in case, because we&#8217;re all good coders) that there are no future library or JavaScript collisions by containing the scope of $ with:</p><pre><code>(function($) {
	// jquery here
}(jQuery));</code></pre><p>This will still cause JS Lint to throw an &#8220;implied global&#8221; alert, but it will be for &#8220;jQuery&#8221; rather than &#8220;$&#8221;. Personally, I feel like it&#8217;s better.</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/global-scope-jquery/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Scalable Design Teaser</title><link>http://www.csskarma.com/blog/teaser-scalable-design/</link> <comments>http://www.csskarma.com/blog/teaser-scalable-design/#comments</comments> <pubDate>Mon, 28 Mar 2011 12:34:25 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Design]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=882</guid> <description><![CDATA[I want to tell you a story about 95% of design work currently being outputted for the Web and why it doesn&#8217;t scale. First off, I feel like I need to explain what a scaling design is exactly. It doesn&#8217;t make a whole lot of sense since the term &#8220;scalability&#8221; is tied pretty closely to [...]]]></description> <content:encoded><![CDATA[<p>I want to tell you a story about 95% of design work currently being outputted for the Web and why it doesn&#8217;t scale.</p><p>First off, I feel like I need to explain what a scaling design is exactly. It doesn&#8217;t make a whole lot of sense since the term &#8220;scalability&#8221; is tied pretty closely to back end work. When you hear it you think of large elaborate databases, PHP frameworks, cloud computing and high traffic web sites. Not this time though; the scalability of a web site based on traffic, has little or nothing to do with the actual design comp. Of course your code needs to be efficient, but what about your designs?</p><p>If I promised you that overall development time can be cut in half with a little forward thinking, would you be interested in something like that? I know I would.</p><p>It&#8217;s not desktop vs. mobile.<br
/> It&#8217;s not designing mobile-first.<br
/> It&#8217;s not responsive Web design.</p><p>It&#8217;s knowing how to design a scalable web site, a skill that for some reason is escaping many of us&#8230; stay tuned for the story.</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/teaser-scalable-design/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Adapting an Interface for Touch Devices</title><link>http://www.csskarma.com/blog/adapting-an-interface-for-touch-devices/</link> <comments>http://www.csskarma.com/blog/adapting-an-interface-for-touch-devices/#comments</comments> <pubDate>Thu, 04 Nov 2010 16:23:13 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Design]]></category> <category><![CDATA[article]]></category> <category><![CDATA[sitepoint]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=861</guid> <description><![CDATA[Just a quick heads up that I have a new article out on SitePoint. It&#8217;s called &#8220;Adapting an Interface for Touch Devices&#8220;. It introduces a new technique called &#8220;Touch detection&#8221; for building rich interactions on both touch and non-touch devices. I also gave a talk at Cascade LA a couple weeks ago called &#8220;Mobile, Media, [...]]]></description> <content:encoded><![CDATA[<p>Just a quick heads up that I have a new article out on SitePoint. It&#8217;s called &#8220;<a
href="http://articles.sitepoint.com/article/adapting-an-interface-for-touch-devices">Adapting an Interface for Touch Devices</a>&#8220;. It introduces a new technique called &#8220;Touch detection&#8221; for building rich interactions on both touch and non-touch devices.</p><p>I also gave a talk at <a
href="http://www.cascadela.com/calendar/14805000/?action=detail&#038;eventId=14805000">Cascade LA</a> a couple weeks ago called &#8220;Mobile, Media, &amp; Touch&#8221; on the same topic (it actually goes into a little more depth). You can <a
href="http://www.slideshare.net/csskarma/mobile-media-touch">view the slides on slideshare</a></p><p>Let me know what you think!</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/adapting-an-interface-for-touch-devices/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Books that made me a better designer</title><link>http://www.csskarma.com/blog/books/</link> <comments>http://www.csskarma.com/blog/books/#comments</comments> <pubDate>Fri, 07 May 2010 17:46:26 +0000</pubDate> <dc:creator>Tim</dc:creator> <category><![CDATA[Web Design]]></category> <category><![CDATA[ajax]]></category> <category><![CDATA[books]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[learning]]></category> <category><![CDATA[mobile]]></category> <category><![CDATA[sketching]]></category> <category><![CDATA[ui]]></category><guid
isPermaLink="false">http://www.csskarma.com/blog/?p=819</guid> <description><![CDATA[This is a list of books that have had a big impact on the way I design &#38; developer Web sites. A lot of the content in books now-a-days can be found on various blogs, but the books below all have something in them that I really haven&#8217;t been able to find anywhere else. Transcending [...]]]></description> <content:encoded><![CDATA[<p>This is a list of books that have had a big impact on the way I design &amp; developer Web sites. A lot of the content in books now-a-days can be found on various blogs, but the books below all have something in them that I really haven&#8217;t been able to find anywhere else.</p><div
class="book"><h3>Transcending CSS</h3><p><img
src="http://www.csskarma.com/images/transcendingcss.jpg" alt="Transcending CSS book cover" /></p><p
class="author"><a
href="http://www.stuffandnonsense.co.uk/">Andy Clarke</a></p><p
class="desc">Andy&#8217;s book is obviously very technically good and well written. I certainly got a lot of information like that out of it, but at this point you can find most of it on various blogs. My biggest take away was how Andy spoke about semantics. Specifically using IDs like &#8220;branding&#8221; and &#8220;site-info&#8221; rather than &#8220;header&#8221; and &#8220;footer&#8221;. Up to that point I had just been using &#8220;header&#8221; and &#8220;footer&#8221; because it was how it was done at the time. Andy got me thinking heavily about semantics and naming schema and also opened up a lot of doors for me to really examine how I put together a site instead of blindly do it because it&#8217;s what I&#8217;ve heard is the best.</p></div><p>&nbsp;</p><div
class="book"><h3>Bulletproof Ajax</h3><p><img
src="http://www.csskarma.com/images/bulletproofajax.jpg" alt="Bulletproof Ajax book cover" /></p><p
class="author"><a
href="http://adactio.com/">Jeremy Keith</a></p><p
class="desc">I read this book right around the time I began playing with <a
href="http://jquery.com">jQuery</a> and it made me realize that, however great a library like jQuery may be, it won&#8217;t be around forever and if I don&#8217;t learn how it really works, I&#8217;ll be screwed when it finally disappears like so many other Web technologies. In <em>Bulletproof Ajax</em> I learned how exactly the XMLHTTPRequest worked, what jQuery was doing, and how it made it so easy to work with, all while keeping Web standards in sight and never putting something together that couldn&#8217;t function without JavaScript.</p></div><p>&nbsp;</p><div
class="book"><h3>101 Things I Learned in Architecture School</h3><p><img
src="http://www.csskarma.com/images/101things.jpg" alt="101 Things I Learned in Architecture School book cover" /></p><p
class="author"><a
href="http://www.frederickdesignstudio.com/">Matthew Frederick</a></p><p
class="desc">Drawing lines seems like a stupid thing to want to learn, but that&#8217;s what this book effectively taught me. I learned the importance of some very basic design principles and how to effectively communicate those ideas to others through certain shapes and sketching techniques. <strong>This is a great book</strong>. I really got into it after a talk by <a
href="http://www.lukew.com/">Luke Wroblewski</a> at the Web App Summit in Newport Beach.</p></div><p>&nbsp;</p><div
class="book"><h3>Mobile Web Design</h3><p><img
src="http://www.csskarma.com/images/mobilewebdesign.jpg" alt="Mobile Web Design book cover" /></p><p
class="author"><a
href="http://cameronmoll.tumblr.com/">Cameron Moll</a></p><p
class="desc">The first book to really spark my interest in the Mobile Web. Ever since reading it I&#8217;ve felt like I have a slight edge whenever beginning a project with mobile requirements. Most mobile books now focus on intense graphics and acceleration of devices like the iPhone. In <em>Mobile Web Design</em>, Cameron talks about a plethora of devices and focuses on Web standards rather than cool things you can do.</p></div><p>Obviously, I highly recommend all those these books, as they&#8217;ve had a pretty large impact on me as a designer &amp; a developer. The best part about them is that they&#8217;re all pretty easy reads, they&#8217;re not the kind of books you have to spend a week or 2 reading.</p><p>Does anyone else have books like this? Or do we all just read blogs now?</p> ]]></content:encoded> <wfw:commentRss>http://www.csskarma.com/blog/books/feed/</wfw:commentRss> <slash:comments>1</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 7/15 queries in 0.087 seconds using disk: basic

Served from: www.csskarma.com @ 2012-02-09 16:56:53 -->
