<?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>tactile &#187; CSS</title>
	<atom:link href="http://tactile.co.za/blog/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://tactile.co.za/blog</link>
	<description>- thoughts on CSS, UIs and UX.</description>
	<lastBuildDate>Sun, 18 Sep 2011 14:43:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Weaving a styling tale</title>
		<link>http://tactile.co.za/blog/2011/weaving-a-styling-tale/</link>
		<comments>http://tactile.co.za/blog/2011/weaving-a-styling-tale/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 12:03:46 +0000</pubDate>
		<dc:creator>Shaun</dc:creator>
				<category><![CDATA[Analogies]]></category>
		<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://tactile.co.za/blog/?p=93</guid>
		<description><![CDATA[Imagine for a moment that CSS is a diligent (and somewhat queer) fashion designer.  He is always trying to dress his subject matter in all manner of fashion, from the formal to the flashy.  Think of CSS as a roving clothing-wielding fashionista. CSS peppers his daily routine with studying his favourite subject matter: HTML Elements.  The [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine for a moment that CSS is a diligent (and somewhat queer) fashion designer.  He is always trying to dress his subject matter in all manner of fashion, from the formal to the flashy.  Think of CSS as a roving clothing-wielding fashionista.</p>
<p>CSS peppers his daily routine with studying his favourite subject matter: HTML Elements.  The Elements are a curious set of creatures to CSS, and nowhere is this curiosity more evident than in CSS&#8217;s regular [and published I might add] fashion reports on his subject matter. Reading like the annals of an Ethnographer, CSS describes what it was like when he first encountered The Elements&#8230;</p>
<p><span id="more-93"></span></p>
<blockquote><p>&#8220;[...] The Elements arrange themselves in similar and yet strange-fitting uniforms, some of the uniforms stretch rather badly over the more robust figures (such as the fat one I call &#8216;Textarea&#8217;) and yet they continue to wear these uniforms day by day.  [I must do something to avert this fashion crisis - it's a g'damn tragedy!]&#8220;</p></blockquote>
<p>Before CSS set about clothing The Elements in the latest trendy garb, he decided to investigate why The Elements were wearing those strange uniforms in the first place. CSS needed to witness the birth and early life of an Element. His findings were logged as such:</p>
<blockquote><p>&#8220;[...] These elements all start out in life as simple naked objects, never trying to distinguish themselves from their peers. [They look so boring, so same-y!] Early in their lives, these elements are visited by the clothes merchants (for some reason called &#8216;Browsers&#8217;) and they dress the elements in various lines of fashion (at a price).  <a href="http://meiert.com/en/blog/20070922/user-agent-style-sheets/">These merchants have their own style guidelines for the various elements</a>, and curiously, each merchant&#8217;s style guideline shows very little difference from the next. [Maybe all the merchants got together one day and agreed upon how they'd style these Elements.  Must investigate further.]&#8220;</p></blockquote>
<p>CSS went about correcting the bland fashion mistakes perpetuated by the Browsers, setting new life into The Elements. Can you picture CSS flitting about, his paintbrush splurging a spectrum of colour over his new creations?<br />
Some of these creations were boxy, intended for the ones he called Div, Pee and so.<br />
Other creations took on a more fluid nature, a special ocean blue one intended for the charismatic Anchor element was weaved and it was gorgeous!</p>
<p>One day, as CSS recalls, something strange happened:</p>
<blockquote><p>&#8220;[...] Span, that loose character, came in to my shop asking for a change of clothes again, as he usually does. [He's always changing his mind about what he wears, it's so irritating!] I was absorbed in my latest creation, so I motioned for Span to have a look around.<br />
&#8216;Waddayathink?&#8217; I heard a little later; there was Span dressed to the nines, looking just like that handsome devil: H1.<br />
I couldn&#8217;t believe it at first.  How did Span fill out into H1&#8242;s figure?&#8221;</p></blockquote>
<p>It was a revelation &#8211; the impact would be profound!<br />
It was then that CSS realised he had made a huge mistake&#8230;</p>
<blockquote><p>&#8220;I had been stupidly using the Merchant&#8217;s (or Browsers) clothes as a base for all my own creations as if they were boxy underpants.  In a way, I was inheriting their forms, their textures.  I can&#8217;t believe I didn&#8217;t realise that all these Elements are amourphous &#8211; I can style them as I see fit! (within reason ofc)&#8221;</p></blockquote>
<p>With the limits removed, CSS became an even more talented designer.<br />
A flowing robe was weaved with love and dedication for Pee.<br />
Anchor took on new heights and stature with his new box-cut jeans.<br />
In short, CSS transcended fashion design and his impact on the fashion world have indeed been profound.</p>
<p>CSS&#8217;s works have set the bar for all aspiring designers, even to this day. His reports formed the basis for all studies in fashion design.<br />
Meeting CSS in person is a rare treat for younger designers.  &#8221;Don&#8217;t forget&#8230;&#8221;, he would say to them, &#8220;an element is an element is an element.  Dress them as you see fit, not by what they&#8217;re fitting into.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://tactile.co.za/blog/2011/weaving-a-styling-tale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Reset and &#8216;Sensible Defaults&#8217;</title>
		<link>http://tactile.co.za/blog/2010/css-reset-and-sensible-defaults/</link>
		<comments>http://tactile.co.za/blog/2010/css-reset-and-sensible-defaults/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 22:55:24 +0000</pubDate>
		<dc:creator>Shaun</dc:creator>
				<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[code-maintenance]]></category>
		<category><![CDATA[idiocy]]></category>
		<category><![CDATA[stackoverflow]]></category>
		<category><![CDATA[teams]]></category>

		<guid isPermaLink="false">http://tactile.co.za/blog/?p=4</guid>
		<description><![CDATA[This Web Standards Drone goes down the wrong road with reset.css and comes out better for it.]]></description>
			<content:encoded><![CDATA[<p>Web Standards Advocates should really be called Zealots.  I am also guilty of punting Web Standards, sometimes with no sound reasoning behind my convictions.  This &#8216;blind faith&#8217; led me to a point where one of my team members reigned me in and showed me the misinterpretation of my ways, and it had all to do with Reset CSS and my lack of &#8216;<em>Sensible Defaults</em>&#8216;.<br />
<img src="http://tactile.co.za/blog/wp-content/uploads/2010/03/sensible.jpg" alt="" title="Roadmarkings" width="500" height="338" class="alignnone size-full wp-image-84" /></p>
<p><span id="more-4"></span></p>
<h3>CSS Reset</h3>
<p><a href="http://meyerweb.com/">Eric Meyer</a> is one of the original Web Standards Gurus.  His work is good, and pure, and great time savers for us minions.  Case in point: <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/">Eric&#8217;s work on reset.css</a>.</p>
<p>What reset.css essentially does is set a common foundation in all browsers by removing the browser&#8217;s default rendering of HTML elements.  This makes it easier to author a web document so that it can look very similar in each separate browser.</p>
<h3>The problem</h3>
<p>I&#8217;ve been happily using reset.css on many projects, never noticing along the way the time I&#8217;ve spent on redefining margins on <code>&lt;ul&gt;</code> and <code>&lt;p&gt;</code> elements &#8211; time that could have been saved by defining a &#8216;<em>Sensible Default</em>&#8216;.</p>
<p>Here&#8217;s an example&#8230;</p>
<pre class="brush: css; title: ; notranslate">
ul {margin:0; padding:0; list-style:none; /*etc*/}
</pre>
<p>Reset.css would set all Unordered-Lists (<code>&lt;ul&gt;</code>) to have no margins, and no <code>list-style</code>.  This was great for defining semantic menus in the navigation and footer blocks, but&#8230;<br />
the rule would cascade! (DUH!) and each time I wanted to have default rendering of a <code>&lt;ul&gt;</code> I&#8217;d have to define it explicitly.  This situation would be exacerbated for each case when an <code>&lt;ul&gt;</code> needed to be displayed as expected, e.g. in a sidebar:</p>
<pre class="brush: css; title: ; notranslate">
#sidebar ul {margin:1em 0 1em 2em; list-style:disc;}
</pre>
<h3>The situation</h3>
<p>I started working with Christo on a Django web-app, where I basically had to handle the templates, HTML and CSS + Supporting Images.  I was using reset.css as normal.<br />
Christo started voicing his frustrations with having to rely on me to define each and every case where a paragraph was needing margins, or an unordered-list was missing its bullets.  It came down to a point where he asked me to remove reset.css.  My Standards Zeal kicked in and I refused it, saying I&#8217;d have to create more exceptions than the rule by not using reset.css.<br />
It ended up in a stalemate, so I thought I&#8217;d open up the dialogue to the <a href="http://stackoverflow.com/">StackOverflow</a> audience.  <a href="http://stackoverflow.com/questions/2281766/generic-vs-specific-element-styles-for-maintainability">I put together a quick question</a> and waited 24 hours for the answers to roll in.</p>
<h3>Enter: Sensible Defaults</h3>
<p>It turns out that the practice of defining Sensible Defaults is a common Programming tip. (This just goes to show my lack of formal programming experience!)  <a href="http://idunno.org/archive/2006/01/03/242.aspx">Defaults can save a lot of headaches</a>, and this situation of mine was no different.</p>
<h3>The solution</h3>
<p>Christo and I met half way by overriding the Reset rules just for the content area.</p>
<pre class="brush: css; title: ; notranslate">
#content ul {margin:1em 0 1em 2em; list-style:disc;}
#content p {margin:1em 0;}
/* etc */
</pre>
<p>This way I could rely on Reset.css to ease the styling of header and footer elements, and then <em>reset the reset</em> by providing default styling to any content items such as paragraphs and unordered-lists.</p>
<h3>TLDR? A warning as a conclusion</h3>
<p>So, if you want to use reset.css then please, do The Right Thing&trade;:</p>
<ul>
<li>Don&#8217;t be an idiot and implement something without understanding it</li>
<li>Define sensible defaults for where they&#8217;re needed.</li>
</ul>
<p>That is all.</p>
]]></content:encoded>
			<wfw:commentRss>http://tactile.co.za/blog/2010/css-reset-and-sensible-defaults/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LESSCSS</title>
		<link>http://tactile.co.za/blog/2010/lesscss/</link>
		<comments>http://tactile.co.za/blog/2010/lesscss/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 14:08:30 +0000</pubDate>
		<dc:creator>Shaun</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://tactile.co.za/blog/?p=7</guid>
		<description><![CDATA[After 2 weeks of using LESS.app, I thought I'd share my thoughts on this nifty little CSS authoring timesaver.]]></description>
			<content:encoded><![CDATA[<p>2 weeks ago, <a href="http://vhata.net/">Jonathan</a> dropped me an <acronym title="Instant Message">IM</acronym> concerning a nifty little Mac OSX app called <a href="http://incident57.com/less/">LESS</a>. Essentially, LESS.app is a fancy GUI for a Ruby gem called <a href="http://lesscss.org/">LESSCSS</a>, a CSS parsing and authoring tool designed to speed up CSS development.</p>
<p><a href="http://incident57.com/less/"><img class="alignnone size-full wp-image-21" title="LESS.app" src="http://tactile.co.za/blog/wp-content/uploads/2010/02/less_logo.png" alt="" width="314" height="124" /></a><br />
I&#8217;m not going to go into detail about it&#8217;s function, but what I will do is give a review, highlight its pros and cons and maybe even offer some mixins you can use.<br />
<span id="more-7"></span></p>
<h3>Setting up</h3>
<p>Installing LESS.app was a breeze, and being familiar with installing Ruby Gems, the command-line app LESSCSS was also swiftly installed.<br />
My initial reasons for using LESS was to use the Mixin functionality, and create a library of common mixins I tend to use on each project.  I was hoping that I could store this &#8216;common library&#8217; in a central place and reference it from all my projects &#8211; this was not the case, as all LESS imports have to be sourced from the same folder.</p>
<h3>Pros and Cons</h3>
<p>In these 2 weeks of using LESS, I&#8217;ve noticed a few limitations &#8211; they&#8217;re not deal-breakers, but then I haven&#8217;t used LESS in a team-environment yet.</p>
<h4>Pros:</h4>
<ul>
<li>LESS Syntax is very similar to CSS, which makes it easier to use than SASS.</li>
<li>Storing your common mixins in a separate file speeds up development on subsequent projects</li>
<li>Non-invasive file monitoring means your LESS files are compiled as you save them.  No need for compiling manually.</li>
</ul>
<h4>Cons:</h4>
<ul>
<li>No support as yet for some dynamic mixins that use proprietary properties such as Microsoft&#8217;s <code>alpha(opacity)</code> property</li>
<li>Multiple comma-separated ancestral selectors are converted into multiple selectors, dropping the comma in the selector and repeating the rule each time over.</li>
<li>Larger, more numerous imports and more complex LESS files take longer to compile.  I find I&#8217;m often refreshing my browser twice because I refreshed before the CSS was compiled.</li>
</ul>
<p>Talking of a team-environment&#8230; everyone who touches the CSS would have to use LESS, else there&#8217;ll be some crazy merging going on when someone updates the CSS and not the source LESS files.</p>
<p>All that said, I&#8217;d recommend using LESS to anyone who&#8217;s working on their CSS independently.</p>
<h3>Further exploration</h3>
<p>The compiling side of LESS CSS must  surely be able to minify the output!  At the moment it dumps each property on a new line, leading to horrendously long CSS files with lots of whitespace.  (I&#8217;m a big fan of multiple properties per line for each selector)  I&#8217;ll see what I can find in terms of <code>lessc</code> options, but for now it&#8217;s not a big issue.</p>
<h3>Momentum</h3>
<p>After I subscribed to the <a href="http://groups.google.com/group/lesscss">LESSCSS Google Group</a> and read through a few of the discussions, I noticed that there seems to be some momentum in the project, but not a lot.  There are plenty of new users asking questions, but not a lot of active developer feedback. (Probably because <a href="http://twitter.com/cloudhead">cloudhead</a> is working on <a href="http://github.com/cloudhead/less.js">LESS.js</a> at the moment)  Maybe that&#8217;s a call for more community involvement in the app.  If you&#8217;ve done work on Ruby gems before, why not <a href="http://github.com/cloudhead/less/tree">get involved with LESS on GitHub</a>?</p>
<h3>As promised&#8230;</h3>
<p>&#8230;some mixins I use already:</p>
<p>Cross-browser border-radius, still no IE support though</p>
<pre class="brush: css; title: ; notranslate">
.border-radius (@radius:5px) {border-radius:@radius; -moz-border-radius:@radius; -webkit-border-radius:@radius;}
.border-radius-top-left (@radius:5px) {border-radius-top-left:@radius; -moz-border-radius-topleft:@radius; -webkit-border-top-left-radius:@radius; }
.border-radius-top-right (@radius:5px) {border-radius-top-right:@radius; -moz-border-radius-topright:@radius; -webkit-border-top-right-radius:@radius;}
.border-radius-bottom-left (@radius:5px) {border-radius-bottom-left:@radius; -moz-border-radius-bottomleft:@radius; -webkit-border-bottom-left-radius:@radius;}
.border-radius-bottom-right (@radius:5px) {border-radius-bottom-right:@radius; -moz-border-radius-bottomright:@radius; -webkit-border-bottom-right-radius:@radius;}
</pre>
<p>IE 6 &amp; 7 hack to support min-height</p>
<pre class="brush: css; title: ; notranslate">
.ie_min-height (@height:300px) {height:auto !important; height:@height;}
</pre>
<p>Malarkey Image Replacement</p>
<pre class="brush: css; title: ; notranslate">
.mir () {text-indent:-1000em; letter-spacing:-1000em; overflow:hidden;}
</pre>
<p>&#8216;Off-left&#8217; screen-reader supporting layer hiding</p>
<pre class="brush: css; title: ; notranslate">
.off_left () {display:block; position:absolute; top:0; left:-9999em;}
</pre>
<p>Cross-browser Opacity &#8211; Missing IE filters: not supported in LESS yet.</p>
<pre class="brush: css; title: ; notranslate">
.opacity (@opacity_percent:50) {-moz-opacity:@opacity_percent / 100; opacity:@opacity_percent / 100;}
</pre>
<p>Self-clearing for Non-IE browsers: Apply to :after the float container</p>
<pre class="brush: css; title: ; notranslate">
.self_clearing () {content:&quot;.&quot;; display:block; clear:left; visibility:hidden; height:0; width:0;}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://tactile.co.za/blog/2010/lesscss/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

