<?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>Delivering Quality &#187; CSS</title>
	<atom:link href="http://www.markdeepwell.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markdeepwell.com</link>
	<description>A Software Developers View of the World</description>
	<lastBuildDate>Thu, 29 Jul 2010 16:44:04 +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>Building for Mobile with Device Orientation</title>
		<link>http://www.markdeepwell.com/2010/01/building-for-mobile-with-device-orientation/</link>
		<comments>http://www.markdeepwell.com/2010/01/building-for-mobile-with-device-orientation/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 16:54:29 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Web Application]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Device Orientation]]></category>
		<category><![CDATA[Fennec]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=460</guid>
		<description><![CDATA[Mozilla Firefox 3.5 and Firefox for Mobile 1.0 (Fennec) both have support for modifying a web applications look based on screen dimensions and current orientation. These abilities give web developers the power to build better web applications for mobile devices and the ability to optimize the browsing experience when screen space is constrained. CSS Orientation [...]]]></description>
			<content:encoded><![CDATA[<p>Mozilla Firefox 3.5 and Firefox for Mobile 1.0 (Fennec) both have support for modifying a web applications look based on screen dimensions and current orientation. These abilities give web developers the power to build better web applications for mobile devices and the ability to optimize the browsing experience when screen space is constrained.</p>
<h3>CSS Orientation Properties</h3>
<p>Web applications look and feel is defined by a CSS file, so therefore the Firefox developers made it super easy to tie current orientation and screen dimensions into which CSS file to load.</p>
<p>For examaple: If the browser is in portrait mode, a single CSS media parameter will specify which styles to use:</p>
<div class="igBar"><span id="ljavascript-5"><a href="#" onclick="javascript:showPlainTxt('javascript-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-5">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">@media all and <span style="color: #66cc66;">&#40;</span>orientation: portrait<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> ... <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>In the same way, you can create a custom CSS stylesheet for users who are browsing with a screen size between 500 and 700 pixels:</p>
<div class="igBar"><span id="ljavascript-6"><a href="#" onclick="javascript:showPlainTxt('javascript-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-6">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">@media screen and <span style="color: #66cc66;">&#40;</span>min-width: 500px<span style="color: #66cc66;">&#41;</span> and <span style="color: #66cc66;">&#40;</span>max-width: 700px<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> ... <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<h3>Orientation Events</h3>
<p>Firefox 3.6 adds support for orientation events in JavaScript, so you can get current updates of how the user is holding their mobile device:</p>
<div class="igBar"><span id="ljavascript-7"><a href="#" onclick="javascript:showPlainTxt('javascript-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-7">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">window.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">"MozOrientation"</span>, handleOrientation, <span style="color: #003366; font-weight: bold;">true</span><span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Once you register the event handler, the handleOrientation function will receive an object specifying the x, y, and z value of the devices current position:</p>
<div class="igBar"><span id="ljavascript-8"><a href="#" onclick="javascript:showPlainTxt('javascript-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-8">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> handleOrientation<span style="color: #66cc66;">&#40;</span>orientData<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> x = orientData.<span style="color: #006600;">x</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> y = orientData.<span style="color: #006600;">y</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">var</span> z = orientData.<span style="color: #006600;">z</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>With those parameters and a game timer, you can probably build the <a href="http://www.turbosquid.com/FullPreview/Index.cfm/ID/275316">Labyrinth game</a>.</p>
<p>For those of your that are ready to start experimenting with this API right away, Mozilla Developer Center has the full <a href="https://developer.mozilla.org/en/Detecting_device_orientation">Firefox orientation documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2010/01/building-for-mobile-with-device-orientation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook vs You!</title>
		<link>http://www.markdeepwell.com/2009/12/facebook-vs-you/</link>
		<comments>http://www.markdeepwell.com/2009/12/facebook-vs-you/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 06:31:49 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Application]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Facebook App]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=445</guid>
		<description><![CDATA[Have you had the... how should I describe it... experience of writing a Facebook application? No? OK, here's an introduction to what you can expect. When developing an application you must learn Rule #1 Facebook is the gatekeeper. Everything you do, be it HTML, CSS or JavaScript, is restricted by Facebook. Only the commands, functions, [...]]]></description>
			<content:encoded><![CDATA[<p>Have you had the... how should I describe it... <strong>experience</strong> of writing a Facebook application? No? OK, here's an introduction to what you can expect.</p>
<p>When developing an application you must learn Rule #1 <strong>Facebook is the gatekeeper</strong>. Everything you do, be it HTML, CSS or JavaScript, is restricted by Facebook. Only the commands, functions, CSS properties, HTML tags etc. that Facebook allows are permissible. If you have an error in your HTML such as an unclosed tag or if you try to use a CSS property that does not exist, Facebook will render a very nice message saying you made an error.</p>
<p>Rule #2 <strong>The never ending cycle</strong>. The Facebook platform is constantly changing and APIs that you are using in your application could disappear one day without any notice. It's the life of a Facebook application, working one instant, inexplicably broken the next. Be prepared for irregular maintenance just to keep your application working.</p>
<p>A Facebook Application  lives in the world of Facebook and while it might initially seem  like you're developing a standard web application you are not. Rule #3 <strong>You're application is on the Facebook web</strong>. It's not a regular web application which is a very slight but critical distinction. Facebook has used their powers as the gatekeeper to make modifications to the web. Some HTML tags are allowed, some are not. <a href="http://wiki.developers.facebook.com/index.php/FBJS#FBJS_DOM_Objects">JavaScript has been altered</a> to remove a lot of its power and replace only some of them with Facebook specific functions and even CSS has restrictions. Don't expect existing code to function when placed in the Facebook web.</p>
<h3>Additional Caveats</h3>
<ul>
<li>You cannot include any external JavaScript or style sheet files, they must be included in-line. This is so Facebook can parse them and allow only approved commands. Yes it enhances the security of the social networking site as a whole, but it will slow down your development time.</li>
<li>Facebook will filter, compile, and drastically alter your original code. Clicking view-source on a Facebook page with your application will show your JavaScript code mushed into awkward Facebook functions.</li>
</ul>
<p>Do you see that it's a bit of a battle of you against the mighty Facebook? Don't sweat too much, other developers have persevered and with a few wounds and time you can build and maintain a successful Facebook application. Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2009/12/facebook-vs-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accelerated CSS Transforms</title>
		<link>http://www.markdeepwell.com/2009/07/accelerated-css-transforms/</link>
		<comments>http://www.markdeepwell.com/2009/07/accelerated-css-transforms/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 21:11:26 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Chrome OS]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Transform]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://www.markdeepwell.com/?p=49</guid>
		<description><![CDATA[Recently the WebKit team added support for CSS transformations with 3D GPU acceleration. This means that soon we can built web applications that mimic desktop applications in graphical responsiveness. Charles Ying wrote a simple image gallery application that demos this new functionality. This is definitely not yet ready for end users but it demonstrates the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently the WebKit team added support for CSS transformations with 3D GPU acceleration. This means that soon we can built web applications that mimic desktop applications in graphical responsiveness. Charles Ying wrote a simple <a href="http://www.satine.org/archives/2009/07/11/snow-stack-is-here/">image gallery application</a> that demos this new functionality.</p>
<p>This is definitely not yet ready for end users but it demonstrates the power of the web platform and where it is heading. With the <a href="http://www.markdeepwell.com/2009/07/importance-of-the-html-video-tag/">native video tag</a>, <a href="http://www.techcrunch.com/2008/05/29/the-next-gen-web-browser-storage-support/">local and session storage</a>, plus much <a href="http://ejohn.org/blog/javascript-performance-rundown/">faster JavaScript engines</a>, browsers are changing from simply presenting information  to being a fully interactive platform. It's no surprise that Google is developing a web-browser operating system, called Chrome OS.</p>
<p>It is also quite encouraging to see the <a href="http://en.wikipedia.org/wiki/Browser_Wars#The_second_browser_war">second browser war</a> bring fresh ideas and increase the possibilities to the browser. Competition is great.</p>
<div id="attachment_50" class="wp-caption alignnone" style="width: 475px"><img class="size-medium wp-image-50" title="Snow Stack" src="http://www.markdeepwell.com/wp-content/uploads/2009/07/Snow-Stack-300x193.jpg" alt="Demo of CSS Transforms" width="465" height="298" /><p class="wp-caption-text">Snow Stack in WebKit Nightly r46091</p></div>
<p>The CSS Transforms were originally created at Apple by Dean Jackson, David Hyatt and Chris Marrin for the iPhone. Apple then improved the spec and submitted it to <a href="http://www.w3.org/TR/css3-3d-transforms/">standardization at the W3C</a>. Firefox 3.5 supports 2D <a href="https://developer.mozilla.org/web-tech/2008/09/12/css-transforms/">css transforms</a> but does not yet support the newer accelerated 3D animations.</p>
<p>So how does it work?</p>
<p>The images are put on the page using standard CSS and HTML, and they are then animated by JavaScript using these CSS properties:</p>
<div class="igBar"><span id="lcss-10"><a href="#" onclick="javascript:showPlainTxt('css-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-10">
<div class="css">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-webkit-transition-property: -webkit-transform;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-webkit-transform: rotateY<span style="color: #66cc66;">&#40;</span>45deg<span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">-webkit-transition-duration: 2s; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The transition property is set to transform, the transform is set to rotate the image in Y-space by 45 degrees, and the duration is set to 2s. With that, the web browser will take the current position of the image and rotate it by 45 degrees in 2 seconds, which produces an animation effect. How beautifully  simple it is!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markdeepwell.com/2009/07/accelerated-css-transforms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
