<?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>Les James &#124; Design &#38; Stuff &#187; css3</title>
	<atom:link href="http://lesjames.com/tag/css3/feed/" rel="self" type="application/rss+xml" />
	<link>http://lesjames.com</link>
	<description>Les James is a web designer and beer fan. CSS and brown ales make him happy.</description>
	<lastBuildDate>Wed, 04 Aug 2010 19:09:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Cross Browser Techniques for Progressive Enhancement</title>
		<link>http://lesjames.com/417/cross-browser-progressive-enhancement/</link>
		<comments>http://lesjames.com/417/cross-browser-progressive-enhancement/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 19:09:43 +0000</pubDate>
		<dc:creator>Les</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[cross browser]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://lesjames.com/?p=417</guid>
		<description><![CDATA[Techniques I'm currently using to ensure that CSS3 and HTML5 are cross browser compliant.]]></description>
			<content:encoded><![CDATA[<p class="comment">/* The following is some documentation I wrote for a project I&#8217;m working on. I thought it might be worth sharing.*/</p>
<p>Although most of the concern with site compatibility lies with Internet Explorer most of the concepts we are using can be applied to any browser. Areas of concern include are CSS, HTML5 and JavaScript. We address cross browser compatibility with each of these in Product X using various techniques.</p>
<p><strong>CSS</strong></p>
<p>It&#8217;s common practice in web design to include browser specific style sheets for Internet Explorer compatibility. The problem is that style sheet conditional statements only work for Internet Explorer and are not conducive to style sheet aggregation. In Product X we take browser specific style to the next level with class based browser styles. We use a small JavaScript plug-in called <a href="http://rafael.adm.br/css_browser_selector/">CSS Browser Selector</a> to sniff the client&#8217;s browser and append a class name to the opening html tag. Using that class name we can target very specific browsers in the main style sheet by simply starting a selector with the browser class name. Here are some examples:</p>
<ul>
<li>.ie .example { background-color: yellow }</li>
<li>.ie7 .example { background-color: orange }</li>
<li>.gecko .example { background-color: gray }</li>
<li>.opera .example { background-color: green }</li>
<li>.webkit .example { background-color: black }</li>
</ul>
<p>By using the technique we can target other browsers like webkit and Firefox in addition to all versions of IE. We get the added benefit of better browser targeting as well as style sheet aggregation because these browser specific styles can be mixed in with the rest of the base style sheet. The script also has the ability to target operating systems but we have not run into a case yet where a platform specific style was needed.</p>
<p>CSS3 is used extensively throughout Product X but it is limited to visual style. If a situation arises where a shadow, rounded corner or gradient is crucial to the experience or functionality of the site appropriate fallbacks will be put in place. Using CSS3 falls in line with the overall design philosophy of Product X in that we shouldn&#8217;t be building a site for the lowest common denominator. Progressive enhancement and graceful degradation should be used whenever possible.</p>
<p><strong>HTML5</strong></p>
<p>The markup of Product X is written in HTML5 but at this point the majority of use has been with the new semantic tags available. Semantic markup of Product X is going to be very important for the future of our sites because it provides greater accessibility and classification of our content. Current browser support for HTML5 semantic tags is mixed so we use a JavaScript plug-in called <a href="http://www.modernizr.com/">Modernizr</a> that forces browsers to recognize these tags as native DOM elements. After setting base styles for these tags in CSS they can be treated the same as any other block level element. Product X currently uses the following semantic tags in its markup:</p>
<p>header, section, footer, aside, nav, article, figure, figcaption, hgroup</p>
<p>Careful steps have been taken to remove any CSS dependency on these tags for style. That way if they need to be removed there will be no visual impact to the design. There are a couple of cases where these tags cannot be used. Firefox 2 refuses to recognize these tags as native DOM elements. Currently the approximate <a href="http://www.w3schools.com/browsers/browsers_firefox.asp">usage of Firefox 2</a> is at 0.6%. As it&#8217;s designed right now Product X will not display properly in this browser. The second case where these HTML5 tags cannot be used is when ajaxing in dynamic content with Internet Explorer. In this case we are currently using an HTML4 fallback for dynamically injected content in IE.</p>
<p>Other uses of HTML5 include using the placeholder attribute in form fields. We are using a script called <a href="http://github.com/jgarber623/jquery-placehold">jQuery Placehold</a> to force compatibility of this feature in older browsers. Since we would use JavaScript to accomplish this anyway without a plug-in and HTML5 attribute it should not be a concern that we are taking this new approach. As browsers add placeholder attribute support we will have less need for this plug-in.</p>
<p>HTML5 lays the foundation for using drag and drop, form validation and local storage but these features are not currently being utilized in Product X without JavaScript.</p>
<p><strong>JavaScript</strong></p>
<p>When it comes to front end interaction in Product X all of the functionality has been accomplished with jQuery and jQuery UI. Both of these JavaScript libraries are actively supported and strive for cross browser compatibility. Product X currently uses two additional jQuery plug-ins called <a href="http://catcubed.com/2008/12/23/ceebox-a-thickboxvideobox-mashup/">CeeBox</a> for thickbox like popups and <a href="http://flowplayer.org/tools/index.html">jQuery Tools</a> for some gallery interactivity. Again, both of these plug-ins are actively supported and are cross browser compliant.</p>
]]></content:encoded>
			<wfw:commentRss>http://lesjames.com/417/cross-browser-progressive-enhancement/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Proper Rounded Corners</title>
		<link>http://lesjames.com/262/proper-rounded-corners/</link>
		<comments>http://lesjames.com/262/proper-rounded-corners/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 15:55:01 +0000</pubDate>
		<dc:creator>Les</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[border radius]]></category>
		<category><![CDATA[css3]]></category>

		<guid isPermaLink="false">http://lesjames.com/?p=262</guid>
		<description><![CDATA[I was guilty. I admit it, I was doing rounded corners wrong. In my current project I am using CSS3 to round the corners on containers. These containers have internal elements that get separated by a thin border. I was rounding the corners on those internal elements with the same radius as the wrapper container. [...]]]></description>
			<content:encoded><![CDATA[<p>I was guilty. I admit it, I was doing rounded corners wrong. In my current project I am using CSS3 to round the corners on containers. These containers have internal elements that get separated by a thin border. I was rounding the corners on those internal elements with the same radius as the wrapper container. I never noticed it before but this is the wrong way to do it.</p>
<p>Check out this post on what <a href="http://www.usabilitypost.com/2009/01/26/the-proper-way-to-draw-rounded-corners/">properly round corners</a> are.</p>
<p><img class="float" src="http://lesjames.com/wp-content/uploads/2010/04/proper-corners.gif" alt="" title="proper-corners" width="140" height="243"  /></p>
<p>So what was the difference in my project? I took screenshots of before and after and animated a GIF with them so that you can see the difference. Yes it&#8217;s very subtle, but the perfectionist in me is much happier with the proper method.</p>
<p>I was rounding both outer and inner elements with a 5px radius. After I learned my lesson I&#8217;m rounding the outer elements with a 5px radius and the inner element with a 4px radius. What do you think of the difference?</p>
]]></content:encoded>
			<wfw:commentRss>http://lesjames.com/262/proper-rounded-corners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile Safari and Border Radius</title>
		<link>http://lesjames.com/247/mobile-safari-and-border-radius/</link>
		<comments>http://lesjames.com/247/mobile-safari-and-border-radius/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 13:58:25 +0000</pubDate>
		<dc:creator>Les</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[border radius]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[longhand]]></category>
		<category><![CDATA[mobile safari]]></category>
		<category><![CDATA[sass]]></category>
		<category><![CDATA[shorthand]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://lesjames.com/?p=247</guid>
		<description><![CDATA[Webkit is cool with border radius shorthand but not mobile safari. I ended up having to modify my Sass mixin to use webkit longhand for border radius.]]></description>
			<content:encoded><![CDATA[<p>One of the first things I wanted to do with my new iPad was to check out my latest project on it. Right away I noticed that the CSS rounded corners I had on elements weren&#8217;t showing up. My first thought was I coded something wrong, but checking the site on Webkit and Chrome confirmed that my rounded corners were showing up fine. So I started thinking that Mobile Safari somehow forgot to add border radius to it&#8217;s css rendering. I was wrong again. I started doing some testing by building a simple page with a box on it. I added -webkit-border-radius: 5px; and it worked great on the iPad. So I copied the styles from my project and applied them to the box. No rounded corners! I started eliminating styles for fear that something was conflicting with -webkit-border-radius. Turns out that Mobile Safari doesn&#8217;t like the shorthand way of writing the style. Check out the comparison shots I took below of the same page.</p>
<p>Here are what the boxes look like in Webkit&#8230;</p>
<p><img style="width: 577px" title="ipad" src="http://lesjames.com/wp-content/uploads/2010/04/webkit.png" alt="Webkit border radius" /></p>
<p>Here are what the boxes look like on the iPad&#8230;</p>
<p><img style="width: 577px" title="ipad" src="http://lesjames.com/wp-content/uploads/2010/04/ipad.png" alt="iPad border radius" /></p>
<p>I don&#8217;t understand why Mobile Safari is treating the shorthand version of the style differently than Webkit. It sucks because I use the shorthand way to change individual corners on elements (some boxes in my project only need the top corners rounded). I would hate to write a style for each individual corner the longhand way like -webkit-border-top-left-radius: 5px;</p>
<p>[Update]</p>
<p>SASS to the rescue:</p>
<pre><code>
// Border Radius
@mixin border_radius($tl: 5px, $tr: 5px, $br: 5px, $bl: 5px) {
  -moz-border-radius: $tl $tr $br $bl;
  -webkit-border-top-left-radius: $tl;
  -webkit-border-top-right-radius: $tr;
  -webkit-border-bottom-right-radius: $br;
  -webkit-border-bottom-left-radius: $bl;
  border-radius: $tl $tr $br $bl;
}</code>
</pre>
<p>By modifying my mixin to include the longhand styles for webkit border radius will now show up on mobile safari. This is another reason why Sass kicks ass because I only had to modify this single mixin and my entire project got updated. Just another reason why if you write CSS for a living you need to be using <a href="http://sass-lang.com">Sass</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lesjames.com/247/mobile-safari-and-border-radius/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Breaking Away From Viewport</title>
		<link>http://lesjames.com/184/breaking-away-from-viewport/</link>
		<comments>http://lesjames.com/184/breaking-away-from-viewport/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 19:21:08 +0000</pubDate>
		<dc:creator>Les</dc:creator>
				<category><![CDATA[css3]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[viewport]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://lesjames.com/?p=184</guid>
		<description><![CDATA[This site&#8217;s design is reaching a crossroads. I am starting to remove major elements of the Viewport theme in a move to increase the site&#8217;s usability and layout aesthetics. This move is being done with special category templates for the web and interactive sections of my portfolio. I have removed the sliding panels and opted [...]]]></description>
			<content:encoded><![CDATA[<p>This site&#8217;s design is reaching a crossroads.  I am starting to remove major elements of the Viewport theme in a move to increase the site&#8217;s usability and layout aesthetics.  This move is being done with special category templates for the web and interactive sections of my portfolio.  I have removed the sliding panels and opted to have projects tile themselves down the page.  In addition each category archive now pulls in special page content that serves as a description.  A note about this description, I&#8217;m using CSS3 columns for the first time.  Safari and Firefox users will now see eye friendly columns instead of a super wide block of text.  The key now is to actually fill these portfolio sections with projects.</p>
<p>This brings me a decision on what to do with the blog category and the homepage.  For now I&#8217;m going to to keep the sliding panels but I think it can be done better.  I&#8217;m thinking that on the homepage I want to try and figure out a way to include only the latest blog post and then start listing out my favorite portfolio projects.  I am also going to add a panel at the end that will list out my most recent blog and twitter posts.  As for the blog archive I&#8217;m going to have to think of a new presentation but I suppose what&#8217;s in place now will suffice.  Time to start hacking the home page!</p>
]]></content:encoded>
			<wfw:commentRss>http://lesjames.com/184/breaking-away-from-viewport/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rounding Corners</title>
		<link>http://lesjames.com/62/rounding-corners/</link>
		<comments>http://lesjames.com/62/rounding-corners/#comments</comments>
		<pubDate>Thu, 07 May 2009 20:02:48 +0000</pubDate>
		<dc:creator>Les</dc:creator>
				<category><![CDATA[css3]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[viewport]]></category>

		<guid isPermaLink="false">http://lesjames.com/?p=62</guid>
		<description><![CDATA[While writing up my portfolio entry on mobile templates, I got an idea of how I can round the corners on the viewport theme header images. I changed the template around on the single page to inject the image url into a background style on the wrapper div instead of creating a full img tag. [...]]]></description>
			<content:encoded><![CDATA[<p>While writing up my portfolio entry on mobile templates, I got an idea of how I can round the corners on the viewport theme header images.  I changed the template around on the single page to inject the image url into a background style on the wrapper div instead of creating a full img tag.  Now that the wrapper displays the image I can us CSS3 to round the corners.  Presto!  If you are in Safari I also added a drop shadow.  Come on Firefox, get your CSS3 on and display that box shadow!</p>
<p>(Hours later&#8230;)</p>
<p>I&#8217;m so excited.  So when I made the changes I mentioned above this really screwed up my jQuery default image replace code.  I tried to fix it but I&#8217;m just not good enough to work around the new way I was inserting the image as an inline style attribute.  So I had to venture into the unknown.  Instead of testing to see if the image source was empty with jQuery, I tried testing it with PHP.  This is big time wilderness for me.  My first attempt crashed and burned.  A quick look on Google for PHP if/else statements got me pointed in the right direction.  My second attempt worked perfectly!  I&#8217;ve never wrote PHP and to have it work on the second try was awesome.  I&#8217;m learning so much from customizing this the Viewport WordPress theme.</p>
]]></content:encoded>
			<wfw:commentRss>http://lesjames.com/62/rounding-corners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
