<?xml version="1.0" encoding="utf-8" standalone="no"?><feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Divya Manian]]></title>
  <link href="http://nimbupani.github.com/atom.xml" rel="self"/>
  <link href="http://nimbupani.github.com/"/>
  <updated>2013-12-12T19:27:38+05:30</updated>
  <id>http://nimbupani.github.com/</id>
  <author>
    <name><![CDATA[Divya Manian]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><entry>
    <title type="html"><![CDATA[Diversity in Conferences]]></title>
    <link href="http://nimbupani.github.com/diversity-in-conferences.html"/>
    <updated>2013-05-09T16:54:00+05:30</updated>
    <id>http://nimbupani.github.com/diversity-in-conferences</id>
    <content type="html"><![CDATA[<p>I have resisted the urge to contribute my thoughts every time drama around women and  minorities in technology occurs. I thought instead I would share with you some of the actions I have taken in various roles to try to make diversity more visible in conferences around web technology.</p>

<h1>As a Conference Organizer</h1>

<p>It was only when I took responsibility of selecting speakers for W3Conf that I realised how many of my first choices were just names I had heard of. It became very clear that merit played almost no part in the speaker selection: visibility did.</p>

<p>I also noticed my initial reluctance to choose first-time speakers as I didn&#8217;t want my conference to &#8220;fail&#8221; (I am guessing this is fairly a common concern), and hence tried to select popular speakers. This does help drive some registrations from those who want to see such speakers in person. But then again, having only 1 or 2 of them would suffice.</p>

<p>If you are looking for these popular speakers to promote your event and boost the registrations through such promotions, you can forget that. Unless each speaker tirelessly blogs, tweets, and talks about your event at regular intervals, the impact of them talking about your event is fairly minimal. If this was a reason for you to choose only popular speakers, then you should probably try another tactic.</p>

<p>Many conference organizers also fear having speakers who are boring or who might get stage fright and hence are very cautious in only chosing those who have proven themselves worthy as speakers. For W3Conf, I was confident that getting speakers who were interesting and worked on interesting projects was more important than their ability to speak or present.</p>

<p>I was very happy to see this was validated as the passion of each of the speakers came across as a far more compelling force than their articulation or their ability to punctuate their words with pauses.</p>

<h2>Where to find these people?</h2>

<p>I am very lucky to be in a place (metaphorically and physically) that puts me in touch with interesting people on a fairly regular basis without even trying to find them. Even then, I blanked when I was starting with who to select for the speakers for W3Conf.</p>

<p>One of the tricks I employed was to find an acknowledged expert in a field I was looking for a speaker in, and trawl the list of people <strong><em>they</em></strong> follow. I followed links to open-source projects and then reached out to them via email or Twitter.</p>

<p>I also asked people I trusted for names of people who were not well known but worked on interesting projects.</p>

<h2>What about diversity?</h2>

<p>It was always at the back of my mind to make this conference as diverse as possible. I didn&#8217;t set out wanting to tick off a quota, but rather having a healthy mix of people from various backgrounds working on interesting stuff.</p>

<h2>What about quotas for conferences?</h2>

<p>I have come across conference organizers having a check list (&#8220;we hope to have 2 women speakers in our conference&#8221;). While it would be a good success metric, I do not think having it as the only factor helps anyone. People who are requested to speak at conferences in that manner get disgusted at being token speakers.</p>

<p>If you are a conference organizer, don&#8217;t reach out to people suggesting they have been contacted only because you are obligated to fill your quota.</p>

<h2>What about reverse call for speakers?</h2>

<p>The idea looks great at first glance, but I am afraid the same challenge of only recalling popular names that had impressed the conference organizers would manifest itself even more significantly in the audience. Most of them wouldn&#8217;t know which speaker would be worth listening to because they would have even less of an opportunity to come across people working on interesting projects. I also think one of the primary reasons people attend conferences is to find out about what interesting projects exist.</p>

<h1>As a Speaker</h1>

<p>Over the last two years I have given more than 20 talks, which has given me some level of visibility/name recognition in web technology. This means I get asked to speak many times at conferences most of which I have to decline because of work schedule conflicts.</p>

<p>I also know from my experience how much effort it is to select speakers, so I always ask the organizers if they would like some suggestions on who would be good speakers for their conference. Almost always they welcome suggestions and I send a list of those who I think should be heard from more. Invariably they are a mix of people who are less-prominent, but do exceptional work. Diversity is at the heart of such lists.</p>

<h1>As an Employee of a Company that Sponsors Events</h1>

<p>I work at Adobe which sponsors many events. I am also in a position to recommend events to sponsor. I try to recommend relevant events that may not be prominent but work on having as many people as possible from diverse backgrounds to attend or speak. They may or may not have charters that state their commitment to diversity, but nevertheless their actions speak louder than words.</p>

<p>I am also trying to push for sponsorships of events that show clear commitment to diversity in their speakers and/or attendance profiles. One thing I have learnt over the course of working at American companies is your views are most often heard, and while immediate actions may not be possible, the more people who strongly present the case, the earlier shifts can happen. So, if you think you are a mere cog in the wheel of a large corporation, think again. You have more power than you think.</p>

<p>It always helps when reaching out to the people who actually sponsor events at your company to make a strong case based on facts instead of complaining about the lack of diversity in sponsored events of the past.</p>

<p>If you find yourself in one of these roles, and want to showcase the diversity in our web world, please do try out these and let me know how they worked for you.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Using decimal percentage values in responsive design]]></title>
    <link href="http://nimbupani.github.com/using-decimal-percentage-values-in-responsive-design.html"/>
    <updated>2013-03-26T04:24:00+05:30</updated>
    <id>http://nimbupani.github.com/using-decimal-percentage-values-in-responsive-design</id>
    <content type="html"><![CDATA[<p>At work I get many samples of code to be reviewed, most of them with a warning &#8216;only works in Chrome&#8217;. Nevertheless, I open these pages in Safari &amp; mostly they work. Yesterday I came across something that didn&#8217;t. This post is a result of that investigation.</p>

<p>The page layout was broken in Safari and as I turned on the Inspector, I noticed the way the values were being specified:</p>

<pre>
margin: 0 0 0 6.3124621208203820812122%;
width: 48.121212121212121212121212%
</pre>


<p>(The values are not the same as the ones I saw in the code, but the number of decimals used is similar)</p>

<p>I was stupified.</p>

<h2>Unreadable Code</h2>

<p>When values are so large, it becomes really hard to actually understand the exact round number equivalent. It took me a while to realise that the margin was supposed to be approx. 6% of the (pause) 48% width. I know I am not that bad at calculating numbers in my head!</p>

<p>Over-preciseness never worked in WebKit until very recently. WebKit <a href="http://trac.webkit.org/wiki/LayoutUnit">recently enabled subpixel units</a> that would allow the painting of half a pixel. So what are these precise decimals doing?</p>

<h2>History</h2>

<p>I expressed <a href="https://twitter.com/divya/status/316284818675625985">my disappointment at having such unreadable code</a> on twitter (where else do you rant?!), and I received feedback that this is how &#8216;responsive design&#8217; is done, and for pointers linked to the <a href="http://alistapart.com/article/responsive-web-design">original article by Ethan Marcotte</a> who pointed to <a href="http://alistapart.com/article/fluidgrids">initial post on fluid design</a>.</p>

<p>The use of percentages stem from the Fluid Grids post, where it has been argued:</p>

<pre>
(target pixel value / context pixel value) * 100 = length value in percentage
</pre>


<p>This percentage value is typically pasted to the whole 10 decimal places (or more!) that you get when you use a calculator in typical &#8216;responsive&#8217; websites.</p>

<h2>Why we do it</h2>

<p>The article has a footnote on rounding that states that, by over-specifying the values you avoid Rounding errors because you give sufficient information to the browser to round up or down.</p>

<p>All browsers have since fixed the rounding issue, so this may no longer apply. Even discounting that fact, let us see how many decimal values you need for the errors to be significant enough to cause layout errors. Given the previous math, the target pixel size becomes:</p>

<pre>
target pixel value = length value in percentage * context pixel value
</pre>


<p>Lets calculate what the target pixel width would be with just 2 decimal places, when the context is 1000px &amp; 5000px respectively. 5000px is an outlier given even <a href="http://en.wikipedia.org/wiki/Retina_Display">Retina Display resoution does not exceed 2560 pixels</a>:</p>

<pre>
16.67% * 1000px = 166.7px
16.67% * 5000px = 833.5px
</pre>


<p>Let us try to calculate the same result with 3 decimal places:</p>

<pre>
16.667% * 1000px = 166.67px (-0.03 from previous value)
16.667% * 5000px = 833.35px (-0.15 from previous value)
</pre>


<p>How about for 4 decimal places?</p>

<pre>
16.6667% * 1000px = 166.667px (-0.003 from previous value)
16.6667% * 5000px = 833.335px (-0.015 from previous value)
</pre>


<p>While the difference in the approximation seems significant enough to consider using 3 decimal places, the move to 4 decimals or more seems irrelevant. The values are fairly trivial even for impossible pixel widths.</p>

<h2>How should we do it?</h2>

<p>If your intent is to inform the browser to take accurate action based on a fraction. Why not provide that fraction? CSS provides a handy <code>calc</code> function that allows you to pass in any calculation, and the browser will calculate appropriately. This would result in:</p>

<pre>
h1 {
 width: calc(1/6 * 100%);
}
</pre>


<p>Do note <a href="http://caniuse.com/calc"><code>calc</code> is supported in most browsers</a> except Opera (which will soon when it switches to WebKit) or older iOS or Android browsers.</p>

<p>But in the interest of graceful degredation, we can always provide:</p>

<pre>
h1 {
 width: 16.667%;
 width: calc(1/6 * 100%);
}
</pre>


<h2>A note about ems</h2>

<p>As <a href="https://twitter.com/scottjehl/status/316350378809647105">Scott Jehl pointed out</a> the decimal values raise in significance as soon as you start using them directly on em units like so:</p>

<pre>
h1 {
 font-size: 36em;
 margin: 0 0 0 0.009em;
}
</pre>


<p>I would only want you to consider using <code>rem</code> as a unit instead, &amp; avoiding confusing complicated scenarios ems bring with them.</p>

<h2>Think before you use!</h2>

<p>In HTML5 Boilerplate, most of the code we add or delete have valid proven reasons for their existence or non-existence, so to see something be accepted as common methodology without scrutiny was disconcerting. Many have suggested they have previously come across problems with smaller decimal values, but there is no reproducable test case.</p>

<p>If you have one, please do <a href="http://twitter.com/divya">let me know on twitter</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Using background clip for text with CSS fallback]]></title>
    <link href="http://nimbupani.github.com/using-background-clip-for-text-with-css-fallback.html"/>
    <updated>2013-02-02T14:25:00+05:30</updated>
    <id>http://nimbupani.github.com/using-background-clip-for-text-with-css-fallback</id>
    <content type="html"><![CDATA[<p>I was looking at the lovely design of <a href="http://polygon.com">polygon</a> when their use of <code>background-clip</code> &amp; <code>background: linear-gradient(…)</code> immediately suggested a JS-free fallback for using the non-standard <code>background-clip: text</code>.</p>

<h2>What it is</h2>

<p><code>background-clip</code> is a CSS property that was <a href="https://www.webkit.org/blog/164/background-clip-text/">originally introduced in WebKit (in 2008)</a> that allows backgrounds specified on elements to clip to the text content of the element like so:</p>

<p><img src="http://s3.amazonaws.com/nimbublips/1359844612.png" alt="" /></p>

<p>by merely using the following code:</p>

<pre>body{
 color: transparent;
 background: url(path/to/bg/image) repeat;
 -webkit-background-clip: text;
}
</pre>


<p>However, <code>background-clip: text</code> is not part of any standard yet – but <a href="http://dev.w3.org/csswg/css3-background/#the-background-clip">other values such as <code>border-box</code> or <code>content-box</code> are</a>.</p>

<h2>The Problem</h2>

<p>It is no surprise to find people using non-standard properties in HTML, and it is no big deal if it fails gracefully in other browsers. Unfortunately, <code>background-clip: text</code> fails rather spectacularly in non-WebKit browsers:</p>

<p><img src="http://s3.amazonaws.com/nimbublips/1359844975.png" alt="" /></p>

<p>The above is how it appears (when you use <a href="http://placekitten.com">placekitten</a> to generate the background image) in Firefox. You cannot even read the text! This is clearly a disastrous situation.</p>

<h2>Current Solutions</h2>

<p>The most commonly used solution is to use <a href="http://modernizr.com">Modernizr</a> to detect if <code>background-clip: text</code> is available, and then use a class <code>backgroundcliptext</code> to apply <code>background-clip:text</code> selectively – <a href="http://polygon.com">Polygon</a> does this too.</p>

<h2>Purely CSS solution</h2>

<p>While looking at the code, I suddenly realized that if you use only the <code>-webkit-</code> prefixed value for <code>background</code> property, then <code>background-clip: text</code> would only apply when <code>-webkit-</code> prefixed values are supported in browsers – effectively curtailing its use to WebKit browsers:</p>

<pre>body {
 color: transparent;
 background: -webkit-linear-gradient(transparent, transparent),
             url(path/to/bg/image) repeat;
 -webkit-background-clip: text;
}</pre>


<p>Hurray! We are almost there! The background no longer appears in non-WebKit browsers:</p>

<p><img src="http://s3.amazonaws.com/nimbublips/1359845371.png" alt="" /></p>

<p>…until you test in Opera, which also <a href="http://my.opera.com/ODIN/blog/opera-12-10-is-out">supports <code>-webkit-</code> prefixes for site compatibility</a>. But, it is easy to solve for by merely adding <code>-o-</code> prefixed background value:</p>

<pre>body {
 color: transparent;
 background: -webkit-linear-gradient(transparent, transparent),
             url(path/to/bg/image) repeat;
 background: -o-linear-gradient(transparent, transparent);
 -webkit-background-clip: text;
}</pre>


<p>But, wait, the <code>color: transparent</code> would make the text invisible in all browsers! Let us change that to a readable color:</p>

<pre>body {
 color: red;
 background: -webkit-linear-gradient(transparent, transparent),
             url(path/to/bg/image) repeat;
 background: -o-linear-gradient(transparent, transparent);
 -webkit-background-clip: text;
}</pre>


<p>But now the color fills the text, and the clipped background is no longer shown in WebKit browsers :(</p>

<p><img src="http://s3.amazonaws.com/nimbublips/1359845928.png" alt="" /></p>

<h2><code>text-fill-color</code> to the rescue</h2>

<p><a href="https://www.webkit.org/blog/85/introducing-text-stroke/"><code>text-fill-color</code> (introduced in 2006)</a> fills text with a color when used in conjunction with a <code>text-stroke</code>. It behaves exactly like <code>color</code> except we now have the advantage of having it apply only to WebKit browsers! Nirvana!</p>

<pre>body {
 color: red;
 -webkit-text-fill-color: transparent;
 background: -webkit-linear-gradient(transparent, transparent),
             url(path/to/bg/image) repeat;
 background: -o-linear-gradient(transparent, transparent);
 -webkit-background-clip: text;
}</pre>


<p>Here is how it appears in WebKit browsers and non-WebKit browsers respectively:</p>

<p><img src="http://s3.amazonaws.com/nimbublips/1359846393.png" alt="" /></p>

<p>You only have to use 2 extra css properties, to make it fail-safe in all browsers and need not run a feature-detection script. Currently, only Opera requires the background reset using the <code>-o-</code> prefix, but if more browsers start supporting <code>-webkit-</code> prefix then each of those browsers need a reset (e.g. <code>background: -moz-linear-gradient(transparent, transparent);</code>). But I don&#8217;t think this will happen.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Markup-free icon fonts using unicode-range]]></title>
    <link href="http://nimbupani.github.com/markup-free-icon-fonts-with-unicode-range.html"/>
    <updated>2012-12-25T08:58:00+05:30</updated>
    <id>http://nimbupani.github.com/markup-free-icon-fonts-with-unicode-range</id>
    <content type="html"><![CDATA[<p>I used icon fonts extensively while designing <a href="http://fripfrap.io">fripfrap.io</a>. Unfortunately, icon fonts require tags wrapped around where they should be placed, and I went on a quest to find out if we can adaptively render icon fonts without any extra markup.</p>

<h2>Icon Fonts</h2>

<p>Icon fonts are easy clean way to render icons across all sizes of text. The other advantage is you can apply all the text controls that are available including <code>text-shadow</code>, <code>vertical-align</code>, <code>font-size</code> to tweak the output as you like, instead of fiddling around in SVG or with image sprites (<a href="http://blog.pictonic.co/post/32869817328/svgs-are-cool-but-icon-fonts-are-just-10-of-their">here are more details on why icon fonts are better</a>). The typical usage of icon fonts as pioneered by <a href="http://lab.simurai.com/buttons/">@simurai</a> is:</p>

<pre>[data-icon]::before {
    content: attr(data-icon);
}</pre>


<p>Then, when you generate custom icon fonts using services like <a href="http://icomoon.io/app">icomoon</a>, you can specify a character that will be used to represent that icon and use that as the value of the icon in the mark-up. For example, to render the twitter icon, I select the Twitter icon from one of the various free icons available on icomoon, and then set the character to be &#8216;t&#8217; in the app, and download the font:</p>

<p><img src="http://s3.amazonaws.com/Gyazo/1356408460.png" alt="" /></p>

<p>In your markup, you declare:</p>

<pre>&lt;b data-icon=t>subscribe on twitter&lt;/b>
</pre>


<p>This markup in combination with the CSS we declared earlier, would <a href="http://codepen.io/nimbupani/pen/fdlLe">render the twitter icon like so</a>:</p>

<p><img src="http://s3.amazonaws.com/Gyazo/1356408772.png" alt="" /></p>

<h2>Problem with Using Icon Fonts via Generated Content</h2>

<p>The first problem with this technique is Screen readers would read the alphabet used for the property <code>content</code>. This means, a person who uses a screen reader to navigate would hear &#8216;t twitter&#8217; rather than just &#8216;twitter&#8217;. This obviously is not so fun.</p>

<h2>Using Private Use Area for Icon Fonts</h2>

<p>Fonts are basically key value pairs, with the key being the character and the value a glyph (a path representation). For example, you see these letters in this post because the browser comes across a character, looks up the table for the font specified, &amp; uses that glyph to render that character (e.g. &#8216;a&#8217; or &#8216;b&#8217; or &#8216;.&#8217;). The universal standard that is being increasingly adopted is called <a href="http://www.joelonsoftware.com/articles/Unicode.html">Unicode</a>.</p>

<p>There is a whole range of key-value pairs within the Unicode table that are deliberately empty and that range is called Private Use Area (PUA).</p>

<p>We can use this area to reference icon fonts. Using <a href="http://icomoon.io/app">Icomoon&#8217;s icon font generator</a>, you can specify your icon as the glyph to represent a character from this PUA range:</p>

<p><img src="http://s3.amazonaws.com/Gyazo/1356429440.png" alt="" /></p>

<p><a href="http://icomoon.io/#docs#screenreaders">Icomoon&#8217;s documentation covers more details on how to use this</a>. Essentially, it is as simple as specifying the character used for the icon to be one from the Private Use Area (PUA) and using the HTML entity equivalent as a value for the <code>data-icon</code> attribute:</p>

<pre>&lt;b data-icon='&amp;#xe000;'>subscribe to twitter&lt;/b></pre>


<p>This would solve the problem of having screen readers read out icon fonts incorrectly, but it still leaves us with an extra set of tags, attribute (<code>data-icon</code>) &amp; associated style that I think we could do without. This we can do with the CSS property called <code>unicode-range</code>.</p>

<h2>Unicode Range</h2>

<p>I previously mentioned <code>unicode-range</code> in my <a href="http://nimbupani.com/jscamp-css-next.html">round-up of what is new in CSS</a>, &amp; how it can be used to <a href="http://24ways.org/2011/creating-custom-font-stacks-with-unicode-range/">enhance an existing ampersand</a>. I also have been wondering if unicode-range in combination with icon fonts set in Private Use Area could be used to render icons.</p>

<p>The markup then would merely be:</p>

<pre>&amp;#xe000; subscribe to twitter</pre>


<p>While the font-face declaration would change to:</p>

<pre>@font-face {
    font-family: 'icons';
    src: url(path/to/font.woff) format('woff');
    <b>unicode-range: U+E000-U+E005;</b>
}</pre>


<p>Then, when you define the base font:</p>

<pre>body {
   font-family: <b>icons</b>, sans-serif;
}</pre>


<p>This would render the icons inline with no other additions. This is nice, but previously with the <code>data-icon</code> process we could very easily hide or show icons based on Media/Feature queries by simply doing:</p>

<pre>@media (max-width: 400px) {
    [data-icon]::before { content: none; }
}</pre>


<p>But with inline icons, removing the font from the <code>font-family</code> would leave you with the empty rectangular glyph ():</p>

<p><img src="http://s3.amazonaws.com/Gyazo/1356426010.png" alt="" /></p>

<p>Does this mean, using unicode-range for fonts is a bust? Do we still need markup around these icons? There is a way out!</p>

<h2>Layout Font to the Rescue</h2>

<p>When I was wondering how to prevent this on Twitter, <a href="http://twitter.com/derschepp">Christian Schaefer</a> suggested the use of <a href="https://github.com/jonathantneal/layout-webfont">Layout Font</a> (a font that <a href="http://www.jonathantneal.com/">Jonathan Neal</a> invented to solve the problem of white-space impacting layouts using <code>display: inline-block</code> in CSS). The layout font merely replaces every glyph with what appears to be a &#8220;no space&#8221; in the font table. This will mean browsers when using this font would represent white space effectively as no space.</p>

<p>Now I was trying to figure out how to transform this font into one that would have this same &#8220;no space&#8221; as the value for all unicode characters. At this juncture, <a href="http://twitter.com/keyamoon">Keyamoon</a> came to the rescue by creating a <a href="http://codepen.io/Keyamoon/pen/bnwDL">base-64 encoded version of the layout font</a>.</p>

<p>And so, we are satisfied! Here is an example of how to use icon fonts with <code>unicode-range</code> but with a graceful fallback in case we do not want to render these icons any more.</p>

<pre>@font-face {
    font-family: space;
    src: url(data:application/x-font-woff;charset=utf-8;base64,d09GRk9UVE8AAAOYAAsAAAAABUwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAAAIQAAACQ1P+0gUZGVE0AAAGMAAAAGgAAABxjhaFsR0RFRgAAAagAAAAbAAAAIAAvAARPUy8yAAABxAAAAEsAAABgP9zcNGNtYXAAAAIQAAAAOgAAAUrgERK3aGVhZAAAAkwAAAAuAAAANvsbcvdoaGVhAAACfAAAAB0AAAAkBBD942htdHgAAAKcAAAACAAAAAgAAAAAbWF4cAAAAqQAAAAGAAAABgACUABuYW1lAAACrAAAAN4AAAGJ242MgnBvc3QAAAOMAAAADAAAACAAAwAAeJw9zUEKwjAQRuF/kkhKDa2WKgqjZ8gJXHoBj+CqSJtNK3gCkdnmsLMQFEHdvdX3CM6BiIrunPqUBpAB4aBsdGd14yRYCW5fYntqXiL/CF4umnWcMa41AwvGbcnwjEcD+zEK1FhPQ3eMMX7x3wOgOwyRmVc6umfW7CtpZSWhfANCyyLweJxjYGBgZACCk535hiD6zD9JWRgNAEIVBfQAAHicY2BkYGDgA2IJBhBgYmCEQhYwjwEABFUANAB4nGNgZvzCOIGBlYGD0YcxjYGBwR1Kf2WQZGhhYGBiYGVmgAMBBJMhIM01hcHhA8MHBsYH/x8w6DE+YFBoYGBghCtQAEJGAGqIDSIAeJxjYGBgZoBgGQZGBhBwAfIYwXwWBg0gzQakGRmYGBg+MPz/D1IAoQUYoeqBgJGNAcEZoQAAbecGtwAAeJxjYGRgYADiTz08rvH8Nl8ZuJkYQODMP0lZBP3/ARMD4wMgl4MBLA0AIQUKSgAAeJxjYGRgYHzw/wGDHgMQ/GNgAnIZUAETAG2yA/MAAAAAAAAAAAAAAAAAUAAAAgAAeJx1jjFOAzEQRd8mmyAUhKgQpQsKml3ZVqocYEVNkT6KrNVKSSw5SZOD0HIESo7BATgCl+DHcUMRSyM/f/+ZP8Ad71ScT8UND4VH4pfCY545Fa6lfxaeMOO78FT6r5xVfSvlPnedeSR+KjzmFVu4lv5ReMIjX4Wn0n8YWBPZqiI7GNZxG6PgjUDPkQ0rkp6hP25Wgi77DvlOcgQMnlZphoXq/7yL5pnT4HQ3KpuJLu4OXUx9ML61ZmFKssjPG+cbb51c19ZbKjix1/8lxuUVWIa0HzTEtfZq7x+jCTpIAAB4nGNgZsALAAB9AAQ=) format('woff');
}

body { font-family: <b>icons</b>, sans-serif; }

@media (max-width: 400px) {
    body { font-family: <b>space</b>, sans-serif; }
}</pre>


<p>You can see this <a href="http://nimbu.in/private-use-unicode">adaptive icon font in action here</a>.</p>

<h2>Browser Support</h2>

<p>Why do you trouble me with reality? :| I previously erroneously stated that <code>unicode-range</code> is supported amongst all browsers, but this is not the case. It is only supported in Safari &amp; Chrome.</p>

<p>This method maybe useful when <code>unicode-range</code> is more widely supported, but all I wanted to do was to find new ways to kill fluffy markup.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Book Reviews for 2012]]></title>
    <link href="http://nimbupani.github.com/book-reviews-for-december-2012.html"/>
    <updated>2012-12-23T18:50:00+05:30</updated>
    <id>http://nimbupani.github.com/book-reviews-for-december-2012</id>
    <content type="html"><![CDATA[<p>I had almost stopped reading books, till I picked up <a href="http://www.worldcat.org/title/savage-detectives/oclc/70265594">Savage Detectives</a> about 3 months ago. I have since spent more time reading books, and this month has been the most I have read in this year. Here are reviews of some books I have been reading.</p>

<h2>Savage Detectives</h2>

<p>Thanks to the frequent prodding of <a href="http://twitter.com/angustweets">Angus Croll</a> &amp; <a href="http://twitter.com/edwardawkward">Edward Awkward</a>, I started reading this novel. Suffice to say, I would be hard-pressed to find a novel I have savoured more. Roberto Bolaño weaves an amazing narrative full of strange characters (yet believable) and not only does he write, but also has illustrations! And it does not appear strange or weird at all, but in fact you wonder how can there <em>not</em> be illustrations?</p>

<p>It must have taken years for Bolaño to exhibit this skill with words &amp; writing, and if it appears so in translation, I can only wonder how amazing it must really be in the original text.</p>

<h2>From the Ruins of an Empire</h2>

<p>Pankaj Mishra writes from the perspective of the East Asian philosophers &amp; intellectuals about the savagery of colonialism that inflicted that part of the world. <a href="http://www.worldcat.org/title/from-the-ruins-of-empire/oclc/807995057">From the Ruins of an Empire</a> is in part a response to all the positive &amp; almost heroic portrayal of colonialism by historians such as <a href="http://www.worldcat.org/title/empire-the-rise-and-demise-of-the-british-world-order-and-the-lessons-for-global-power/oclc/51518397">Niall Ferguson</a>.</p>

<p>While I found this book very emotional &amp; less of a view from a dispassionate analyst, reading through the events makes it really difficult to understand how it could be otherwise.</p>

<p>This book just underscores how much of history is written by the victorious. Not even growing up in India, did I get to understand &amp; realise various genocides that the British rule allowed (or even enabled) in India. This book at least enlightens in some manner the corrosive nature of colonialism.</p>

<h2>Twilight in Delhi</h2>

<p>I chanced on <a href="http://www.worldcat.org/title/twilight-in-delhi-a-novel/oclc/956337">Twilight in Delhi</a> under packs of new Indian thriller novels in a bookstore nearby. I recalled reading about this in the bibliography of Pankaj Mishra&#8217;s book as a novel that authentically elaborates the culture that was lost when Mughal Empire was in ruins.</p>

<p>I really want to like this book, but its narrow-minded nostalgia reminds me of the nostalgia Glenn Beck has for those &#8220;good old days&#8221; when racism was abundant. Unlike <a href="http://www.worldcat.org/title/jewel-in-the-crown-a-novel/oclc/456694">The Jewel in the Crown</a> (the other nostalgia book I read) this book has almost no interesting characters who are not muslim or at least dealing with being someone who feels neither here nor there.</p>

<p>Perhaps these people really felt Mughal rule was full of glory and innocently forget the slaughter and destruction that was wrought on non-muslims. Maybe, like the city-dwellers of India who know nothing of the sufferings of those in villages, they believed Mughal Empire was truly glorious and the British were the only cause of destruction.</p>

<p>It was a good read but not interesting enough to consider it as important as The Jewel in the Crown in the context of historical fiction.</p>

<h2>From the Caves &amp; Jungles of Hindostan</h2>

<p>In Chennai, I live very close to the <a href="http://en.wikipedia.org/wiki/Theosophical_Society_Adyar">Theosophical Society</a> and reading whatever little about Theosophy, it seemed like Madam Blavatsky&#8217;s writings would make a very entertaining &amp; humorous read (or perhaps arouse my anger). I was very very surprised when I found someone from <em>that</em> era writing with as less bias as possible about Indians and the culture of hinduism.</p>

<p>This book reads like a journal or at least a set of letters, but is a fictional account of her travels in India. I made <a href="http://goo.gl/maps/fcqj0">a map of the places Madam Blavatsky went to</a> for fun and it is clear it is not a report of any single journey.</p>

<p>What is fascinating though, is how perceptive she is. The book was originally published just after the Mutiny and she writes:</p>

<blockquote><p>The English education they receive only enables them to learn that Europe was plunged in the darkness of the Stone Age, when India was in the full growth of her splendid civilization. And so the comparison of their past with their present is only the more sad.</p></blockquote>

<p>Further, she does not seem to be enamoured by the caste system or idol worship and especially the male brahmans. She also explains how women are treated so wretchedly and seems to suggest the higher-caste a woman is the more wretched she is treated.</p>

<p>Almost everything she mentions about brahmans are ways I know brahmins behave – which only makes me all the more angry about the disgusting caste system.</p>

<p>I did not imagine I would like this book but I came away with more respect for her &amp; her work rather than simply finding entertainment in laughing at her.</p>

<h2>Red Sun – Travels in Naxalite Country</h2>

<p>This was the first book I bought on <a href="flipkart.com">FlipKart</a> which is interesting online shopping experience because it allows you to pay by Cash on Delivery. This was my first experience of doing that anywhere, and it was pretty smooth with constant updates via SMS on the state of my book.</p>

<p>Anyways, if there is one book you must read about India, it must be <a href="http://www.worldcat.org/title/red-sun-travels-in-naxalite-country/oclc/227929760">Red Sun – Travels in Naxalite Country</a>. Most of the vocal Indians online (including myself) live in the cities where murder &amp; mayhem are pretty rare (<a href="http://www.thehindu.com/news/national/delhi-gangrape-victim-narrates-the-tale-of-horror/article4230038.ece">except if you live in Delhi</a>), and hence we are unaware of what happens outside of these cities.</p>

<p>Sudeep Chakravarti talks to various ex and current naxals and tries to find out why they are at war with the government of India. The picture of reckless violence &amp; corruption he paints makes you wonder how you can even consider India as a country that is making progress. Tribals have never had a voice before and even today their situation is unchanged.</p>

<p>Madam Blavatsky&#8217;s tales mention the constant terror of tigers as soon as you get out of town and it is hilarious to contrast that with the current situations where tigers are almost extinct and almost all available forest land is being converted to coal mines being controlled by private militia &amp; tribals - whose daily sustenance derives from such forests – are being driven out.</p>

<p>Two movies I saw recently make Sudeep&#8217;s book even more vivid in my mind: <a href="http://www.imdb.com/title/tt1954470/">Gangs of Wasseypur</a> and <a href="http://www.imdb.com/title/tt2072227/">Shanghai</a>.</p>

<h2>The Science of Criticism in India</h2>

<p>What I did not know when I visited the Theosophical Society earlier is the society has a book store with books that have been published once and never again – especially analysis of old Sanskrit texts by Indologists.</p>

<p><a href="http://www.worldcat.org/title/science-of-criticism-in-india/oclc/10711031">The Science of Criticism in India</a> is one such book. I have been watching a lot of movies lately and been trying to understand why I liked a movie more than another, and this book tells me that it is because of the <em>rasa</em> each movie brings about on me as an audience.</p>

<p>A.K. Warder states that critics of sanskrit literature have viewed &#8216;literature&#8217; to be one that foremost gives pleasure or delight. In that respect, some of the critics have also authored their criticisms to foremost be delightful or pleasurable. Meanwhile, some others (as commentary to their interpretation of plays such as <a href="http://en.wikipedia.org/wiki/Meghad%C5%ABta">Meghadhūta</a> or <a href="http://en.wikipedia.org/wiki/Harshacharita">Harshacharita</a>) spend time delineating what aspects of the play are causes of such pleasure or delight.</p>

<p>If only all movie critics spent time trying to elaborate their criticisms in this manner! A lot of art critics spend time trying to impress the reader with their knowledge of the era when the art was created rather than trying to elaborate on what the experience of the art brings. While history of the creation of the art is interesting, what is more interesting is <em>why</em> this art is worth getting a &#8216;taste&#8217; of.</p>

<p>It was good to understand the various criteria these critics from several years before the Christian Era thought was vital to dissecting why a particular art was the cause of delight.</p>

<h2>Ramanuja on Yoga</h2>

<p>I got <a href="http://www.worldcat.org/title/ramanuja-on-the-yoga/oclc/7733006">Ramanuja on Yoga</a> to understand what &#8220;Yoga&#8221; really is. It was mandatory for me to do yoga at school, when nobody outside of my school even cared or knew what yoga was. Suddenly, everyone in any major city seems to be a member of a yoga class!</p>

<p>Sadly, this book is specifically about Ramanuja&#8217;s views on Yoga, which states Yoga is only a means to focus your mind on the &#8216;Supreme Being&#8217; &amp; you must engage in constant devotion to actually become one with the &#8216;Atman&#8217;.</p>

<p>I do not understand how Ramanuja can glibly state humans must be beyond anger and sadness while apparently this Supreme Being is not and will only bestow favours &amp; release of the soul from the body with 24/7 devotion and practice of all the actions prescribed for that particular caste.</p>

<p>This book suggests <a href="http://en.wikipedia.org/wiki/Pata%C3%B1jali_Yoga_Sutras">Patanjali&#8217;s original treatise on Yoga</a> is devoid of any allusion to a Supreme Being, which makes it more like a book I would be interested in reading.</p>

<h2>Your Recommendations?</h2>

<p>I hope this bout of reading illness persists! If you have any interesting books to recommend, please do so in the comments.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[JSCamp: CSS Next]]></title>
    <link href="http://nimbupani.github.com/jscamp-css-next.html"/>
    <updated>2012-12-01T06:09:00+05:30</updated>
    <id>http://nimbupani.github.com/jscamp-css-next</id>
    <content type="html"><![CDATA[<p>I talked at <a href="http://jscamp.asia">JSCamp</a> on 28th November 2012, on some of the newer features of CSS. I gave the talk without slides, so here is a description of all that I covered.</p>

<h2>No CSS3 or CSS4</h2>

<p>Before I delve into what the newer features of CSS that I am very interested in are, I want to clarify a myth that persists on how there are varying ‘versions’ of CSS like CSS3 and CSS4. <a href="http://www.xanthir.com/b4Ko0">Tab Atkins wrote in detail about why there is no CSS3</a>. Essentially, work after <a href="http://www.w3.org/TR/CSS21/">CSS 2.1 specification</a> has been split into independent modules that can all reach stability independent of each other, so specifications can become stable and recommendations faster.</p>

<h2>Typography</h2>

<p>The <a href="http://dev.w3.org/csswg/css3-fonts/">Font Module</a> has a couple of interesting features that are worth looking at.</p>

<h3>Open Type Features</h3>

<p><a href="http://timepiece.inostudio.de/"><img src="http://s3.amazonaws.com/Gyazo/1354317414.png" alt="" /></a></p>

<p>Open Type Fonts have a features file that exposes ligatures (and other features) to applications that understand and enable these. Till recently browsers did not have the ability to expose these features that would allow you to use these ligatures from within stylesheets. But now you can.</p>

<p>To do this, you would have to use <code>font-feature-settings</code> like so (you must add the appropriate prefixes <code>-ms</code>, <code>-webkit-</code> &amp; <code>-moz-</code> &amp; <code>-o-</code> when Opera supports it):</p>

<pre>h1 {
 font-feature-settings: 'liga';
}</pre>


<p>This tells the browser to enable Common Ligatures in the Open Type font.</p>

<p>Georg Seifert of <a href="http://glyphsapp.com">Glyphs</a> has created a very cool font that <a href="http://timepiece.inostudio.de/">exploits these ligatures to create a lovely clock</a>.</p>

<h3>Unicode Range</h3>

<p>Fonts are essentially a table of glyphs that represent each code point. Browsers look up the table for each code point and render that glyph on the screen.</p>

<p>The @font-face rule used to specify web fonts can include a declaration for <a href="http://dev.w3.org/csswg/css3-fonts/#unicode-range-desc"><code>unicode-range</code></a>. When this property is declared, the browser knows that the font specified in the <code>@font-face</code> rule must only be used when that range of <a href="http://www.joelonsoftware.com/articles/Unicode.html">unicode code points</a> are found in text. This way, <a href="http://rishida.net/blog/?p=760">you can control the rendering of English letters when they occur in conjunction with letters of another language</a> instead of defaulting to system fonts. Here is how you would use them:</p>

<pre>@font-face {
  font-family: myJapanesefont;
  src: local('Bookman Antiqua');
  unicode-range: U+41-5A, U+61-7A, U+C0-FF;
}</pre>




<pre>h1 {
  font-family: myJapanesefont, MS-Mincho;
}</pre>


<p>But this property is also useful if you want to specify better ampersands or use fonts as icons.</p>

<h3>Better Ampersands</h3>

<p>A few years ago, it was all the rage to use a different font for the ampersands (&amp; symbol) than the current one. The way this was done was to wrap the symbol in a <code>&lt;span class='amp'&gt;</code> and then use a different font-family for the class <code>.amp</code>. With <code>unicode-range property</code>, you could merely use the @font-face rule to specify the font you want to use for that particular character (specified with <code>unicode-range</code>) and not bother at all with adding extra tags.</p>

<p>This method is described in detail by Drew McLellan in his <a href="http://24ways.org/2011/creating-custom-font-stacks-with-unicode-range/">24 Ways article</a>.</p>

<p><a href="http://nimbu.in/jscamp/unicode-range.html">Demo of using Baskerville font for &amp; symbol</a>.</p>

<h3>Font Icons</h3>

<p>The unicode tables have a private-use space allocated that would allow any font creator to use that space to create glpyhs that are not standard (e.g. glyphs that do not represent Latin, or other language characters or standardized symbols). Using this area of the table, you could create icons in a font, and only have these icons render on screen when the font itself is used.</p>

<p>This is what <a href="https://github.com/blog/1135-the-making-of-octicons">GitHub uses</a> for their <a href="https://github.com/styleguide/css/7.0">Octicons</a>.</p>

<h2>Layout</h2>

<h3>Exclusions</h3>

<p><a href="http://dev.w3.org/csswg/css3-exclusions/">Exclusions</a> would allow you to wrap text within a specified shape. Currently an implementation of <code>shape-inside</code> property that would allow text to wrap <em>within</em> a path is available in Chrome Canary. <a href="http://twitter.com/bear_travis">Bear Travis</a> wrote <a href="http://betravis.github.com/shape-tools/polygon-drawing/">a tool for determining polygon shapes</a> that can be used for generating the path. In brief, you would use it as such:</p>

<pre>.crow {
  shape-inside: polygon(0 0, 0 100%, 100% 100%, 100% 0);
}</pre>


<p><a href="http://nimbu.in/jscamp/shape-inside.html">Demo of shape-inside</a> (<em>turn on &#8216;Enable Experimental WebKit Features&#8217; in chrome:flags in Chrome Canary to see this</em>)</p>

<h3>Regions</h3>

<p><a href="http://dev.w3.org/csswg/css3-regions/">Regions specification</a> has features that allows your content to be separate from the layout structure.</p>

<p>First you declare which elements will be part of the named flow of content:</p>

<pre>.news-items {
  flow-into: newsflow; /* name of the flow */
}</pre>


<p>Then, you declare which elements will be the recepients of the content within the named flow:</p>

<pre>.news-items-container {
  flow-from: newsflow; /* name of the flow */
}</pre>


<p>This means, all elements that have the class <code>news-items-container</code> will no longer display content they originally had, but will only display content that flows into them through the named flow called <code>newsflow</code>.</p>

<p>The <a href="http://blogs.adobe.com/webplatform/2012/09/27/web-inspector-support-for-css-regions/">Web Inspector in Chrome Canary</a> has a way to debug which elements are part of a flow and which are recepients of a flow.</p>

<p><a href="http://nimbu.in/jscamp/regions.html">Demo of regions</a> (<em>turn on &#8216;Enable Experimental WebKit features&#8217; in chrome:flags in Chrome Canary to see this</em>)</p>

<h2>Graphics</h2>

<h3>Native Filters</h3>

<p>It is now possible to use image processing functions such as <code>greyscale</code>, <code>sepia</code>, <code>blur</code> on HTML and SVG elements. You can do this by using a CSS property known as <code>filter</code> like so:</p>

<pre>.banner {
  filter: blur(10px);
}</pre>


<p>These are known as <em>native</em> filters as the functions are provided out of the box by browsers. You can use this feature in Safari 6, Mobile Safari &amp; Chrome.</p>

<p>Here is how blur has been used to <a href="http://codepen.io/vcurd">simulate depth of field</a>.</p>

<h3>Custom Filters</h3>

<p>Instead of using browser-provided filters, you can use your own. To do this, you would use <a href="http://www.w3.org/TR/filter-effects/#feCustomElement">GLSL shaders</a> - that are typically used in WebGL - via custom filter function.</p>

<pre>.banner {
 filter: custom(url(/path/to/shader.vs));
}</pre>


<p>The above declaration tells the browser to create vertice maps for each element that matches the selector, run them through the shader provided within the custom function and finally render the results on the screen. The interesting thing is these shaders can also take custom arguments that would determine the extent to which you want to apply these shaders.</p>

<p><a href="http://twitter.com/alteredq">Altered Qualia</a> has a <a href="http://alteredqualia.com/css-shaders/article">great in-depth article on how to write and use Shaders for Custom Filtering</a>. You can also play with some of the custom filters on <a href="http://html.adobe.com/webstandards/csscustomfilters/cssfilterlab/">CSS FilterLab</a></p>

<p><a href="http://nimbu.in/jscamp/custom-filters.html">Demo of Custom Filters</a> (<em>turn on &#8216;Enable CSS Shaders&#8217; in chrome:flags in Chrome Canary to see this</em>).</p>

<h3>Blend Modes</h3>

<p>In Photoshop and other Graphic Editing tools, there has always been an option to specify how each layer interacts with other layers below it. This is typically specified using a dropdown of blend modes that have values such as &#8216;overlay&#8217;, &#8216;multiply&#8217;, &#8216;darken&#8217;, &#8216;lighten&#8217;, &#8216;difference&#8217;, etc.</p>

<p>My team at Adobe has been working on a <a href="http://adobe.github.com/web-platform/demos/compositing/">specification and a prototype build</a> out that brings the power of those blend modes to the web via CSS. This would happen via specifying the property <code>blend-mode</code> on the elements you want to target:</p>

<pre>.banner h1 {
    blend-mode: difference; 
}</pre>


<p><a href="http://adobe.github.com/web-platform/demos/compositing/blend-photogallery/index.html">Demo of blend modes</a> (<em>use this <a href="https://github.com/adobe/webkit/downloads">prototype build of Chromium</a> to view this</em>).</p>

<h2>Responsible Styling</h2>

<p>You must use styles responsibly, especially properties such as flex box which can lead to drastically unreadable results in unsupported browsers. Previously, <a href="http://modernizr.com">Modernizr</a> came to the rescue. But now, there is a <a href="http://www.w3.org/TR/css3-conditional/">specification that adds conditional rules natively via <code>@supports</code></a>:</p>

<pre>@supports (font-feature-settings: ‘liga’) or
          (-webkit-font-feature-settings: 'liga') or
          (-moz-font-feature-settings: 'liga=1') {
  h1 {
    font-family: 'A Common Ligatured Font', serif;
  }
}</pre>


<p>Browsers that understand <code>@supports</code> would then check if any of the declarations (<code>font-feature-settings: 'liga'</code> or <code>-webkit-font-feature-settings: 'liga'</code>) is supported and if so, render the styles for the <code>h1</code> selector within the <code>@supports</code> rule. This way of writing CSS may be familiar to you via Media Queries.</p>

<p>This is a great way to do feature-detection natively and specify different rules when advanced features are supported while providing a basic but readable experience on other browsers. <a href="http://dev.opera.com/articles/view/native-css-feature-detection-via-the-supports-rule/">Chris Mills has written in greater depth about this rule on dev.opera.com</a></p>

<p><code>@supports</code> rule is available in Opera and Firefox (under a flag), and <a href="http://trac.webkit.org/changeset/131783">soon in WebKit</a>.</p>

<p><a href="http://nimbu.in/jscamp/supports.html">Demo of @supports rule</a> (<em>use Opera or Firefox 17+ with &#8216;layout.css.supports-rule.enabled&#8217; set to true in <code>about:config</code></em>).</p>

<h2>Non-standard but interesting</h2>

<h3>Canvas as Background Image</h3>

<p>WebKit browsers have had, for more than 2 years, <a href="https://www.webkit.org/blog/176/css-canvas-drawing/">support for writing to a canvas that is used as a background image for elements</a>. This is specified as such:</p>

<pre>.banner {
  background-image: canvas(contextForCanvas);
}</pre>


<p>Instead of writing the pixels to the context of a Canvas element, you would write it to the context of that background image (<code>contextForCanvas</code>):</p>

<pre>
var context = document.getCSSCanvasContext(‘2d’, contextForCanvas, canvasWidth, canvasHeight);
</pre>


<p><a href="http://nimbu.in/jscamp/css-canvas.html">Demo of canvas as <code>background-image</code></a> (<em>please use Safari or Chrome to view this</em>)</p>

<h3>Elements as Background Image</h3>

<p>The use of canvas as a background image is somewhat similar to a <a href="https://hacks.mozilla.org/2010/08/mozelement/">Mozilla proposal to have elements as background images</a>:</p>

<pre>
.banner {
  background-image: element(#elementID);
}</pre>




<pre>
&lt;div class='banner'&gt;This is a banner&lt;/div&gt;
&lt;p id='elementID'&gt;This is the element that will be a background.&lt;/p&gt;
</pre>


<p><a href="http://twitter.com/simurai">Simurai</a> created <a href="http://jsfiddle.net/simurai/JKZTu/21/show/">this interesting kalaidescope effect using this property</a>.</p>

<p>Personally, I find the <code>element</code> function confusing and easy to make mistakes with (e.g. adding a twitter widget to a supposedly empty element suddenly has it appear as a background to another element). Hopefully, some middle-ground between canvas as a background image and elements as a background image will be arrived at.</p>

<h2>In Conclusion</h2>

<p>There are lots of new and interesting features out there and it would be <em>awesome</em> if you could take the time to play with them and <a href="http://lists.w3.org/Archives/Public/www-style/">provide feedback</a>. There are plenty of new features I did not cover because I thought I was out of time (I wasn’t!) like <a href="http://css-tricks.com/old-flexbox-and-new-flexbox/">Flexbox</a>, <a href="http://dev.w3.org/csswg/css3-grid-layout/">Grid Layout</a>, <a href="http://css3.bradshawenterprises.com/blog/css-variables/">Variables</a>, <a href="https://developer.mozilla.org/en-US/docs/CSS/calc">Calc()</a>, and more.</p>

<p>My talk was just several browsers each with pinned tabs of each demo. <a href="http://nimbu.in/jscamp/">Here is a list of all of the demos I showed</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Some Updates]]></title>
    <link href="http://nimbupani.github.com/some-updates.html"/>
    <updated>2012-11-22T17:43:00+05:30</updated>
    <id>http://nimbupani.github.com/some-updates</id>
    <content type="html"><![CDATA[<p>While this website has been lying dormant, I have been doing many things that are more actively tracked on <a href="http://twitter.com/divya">twitter</a>. Here are some of the highlights of what I have been up to.</p>

<h2>Adobe</h2>

<p>Some of you know I now work at Adobe. But I have since June been the Product Manager for the Web Engine team! I had not previously lived a life of a Product Manager, but for every programmer out there who thinks it is a better life, think again! I find it easier to program than to convince humans.</p>

<h2>Fripfrap</h2>

<p>So <a href="http://twitter.com/garannm">Garann</a> and I have a regular podcast/video stream going on. We didn&#8217;t speak about it much because we were not sure if we really wanted to do it. But, after recording 3 episodes, I think it is worth your while to spend 20 minutes of your life on :) <a href="http://fripfrap.io">Check it out</a>!</p>

<h2>Book</h2>

<p>I have also been up to my gills writing a book on HTML5 Boilerplate. The toughest part of writing a technical book is how often code changes. <a href="http://twitter.com/necolas">Nicolas Gallagher</a> has been doing such an excellent job of maintaining <a href="http://html5boilerplate.com">HTML5 Boilerplate</a> that it was many times I had to rewrite a lot of chapters based on newer updates. Nevertheless, I <strong>still</strong> need to write more errata as there are already updates while the book went out to print!</p>

<p>You can <a href="http://www.packtpub.com/html5-boilerplate-web-development/book">purchase the book at Packt</a> or get a <a href="http://www.amazon.com/HTML5-Boilerplate-Web-Development-ebook/dp/B009RR0IFE">Kindle version on Amazon</a>. If you have already got your copy, please let me know if you have any feedback!</p>

<p>The money I earn on this book goes to <a href="http://www.givewell.org/international/top-charities/AMF">Against Malaria Foundation</a> which consistantly is lauded for its effective aid programmes.</p>

<h2>Talks</h2>

<p>I have been giving several talks over the few months in Australia, New Zealand, France, Germany, UK and in US. I thought I would round up the major topic areas and link to videos of the talks as they exist:</p>

<h3>Designing in the browser</h3>

<iframe width="560" height="315" src="http://www.youtube.com/embed/h52uumn3sZc?rel=0" frameborder="0" allowfullscreen></iframe>


<p>I posit that modern web technologies require designers to use the medium to design for it. <a href="http://nimbu.in/codemelb">Slides for Designing in the Browser</a></p>

<h3>Pushing the cutting edge forward</h3>

<iframe src="http://player.vimeo.com/video/49730056?badge=0" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>


<p>A talk on what standards are, how they are created and how to effectively contribute to shaping how standards evolve without losing your mind. I gave the same talk @ SF HTML5 Meetup, which has the more up to date content. <a href="http://nimbu.in/sfhtml5/">Slides for Pushing the Cutting Edge Forward</a></p>

<h3>Web Components with your favourite CSS Specs</h3>

<iframe width="560" height="315" src="http://www.youtube.com/embed/FO3hTypPB1U?rel=0" frameborder="0" allowfullscreen></iframe>


<p>A talk on how to use the Shadow DOM with some new exciting CSS Specifications along with some important things to note while using these specs in tandem. <a href="http://nimbu.in/jsconfeu/">Slides for Web Components with your favourite CSS Specs</a></p>

<p>I will be giving a talk on what&#8217;s next for CSS at <a href="http://jscamp.asia">jscamp.asia</a>. There is a good mix of interesting people coming by, so if you are in that region, please do come to the conference!</p>

<h2>Dotfiles</h2>

<p>I finally found the time to customize my dotfiles! I started with <a href="https://github.com/mathiasbynens/dotfiles">Mathias Bynens&#8217;s dotfiles</a> as was recommended on <a href="http://dotfiles.github.com">Github</a> and then went over to the others. But finally ended up on <a href="http://github.com/necolas/dotfiles">Nicolas Gallagher&#8217;s dotfiles</a> as they were most well-organized &amp; written. I added an AWS CLI as I upload my screen captures to AWS S3 bucket and some other tiny aliases that I thought was useful.</p>

<p>I hope to spend my vacation writing my own website generator as one is bound to do and get rid of Octopress monolith! I hope you have a great holiday season!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[CSS Object Model]]></title>
    <link href="http://nimbupani.github.com/css-object-model.html"/>
    <updated>2012-06-18T10:48:00+05:30</updated>
    <id>http://nimbupani.github.com/css-object-model</id>
    <content type="html"><![CDATA[<p>Until <a href="http://testthewebforward.org">Test the Web Forward</a> I had just a vague idea of what CSS Object Model does. So, it was awesome to hear from and learn about the <a href="http://dev.w3.org/csswg/cssom/">CSS Object Model</a> from the spec co-editor <a href="https://twitter.com/gasubic/">Glenn Adams</a>.</p>

<h2>What it is</h2>

<p>The CSS Object Model specification provides APIs that allow you to query and manipulate styles once the browser reads and understands the stylesheets and inline styles that are used on the page that is being rendered. An older specification that standardizes this was called DOM Level 2 Style Specification. It was the first specification that provided ability to access and manipulate styles via JavaScript using the DOM API.</p>

<p>The fragmented history of the web sadly means most of these APIs do not quite work the way they are intended to in many browsers. Glenn wrote in to state what the goals of the current specs are, which include:</p>

<ul>
<li>Fully specify behavior that was left unstated, vague, or ambiguous in DOM-2 Style spec.</li>
<li>Remove functionality specified in DOM-2 Style that is not widely implemented and not perceived as necessary.</li>
<li>Add functionality not specified in DOM-2 Style that has been widely implemented and is viewed as sufficiently important.</li>
</ul>


<p>The APIs from the specification that have been implemented so far offer the abilitiy to query rules specified in the stylesheets or a text representation of the styles in a stylesheet or the inline styles of an element within the rendered page. For example, you can get the value of <code>margin</code> of an element by using <code>getComputedStyle('element,optional pseudoElement').margin</code>. You can also get the full style declaration that applies to an element as a string by using <code>getComputedStyle('element,optional pseudoElement').cssText</code>.</p>

<h2>The <code>CSSStyleDeclaration</code> Object</h2>

<p>The <code>getComputedStyle</code> method retuns what is known as a <code>CSSStyleDeclaration</code> object. It enumerates all style properties (&amp; values). This is the object that is returned whenever you query for style information using:</p>

<ul>
<li><p><code>document.styleSheets[0].cssRules[0].style</code></p></li>
<li><p><code>Element.style</code></p></li>
<li><p><code>document.getOverrideStyle</code> (unimplemented in most browsers, but would be useful for <a href="http://stackoverflow.com/questions/9798210/is-there-any-way-to-reset-after-before-css-rules-for-an-element">getting/setting hover, and other pseudo-classes</a>).</p></li>
<li><p><code>window.getComputedStyle</code></p></li>
</ul>


<p>The returned object itself can be changed (it is <em>mutable</em> which means you can set a style property like <code>Element.style.margin = "20px"</code>) in all cases except the last. If you try to change a property of the object returned by <code>window.getComputedStyle(Element)</code>, you would get an exception.</p>

<h2>CSS Rules</h2>

<p>Rules within stylesheets have an object model too. There are 6 kinds of <a href="http://nimbupani.com/css-vocabulary.html">CSS rules</a> that could apply:</p>

<ul>
<li>Style rules (e.g <code>h1 {}</code> or <code>#main a {color: red; }</code>)</li>
<li>@import rules (e.g. <code>@import url(main.css)</code>)</li>
<li>Page rules (e.g. <code>@page :first {color: red; }</code>)</li>
<li>@font-face rules (e.g. <code>@font-face {}</code>)</li>
<li>Namespace rules (e.g. <code>@namespace svg http://svg.org</code>)</li>
<li>Media rules (e.g. <code>@media (min-width: 200px)</code>)</li>
</ul>


<p>Not only that but you can even access the individual selectors that you specified in your style sheet. The values for properties in selectors are also serialised. How these values are serialised has also been documented in the specification. For example, if an element has a style property set (inline or set from within a stylesheet) like so <code>margin: 20px 20px 20px 20px;</code>, the specification states that when you access the style using <code>cssText</code> it should return <code>margin: 20px;</code>.</p>

<h2>Testing CSS Values</h2>

<p>The above serialization of CSS values seemed trivial and I thought would be a good test to start with. So, I wrote a <a href="https://dl.dropbox.com/u/952/ttwf/index.html">small test</a>. The results were interesting:</p>

<ul>
<li>Firefox &amp; IE 9 were the only browsers that returned the expected value of <code>"margin: 20px"</code></li>
<li>Chrome returned <code>"margin: 20px; "</code> (note the whitespace after the semi-colon)</li>
<li>Opera bizarrely returns <code>"margin-top: 20px; margin-bottom: 20px; margin-left: 20px; margin-right: 20px"</code> (also note the missing last semi-colon).</li>
<li>Safari returned <code>"margin-top: 20px; margin-right: 20px; margin-bottom: 20px; margin-left: 20px; "</code> (note the space after the last semi-colon).</li>
</ul>


<p>Imagine the frustration of someone trying to write a CSS Style editor and wanting to show CSS style rules correctly! Glenn tells me that radical differences like these exist because the original DOM 2 Style spec did not document the serialization rules (he also pointed to this <a href="http://lists.w3.org/Archives/Public/www-style/2012Jan/1122.html">thread that discusses which properties get serialized or not</a>).</p>

<p>Hopefully, because of Test the Web Forward, we can have more such tests in the future to ensure all browsers implement these APIs and specifications correctly. There are many other APIs available in the CSS OM. Interestingly, I was made aware of the longest property name (proprietary though) in existence: <del><code>-webkit-match-nearest-mail-blockquote-color</code></del> (thanks to <a href="http://twitter.com/awesomekling">Andreas Kling</a> this is <a href="http://trac.webkit.org/changeset/120735">no longer the case</a>, it is now <code>-webkit-border-bottom-right-radius</code>) (I wonder what is the shortest?).</p>

<p>If you are interested in writing and contributing CSS tests, first <a href="https://test.csswg.org/shepherd/register/">make an account</a> (please do make sure to check the box for &#8216;Request Repository Write Access&#8217;) and then follow along with <a href="http://adobe.github.com/web-platform/presentations/test-the-web-forward-tutorial/index.html">this presentation</a> by <a href="http://twitter.com/JacobG415">Jacob Goldstein</a> &amp; <a href="http://twitter.com/RebeccaHauck">Rebecca Hauck</a>.</p>

<p><em>Many thanks to Glenn Adams &amp; Paul Irish for reviewing this post.</em></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Visualization Lies]]></title>
    <link href="http://nimbupani.github.com/visualization-lies.html"/>
    <updated>2012-06-02T13:51:00+05:30</updated>
    <id>http://nimbupani.github.com/visualization-lies</id>
    <content type="html"><![CDATA[<p>I fell in love with this bar chart <a href="http://www.theatlantic.com/business/archive/2012/05/this-graph-is-disastrous-for-print-and-great-for-facebook-or-the-opposite/257857/">as soon as I saw it</a>:</p>

<p><img src="http://cdnbakmi.kaltura.com/p/695492/sp/69549200/thumbnail/entry_id/1_o1rtsgly/width/634/height/484" alt="" /></p>

<p>But, there is <a href="http://nimbupani.com/the-danger-of-story.html">a danger of a single story</a> - a story that seems to vindicate your point of view. So, I wanted to get to the truth of this statistic.</p>

<p>The first thing the chart claims is that the data comes from an eMarketer report. So I went digging. Here is a <a href="http://www.emarketer.com/PressRelease.aspx?R=1008732">press release from them that seems to have the data that is represented in the chart</a>. Here is what they say about that data:</p>

<blockquote><p>eMarketer forms its estimates of time spent with media based on a meta-analysis of data from dozens of research sources, including survey and study data.</p></blockquote>

<p>Note the word &#8220;estimates&#8221;? Essentially, what eMarketer is stating is that the data is just a lot of smoke and the fire is so far down that nobody knows if it is a fire or a dragon or the beginnings of a black hole.</p>

<p>Just makes me wonder how much of other fluff all this analysis of the emergence of &#8220;Social&#8221; as the next territory is based on.</p>

<p>To be fair, from what I see around me in the US and in India, I know a significant portion of the population spends its waking hours hunched over their mobile phones rabidly checking Facebook. I have no doubt Facebook is where everyone will spend significant portion of their time online. But, cooking up fake data to confirm our suspicions seems hardly a good way forward.</p>

<p>How about we do less &#8220;analysis&#8221; and more observation of the world around us?</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Moving to SF]]></title>
    <link href="http://nimbupani.github.com/moving-to-sf.html"/>
    <updated>2012-03-27T08:18:00+05:30</updated>
    <id>http://nimbupani.github.com/moving-to-sf</id>
    <content type="html"><![CDATA[<p>As of today, I am no longer an employee of Opera.</p>

<p>It has been a great ride. Being a web opener and doing things I did at Opera was one of the goals I set out to accomplish 6 years ago. It is time for a new challenge, and a new beginning.</p>

<p>I will be moving to San Fransisco, to work for <a href="http://blogs.adobe.com/webplatform/">Adobe&#8217;s Webplatform team</a>, creating things to showcase Adobe&#8217;s Web Standard proposals and more. This will hopefully mean less of me telling you what to do, and more of putting my money where my mouth is!</p>

<p>It is almost a cliché to thank your ex-employers, but Opera has been the most fun workplace, so far. My boss <a href="https://twitter.com/andreasbovens">Andreas Bovens</a> has been most supporting, pragmatic and fun person to work with (yes yes, <a href="https://twitter.com/oDevRel">Devrel team</a> you all too!). The DevRel team has distinguished musicians among them too, bringing you lovely catchy numbers like the <a href="http://www.youtube.com/watch?v=SFvYhEhFsdQ">Web Standards Hoedown</a>, <a href="http://www.youtube.com/watch?v=5b7dNNapMCM">CSS3 Song</a> and <a href="http://www.youtube.com/watch?v=7gNmFabAOGc">more</a>!</p>

<p>It would be remiss of me to not highlight all the brilliant people at Opera who have been of great help: <a href="http://twitter.com/hzr">David Håsäther</a>, <a href="http://twitter.com/__chris__">Christian Krebs</a>, <a href="http://twitter.com/foolip">Philip Jägenstedt</a>, <a href="http://twitter.com/annevk">Anne van Kesteren</a>, <a href="http://twitter.com/zcorpan">Simon Pieters</a>, <a href="https://plus.google.com/101664973349222017745/posts">James Graham</a>, <a href="http://twitter.com/gsnedders">Geoffrey Snedders</a>, <a href="http://twitter.com/lachy">Lachlan Hunt</a> (who made this <a href="http://www.youtube.com/watch?v=qmJKhois7E8">awesome video</a> that needs to be inflicted on everyone), <a href="http://twitter.com/richtibett">Rich Tibett</a>, <a href="http://twitter.com/p01">Mathieu Henri</a>, <a href="http://twitter.com/erikjmoller">Erik Möller</a>, and the amazing Open Web QA team: <a href="http://twitter.com/hallvord">Hallvord R. M. Steen</a>, <a href="http://www.kleiven.org/ola/">Ola</a>.</p>

<p>I can&#8217;t wait to start work with my new team at Adobe (headed by <a href="http://twitter.com/vincent_hardy">Vincent Hardy</a>). I suppose moving to SF is like moving to Mordor in some ways, but if you have any tips and suggestions on living in SF, please do tell!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Fake Bolding of Web Fonts]]></title>
    <link href="http://nimbupani.github.com/fake-bolding-of-web-fonts.html"/>
    <updated>2012-03-02T11:26:00+05:30</updated>
    <id>http://nimbupani.github.com/fake-bolding-of-web-fonts</id>
    <content type="html"><![CDATA[<p>If you are like me, you would have been (ab)using <a href="">Google Web Fonts</a> for your custom font needs. In which case, you most certainly would have tripped on this problem: Faux Font bolding.</p>

<p>Most browsers synthesize the bold weights of fonts that do not posses a bold weight. For example, the font &#8216;Helvetica Neue Light&#8217; does not have a bold version available. If you use <code>font-weight: bold</code> with that font, browsers will artificially create a bold weight and <a href="http://jsfiddle.net/nimbu/jaRYQ/">render it like this</a></p>

<p><img src="http://cache.gyazo.com/c0ed78dbdef07d27ce6bdf3319507f1c.png" alt="Rendering of fake bold on helvetica neue light" /></p>

<h2>The Problem</h2>

<p>Now, this problem is exarcerbated when used with web fonts, especially the free open source fonts that are served from a service. Google Web Fonts, for example, <a href="http://www.google.com/webfonts#QuickUsePlace:quickUse/Family:Erica+One">serves slab fonts</a> like so:</p>

<pre>@font-face {
  font-family: 'Erica One';
  font-style: normal;
  <b>font-weight: normal;</b>
  src: local('Erica One'), local('EricaOne-Regular'), url(&lt;font url>) format('woff');
}</pre>


<p>What this code declares to a browser is: &#8220;Hey, this is the <strong>least weight available</strong> for this font called Erica One. So, if anyone wants a heavier weight, you need to synthesize it just like you would do it to local fonts.&#8221;</p>

<p>Now, the problem occurs if you only want to use this font for your headings. By default, browsers apply <code>font-weight: bold</code> to all headings. But the browsers need to obey the <code>font-weight</code> descriptor that is used in the <code>@font-face</code> rule above! This means, they will try to fake the bold weight of the already-heavy weight Erica One. Alas, the method used for synthetically generating the bold weight is not specced, so each browser does its own magic! Here is the normal weight of a typical slab web font(Google Web Font Ultra) overlaid on top of the synthetic bold generated out of it (<a href="http://jsfiddle.net/nimbu/wcBmD/">here is the code used to generate this graphic</a>):</p>

<p><img src="http://cache.gyazo.com/9bddfbf3f0fd2ead41c22c593239b051.png" alt="Image of the synthetic font" /></p>

<h2>How to solve this?</h2>

<p>There are two ways to resolve this:</p>

<h3>If you are in control of the @font-face rule</h3>

<p>Then the trivial solution is to add a <code>font-weight: bold</code> declaration which tells the browser &#8220;This font is a heavy slab font intended only to be rendered as a bold. Dont create synthetic bold versions for this&#8221;. This would <a href="http://jsfiddle.net/nimbu/Kxk5s/">work universally across any selectors irrespective of what the <code>font-weight</code> value is for them</a>. <strong>This is the recommended solution</strong>.</p>

<p>Unfortunately, this won&#8217;t quite work if you are using one of the recommended options of Google Web Fonts, as you have no control over the <code>font-weight</code> descriptor in the <code>@font-face</code> rule that Google outputs. So we now move to Option 2.</p>

<h3>Set font-weight: normal to all selectors using the slab font</h3>

<p>This is the trivial solution if you are using font services whose <code>@font-face</code> rule you do not have control over. The way I would do this, in Sass is to define it in this manner:</p>

<pre>.slab-serif {
  font-family: 'Ultra', serif;
  font-weight: normal;
} 

h1 {
  @extend .slab-serif;
}</pre>


<p>If you are using just CSS, then ensure everytime you set the <code>font-family</code> to be that slab web font you use a font-weight: normal declaration. Aha, this is actually what Google Fonts recommend in the sneaky little box to the right.</p>

<p>In any case, if you can avoid exposing your users to horrific fake bolding, you should. And that is the point of this post: to remind myself to never ever have browsers fake the weights of web fonts.</p>

<p>Note: <a href="http://css-tricks.com/watch-your-font-weight/">Here is Chris Coyier&#8217;s take on it</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Html5please API]]></title>
    <link href="http://nimbupani.github.com/html5please-api.html"/>
    <updated>2012-02-26T17:24:00+05:30</updated>
    <id>http://nimbupani.github.com/html5please-api</id>
    <content type="html"><![CDATA[<p><a href="http://api.html5please.com"><img src="http://cache.gyazo.com/88b8a0680005a6f09584510034f2b847.png" alt="" /></a></p>

<p>Some time ago, I noticed that many <a href="http://static.echonest.com/MidemMusicMachine/index.html">webGL demos</a> had a nice browser prompt:</p>

<p><img src="http://cache.gyazo.com/57a9e37c0c425c458978f0ce335bd18f.png" alt="" /></p>

<p>If your browser did not support webGL, you got a little link to <a href="http://get.webgl.org">get.webgl.org</a> which uses UA detection to tell you what browser to view webGL with. If there was a newer version of your browser that supported webGL, then it would link to that browser. If not, it would link to all the other browsers that support webGL:</p>

<p><img src="http://cache.gyazo.com/f0a80983ca4e1a8e1cebb72a66077b33.png" alt="getWebGL messaging" /></p>

<p>Instead of forcing people to choose a browser arbitrarily due to a developer&#8217;s whims and fancies, it provides you with an optimal recommendation based on your (viewer&#8217;s) defaults.</p>

<p>I wanted to see if we could do so with all the other HTML5 features. This way, there would be less of &#8220;download webkit browsers now&#8221; and more smart browser recommendations based on actual feature support.</p>

<p>You also won&#8217;t have to see antiquated messaging like &#8220;Download Opera 9.5&#8221; or &#8220;Download Chrome 8&#8221;, but get an up-to-date browser support information depending on the features that are requested:</p>

<p><img src="http://cache.gyazo.com/f49245b9418ab7069cf754436b079ea3.png" alt="Screenshot of browser support message" /></p>

<p>If a newer version of your browser supports the required features, it would ask you to view the page in that browser and not in random other browsers:</p>

<p><img src="http://cache.gyazo.com/45d07becc1f74d9c9544a120821652cd.png" alt="Screenshow of newer browser message" /></p>

<p>I broached the idea <a href="https://github.com/paulirish/lazyweb-requests/issues/39">here</a> and then less than a month ago, <a href="http://twitter.com/jon_neal">Jonathan Neal</a> produced a full working implementation of how such a service would look like. I worked with Jon, <a href="http://twitter.com/fyrd">Alexis Deveria</a>, <a href="http://twitter.com/paul_irish">Paul Irish</a>, <a href="http://twitter.com/drublic">Hans Christian Reinl</a>, <a href="http://twitter.com/aaronlayton">Aaron Layton</a> and <a href="https://github.com/h5bp/html5please-api/contributors">many more</a> to create what is now <a href="http://api.html5please.com">HTML5Please API</a>.</p>

<p>In brief, this service looks up the data used to render <a href="http://caniuse.com">When can I use</a> tables and match it to the user&#8217;s UA. Depending on the match, and the required features, it would either tell the user that they have a browser that is missing critical features required on the page or it would get out of the way and not render anything.</p>

<p>Here is how it looks like on a browser that supports all the required features:
<img src="http://h5bp.github.com/html5please-api/site/with-support.png" alt="A page on a browser supporting Drag and Drop" /></p>

<p>Here is how it looks like when a browser does not:
<img src="http://h5bp.github.com/html5please-api/site/without-support.png" alt="A page on a browser that does not support Drag and Drop" /></p>

<p>Even if the service fails to return anything (say network failure), there is no terrible disruption, the user can use the site as it is.</p>

<p>Ideally, you would want to provide all critical actions on the user&#8217;s browser based on what is available. If you absolutely must need certain features to enhance the experience, you can use this service to let the user know which browsers would offer that.</p>

<p><a href="http://twitter.com/simurai">Simurai</a> has some creative uses of this service in his projects <a href="http://lab.simurai.com/carveme/">Carveme</a> and <a href="http://lab.simurai.com/flashlight/">Flash Light</a>. What more, this API has even been <a href="https://github.com/gf3/protobot/blob/master/protobot.js#L447">integrated into an IRC bot</a>!</p>

<p>The <a href="https://github.com/h5bp/html5please-api/wiki/">Wiki pages</a> have much more in-depth information on all the possible options you can use with this API.</p>

<p>Let us know your suggestions and bug reports on the <a href="http://github.com/h5bp/html5please-api/issues/">Github Issue Tracker</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[html5please]]></title>
    <link href="http://nimbupani.github.com/html5please.html"/>
    <updated>2012-01-22T17:11:00+05:30</updated>
    <id>http://nimbupani.github.com/html5please</id>
    <content type="html"><![CDATA[<p><a href="http://html5please.us"><img src="http://cache.gyazo.com/c5d6f648394681c59d93c487b8347cf5.png" alt="" /></a></p>

<p>More than a year ago, in my very first talk at Web Directions on <a href="http://www.slideshare.net/nimbupani/active-web-development">Active Web Development</a>, I had this slide:</p>

<p><img src="http://cache.gyazo.com/64c191910d79e1ec04e253caa7a74482.png" alt="" /></p>

<p>The intention was that within organizations web developers would work to keep an updated list of html5 features that they would adopt or not. However, <a href="http://paulirish.com">Paul Irish</a> and I thought it would be useful if there were a global set of recommendations that web developers could consult and tap on when they are deciding on how to use features. This was the seed for the creation of <a href="http://html5please.us">HTML5 Please</a>.</p>

<p><a href="http://caniuse.com">When can I use</a> and <a href="http://modernizr.com">Modernizr</a> do a great job in informing the users of available features and how to feature detect them. The <a href="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills">Modernizr polyfill wikipage</a> also does a good job of listing all the available polyfills. What we felt missing was the glue that bound all this information together, to tell the user what the best tool for the job was: either on its own, or with a polyfill or a sensible fallback.</p>

<p>With HTML5 Please, you can just search for a feature that you are looking to use and find out how to do so. If you think our recommendation is incorrect, you can edit the recommendation for each feature and send a pull request (like this <a href="https://github.com/h5bp/html5please/blob/master/posts/border-image.md">example</a>).</p>

<h3>The Setup</h3>

<p>Initially, this data was in a JSON file that was manipulated in node to generate the static html. Soon, it became obvious that JSON would be a big pile of mess when many people <em>manually</em> update it.  Also, it was clear we needed a build system, which is where <a href="http://twitter.com/tbranyen">Tim Branyen</a> stepped in to help creating one using node and backbone that would combine markdown posts into a single HTML page.</p>

<p>It was also obvious that we needed a good system to create these markdown posts so that each of the tags that are used in the &#8216;Explore features&#8217; section are not created accidentally (e.g. prevent creating a tag called <code>polyfill</code> instead of <code>polyfills</code>). To do this, <a href="http://twitter.com/vyom">Deepak Jois</a> created a simple shell script that accepts a feature name, its associated tags, its kind, and then creates a markdown file with these details and opens it in your editor.</p>

<p>We also wanted a way for users to help us make the content better. I added a link to the markdown source on github for each feature which the reader only needs to fork, edit and send pull request for (all over in two clicks!).</p>

<h3>The Front End</h3>

<p>I was unsure of how to proceed with the design. This is how it appeared in the beginning:</p>

<p><img src="http://cache.gyazo.com/4e9fa43b13017085aa1647e1955a36d6.png" alt="" /></p>

<p>Over the last month, I tweaked the design majorly to more or less match what you see today. I also wanted to use Sass more, which is why the source stylesheet is all Sass.</p>

<p>It was awesome to work with Paul, Tim, Deepak, <a href="http://twitter.com/connor">Connor</a>, <a href="http://twitter.com/brianblakely">Brian Blakely</a>, <a href="http://twitter.com/addyosmani">Addy Osmani</a> &amp; <a href="https://github.com/h5bp/html5please/contributors">many more</a> to create this site. Please <a href="https://github.com/h5bp/html5please/issues/">let us know on Github</a> if you find issues or if you have ideas on how it could be better!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[desirable]]></title>
    <link href="http://nimbupani.github.com/desirable.html"/>
    <updated>2012-01-21T07:22:00+05:30</updated>
    <id>http://nimbupani.github.com/desirable</id>
    <content type="html"><![CDATA[<p>I never gave a thought to products I considered desirable, till I saw this ad for OP-1:</p>

<p><img height="400" alt="Image of an attractive woman holding the synth" src=http://dzzyntg3zfjcg.cloudfront.net/client/teenageengineering/dynamic/articles/op1-1_3225.jpg></p>

<p>Here is my list of products I consider desirable:</p>

<ul>
<li>Apple products</li>
<li>Eames designed products</li>
<li><a href="http://www.teenageengineering.com/">Teenage Engineering</a>&#8217;s products</li>
<li>Kindle</li>
<li>Dieter Rams&#8217;s designed products</li>
<li><a href="http://www.areaware.com/proddetail.asp?prod=sskmr&amp;CatID=155">Singgih Kartono&#8217;s radios</a></li>
<li>Volkswogen Beetle/Camper</li>
<li>Pixar movies</li>
</ul>


<p>A pattern I have noticed with them is how little advertising these products have. I would even venture to say desirability is built into their products.</p>

<p>When a product is built with it, there is no need to make it <em>appear</em> desirable. Most products don&#8217;t, which is why advertisers think adding people/situations on the screen would some how make prospective customers think the product is desirable. Notice how cereal advertisements have a happy-clappy family eating breakfast together?</p>

<p>Such gimmicks trick customers into buying into an illusion rather than just the product. By using the illusion of attraction, success or happiness the advertisement assures you that you will experience the same when you use it. Usually this works, but when the product is desirable to begin with, this trick stands out – like in the ad above.</p>

<p>Desirable products sell, but designing something so has never been a primary concern for most manufacturers - who look to bolt it on either in the packaging, exterior look, or worse, in advertising. A good side-effect of desirable products is how little effort is required to sell them.</p>

<p>I only hope we can build more such products instead of trying to trick customers into buying sub-par ones.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[mustache, hogan, handlebars]]></title>
    <link href="http://nimbupani.github.com/mustache.html"/>
    <updated>2012-01-01T10:05:00+05:30</updated>
    <id>http://nimbupani.github.com/mustache</id>
    <content type="html"><![CDATA[<p>I have been working quite a bit with <a href="http://nodejs.org">node</a> and have had a chance to use <a href="http://handlebarsjs.com">Handlebars</a> quite frequently. While it is an implementation of <a href="http://mustache.github.com">Mustache</a>, it goes a bit further in providing some helpers like <code>if</code>/<code>each</code>/<code>list</code>/<code>with</code> etc along with the ability to register custom helpers you need. Since then, I have heard about <a href="http://twitter.github.com/hogan.js/">Hogan</a> which is almost equivalent but not. I wanted to just write down what I have discovered while investigating these.</p>

<h3>Mustache</h3>

<p>Mustache is a logic-less templating language that has found implementation in various languages, including Ruby, Python, PHP, C++ and JavaScript. The Official JavaScript implementation is called <a href="https://github.com/janl/mustache.js">mustache.js</a>.</p>

<p>Mustache.js does not compile the templates ahead of time. As a result it is significantly slower than the other two implementations of Mustache. Mustache also <a href="http://jsbin.com/afasot/7/">strips white spaces from your template</a> (thnx <a href="https://twitter.com/jdalton">@jdalton</a> - note the github urls for these libs seem to 404 occassionally).</p>

<h3>Handlebars</h3>

<p>Handlebars.js provides an implementation of Mustache with some extra features.</p>

<p>The biggest feature is that the templates are compiled before use. This means, the template is not parsed right when the template needs to be applied, but rather parsed as <code>Handlebars.compile(&lt;template source&gt;)</code> first and data is then passed to this compiled template for rendering. This speeds up the <a href="http://jsperf.com/t-bench2/7">rendering of data significantly compared to Mustache</a>.</p>

<p>Handlebars.js, contrary to Mustache&#8217;s philosophy of being logic-less, also provides some basic extensions to make it easy to manipulate the data that is used on the templates. You can also register helpers that can do more manipulations of data like so:</p>

<pre><code>Handlebars.registerHelper('hyphenate', function(tag) {
  return tag.split(' ').join('-');
});
</code></pre>

<p>So, if you want one of the input data objects to render differently, you don&#8217;t have to add a new object representing the new rendering (or manipulate the rendered output afterwards). You can simply work with the helper to change based on the input.</p>

<h3>Hogan</h3>

<p>Hogan.js is a library that is a straightforward implementation of mustache. Like Handlebars, Hogan is also compiled ahead of data being sent to render which makes it faster than Mustache. But unlike Handlebars, Hogan does not provide any extra features.</p>

<p>Hogan.js seems to have better performance on <strong>most</strong> browsers. Hogan is a great alternative to Mustache.js for minimalists who simply want a template to use and nothing more.</p>

<h3>What about others?</h3>

<p>I was most taken in by Mustache, which is why I did this research to see what are the best Mustache implementations out there. But there are certainly other JavaScript template options available (including one provided by <a href="http://documentcloud.github.com/underscore/">underscore</a>).</p>

<p><a href="http://tbranyen.com/">Tim Branyen</a> is working on <a href="http://combyne.github.com/">Combyne</a> which is similar to Mustache but provides additional features that are similar to those found in <a href="http://liquidmarkup.org/">Liquid</a>.</p>

<p><a href="https://github.com/adammark/">Adam Mark</a> has <a href="https://github.com/adammark/Markup.js">Markup.js</a> out, which is similar to mustache in some ways, but works on non-IE browsers. In addition it provides <a href="https://github.com/adammark/Markup.js/tree/master/src/pipes">piping out of the box</a> and has a low footprint (1.8K). However, I do not like the syntax for piping argument (<code>&gt;</code>), nor the ambiguous list piping. It doesn&#8217;t precompile templates either, but seems to have some ideas on working with language strings. Definitely worth a look.</p>

<h3>What do I use?</h3>

<p>I use Handlebars. Mainly, the performance boost of Hogan does not seem that significant for me given the opportunities of using helpers for simple data manipulation. My typical use cases seem to always have some client-side data manipulation that hogan does not provide for.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Twittering with D3]]></title>
    <link href="http://nimbupani.github.com/twittering-with-d3.html"/>
    <updated>2011-12-23T20:08:00+05:30</updated>
    <id>http://nimbupani.github.com/twittering-with-d3</id>
    <content type="html"><![CDATA[<p>What you see above is something I had been thinking of doing since the obsession of a redesign hit my head: rendering visual snippets of my latest tracked actions as pretty and useless graphics. Hopefully this is the first of many.</p>

<p>My very first data mapping project was my <a href="http://j.mp/divyaieee">Final Year Project</a> where I had to render XML data from the server on to a J2ME application. I have since not wanted to recreate that horrific experience again and have stayed well out of the way of such complicated mappings. But, last year, I wrote a bit on using <a href="http://www.netmagazine.com/tutorials/build-tweet-map-svg">Polymaps for mapping tweets</a> and discovered that <a href="http://bost.ocks.org/mike/">Mike Bostock</a> has since created a new library for data visualization called <a href="http://mbostock.github.com/d3/">D3</a>. I finally got a chance to play with it.</p>

<h3>Idea</h3>

<p>The bar chart shows a timeline of the last 10 tweets starting with the earliest tweet. Each bar represents a tweet and grows darker across the timeline based on how many retweets occur. The darkest bar represents a tweet that was retweeted the most. Clicking on each bar gives you the tweet itself and the actual number of retweets that has occurred.</p>

<p>I originally started with the idea of only plotting tweets created over the last 24 hours and the ebb and flow of each of their retweets. But, then, it became harder to visualize how I would treat retweets that occurred beyond a day. It seemed simpler to just switch over to plotting the graph for the latest few tweets.</p>

<h3>Design</h3>

<p>I had in my mind a graded bar chart that would animate across time and change in color values based on when and how many retweets occurred. I wanted to include axes in the design, but they looked very noisy when I got around to doing them, so they were <em>axed</em> :)</p>

<h3>Implementation</h3>

<p>This project was primarily a vehicle to learn <a href="http://mbostock.github.com/d3/">D3</a> and <a href="http://nodejs.org/">node.js</a> and I must say I did learn quite a bit of both while using them. Not having much of a data visualization background, understanding <code>scale</code>, <code>transition</code>, and <code>data</code> took a while, but it became more intuitive as I grasped how these worked.</p>

<p>The binding of <code>data</code> to each SVG/DOM object using <code>selectAll('&lt;node&gt;').data()</code> is really awesome. It makes it easy to add/remove nodes depending on the data that you are dealing with, though, it does require you to think carefully about your data object (I spent many sleepless hours on this). D3&#8217;s handy <a href="https://github.com/mbostock/d3/wiki/Transitions#wiki-d3_interpolate">interpolators</a> are useful for interpolating between arbitrary set of values. The variety of <a href="https://github.com/mbostock/d3/wiki/Scales">mappings of domains to ranges</a> that is available is also impressive.</p>

<p>I used <a href="https://github.com/AvianFlu/ntwitter">nTwitter</a> to make requests to the Twitter REST API and write the results to a JSON file. Node’s async callbacks threw me in a loop but <a href="http://deepak.jois.name">Deepak</a> used <a href="https://github.com/caolan/async">Async</a> to make it all seamless (while also helping me out with a major rework of the code).</p>

<p><a href="http://momentjs.com/">moment.js</a> was quite handy both server-side and client-side to parse and compare dates for tweets and retweets.</p>

<h3>Play!</h3>

<p>The code is in the <a href="https://github.com/nimbupani/viz">Viz</a> folder to which I should be adding more such pointless data art. Please do suggest improvements or feel free to use this in your own obsessive experiments :)</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Swatch’s Now is Android’s Future?]]></title>
    <link href="http://nimbupani.github.com/swatchs-now-is-androids-future.html"/>
    <updated>2011-12-11T07:04:00+05:30</updated>
    <id>http://nimbupani.github.com/swatchs-now-is-androids-future</id>
    <content type="html"><![CDATA[<p>This weekend, I chanced upon this article on the <a href="http://www.nytimes.com/2011/12/10/business/swatch-group-to-trim-sales-of-watch-parts-to-rivals.html">woes of Swatch’s rivals in the New York Times</a>. It is an interesting read throughout.</p>

<p>What is interesting is Swatch provides most of the mechanical movements for its rivals and is now cutting back and possibly end supplying them. Here are some interesting quotes from the article:</p>

<blockquote><p>Mr. Stas acknowledged that it would have been nearly impossible for him to start out in watchmaking 23 years ago without access to Swatch’s production platform.</p>

<p>Swatch’s revenue last year of 6.44 billion Swiss francs, or about $6.95 billion, makes it by far the world’s largest watchmaker. The company insists that its goal is not to strangle competitors. And it argues that its withdrawal will require rivals to raise their spending on manufacturing, thereby strengthening the quality and competitiveness of the Swiss watch sector as a whole.</p>

<p>Thanks to Swatch, “there is no other industry with such cheap entry costs,” said Jean-Claude Biver, who spent 12 years on Swatch’s executive committee before becoming chairman of Hublot, which is now part of LVMH Moët Hennessy Louis Vuitton, the world’s largest luxury goods company and one of Swatch’s main rivals.</p></blockquote>

<p>As I was reading the article, it became really hard for me not to draw the comparison to Android, and the <a href="http://www.engadget.com/2011/08/15/editorial-engadget-on-googles-motorola-mobility-acquisition/">subsequent acquisition of Motorola Mobility by Google</a>. The CEO of Swatch mentions:</p>

<blockquote><p>“In no other industry do you have one company supply all the critical parts to the people who then compete directly with it,” Nick Hayek, Swatch’s chief executive, said in an interview this year.</p></blockquote>

<p>Clearly he has not heard of Android.</p>

<p>I am not suggesting Google will do this, just that there are very obvious incentives to do so. What I would like to know is how mobile manufacturers are hedging their risks. As one ex-Swatch executive said:</p>

<blockquote><p>“This whole battle is the result of people completely underestimating the risk that at some stage Swatch could cut off rivals, which is a legitimate decision to make in a free market,”</p></blockquote>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Redesign Notes]]></title>
    <link href="http://nimbupani.github.com/redesign-notes.html"/>
    <updated>2011-12-11T04:51:00+05:30</updated>
    <id>http://nimbupani.github.com/redesign-notes</id>
    <content type="html"><![CDATA[<p>This site sports a refresh. Here is a list of what is different now:</p>

<ul>
<li>Runs on <a href="http://octopress.org">Octopress</a>.</li>
<li>Hosted on <a href="http://github.com">Github</a>.</li>
<li>Anyone can submit updates for any post with a pull request.</li>
<li><a href="http://disqus.com">Disqus</a> comments (with threading!)</li>
<li>No more categories except <a href="http://nimbupani.github.com/categories/web-development">Web Development</a>.</li>
<li>Based on <a href="http://h5bp.com">HTML5Boilerplate</a> (obviously).</li>
<li>Keyboard navigation! Press left/right arrow for previous/next page.</li>
</ul>


<h3>Why</h3>

<p>I have been wanting to move to a static site for several months because there were several things that annoyed me about Drupal (or any other CMS systems):</p>

<ul>
<li>Lack of out of the box version control.</li>
<li>Unnecessary security nightmare with MySQL.</li>
<li>Loading of needless large resources just because the admin interfaces require it (<code>drupal.js</code> &amp; <code>drupal.css</code> I am looking at you).</li>
<li>No way to collaborate or have others edit my mistakes (other than in comments).</li>
<li>Dependence on several modules which go out of date when a new version comes along.</li>
<li>Ceaseless updating of modules and versions.</li>
<li>PHP (white screen of death anyone)!?!</li>
<li>Poor spam filtering.</li>
<li>Painful backup of database and none for the layout and design.</li>
<li><code>.htaccess</code> drama</li>
</ul>


<p>It was not until <a href="http://thecssninja.com">Ryan Seddon</a> pointed me to the documentation on <a href="https://github.com/mojombo/jekyll/wiki/blog-migrations">migrating from Drupal</a> that this even became feasible. Sadly, the script does not generate categories for the exported markdown files. Fortunately, I used this opportunity to disband the idea of categories all-together and just manually edit whichever post fitted best into <a href="http://nimbupani.github.com/categories/web-development/">Web Development</a> as that typically has been what most visitors look for.</p>

<p>Later, <a href="http://rmurphey.com">Rebecca Murphey</a> moved her site to Octopress which seemed to be a nice wrapper around Jekyll and the migration seemed much less work than before. The most tedious process in migrating content from 2003 onwards was the export of the blog posts from Drupal, and making the Disqus comments work.</p>

<h3>Disqus</h3>

<p>Disqus offers a path for Wordpress users though, but for Drupal you would need to provide an XML file to import from. The good news is the new <a href="http://drupal.org/node/1349010#comment-5275640">Disqus module does that exactly</a> (you need to look under <code>Admin/Content Management/Comments</code> to find the export function). You can use any Disqus identifier, but the easiest method seems to be to use the unique url of each post.</p>

<p>The bad news is that unique url that Disqus module uses is the original Drupal path (e.g. <code>node/1</code>) which is useful if you are sticking with Drupal, but useless if you are using another system. Luckily for me, it also includes the path alias of the original post in <code>disqus_url</code> field for each comment, so it would simply be a matter of finding value of <code>disqus_url</code> in each comment, and replace the value of Disqus identifier with it – which is easy to do by executing a regular expression search and replace on the XML file.</p>

<h3>Github Setup</h3>

<p>Source files used to generate the site are stored in a branch called <a href="https://github.com/nimbupani/nimbupani.github.com/blob/source/">source</a> and the generated files are required to be on the master branch. Octopress provides a <a href="http://octopress.org/docs/deploying/github/">rake interface for you to setup your github pages</a> as you wish.</p>

<p>You also need a CNAME record that has the domain name that will point to Github. If it is a top level domain, you need to also set up an A Record on your DNS, otherwise creating a CNAME record on your DNS should be sufficient.</p>

<p>The most annoying thing is I cannot set the default branch for Pull Requests alone on Github (as they need to be made on the source branch), so for now you would have to change the branch of the remote to source manually for the pull request to go through.</p>

<h3>Jekyll</h3>

<p>If you are using Octopress, you most likely needn’t worry about fiddling with Jekyll other than setting variables in <code>_config.yaml</code> file. Any variables you declare there are available for you site-wide for use in your Jekyll templates. So, it was easy to <a href="https://github.com/nimbupani/nimbupani.github.com/blob/source/_config.yml#L45">set a github url</a> to create the &#8216;submit pull request&#8217; url you see below each post.</p>

<p>Jekyll does not, by default, paginate the archives. But the same code used to render pagination on the default home page <a href="https://github.com/nimbupani/nimbupani.github.com/blob/source/source/archives/index.html">can be used to do so</a>. The Category archives page is rendered by an Octopress Jekyll plugin and is not paginated (I am sure it is possible, but slightly more tedious).</p>

<p>Jekyll provides an XML feed at <code>atom.xml</code> and Octopress helpfully provides an XML feed with the categories plugin for your category listing. Octopress also makes it easy for you to set your feed urls to Feedburner. Just remember to point your Feedburner urls to these atom feeds!</p>

<h3>Liquid</h3>

<p><a href="https://github.com/Shopify/liquid">Liquid</a> is the templating engine used by Jekyll. It looks pleasing and has a small set of manipulations you can do with it out of the box. I really like the simple filters that let you <a href="https://github.com/Shopify/liquid/wiki/Liquid-for-Designers">manipulate values by simply piping them through filters</a> (there is a <a href="http://cheat.markdunkley.com/">lovely cheat sheet</a> too). There is no way you can get the filename of the markdown file used to create a post within Jekyll, so I had to recreate it using Liquid filters: <code>"-"</code>.</p>

<p>It is not quite as clean as I thought it would be, to render the latest post on the homepage while reusing the same post template. Basically, each post renders in a page and hence the data is available as <code>page.url</code> or <code>page.date</code>. However, home page is itself a page which renders a list of posts (in this case just one), hence I had to set a variable <code>post</code> and make that point to the latest one (<code>site.posts.latest</code>). This meant, any of the variables need to be rendered irrespective of whether they are <code>post.url</code> or <code>page.url</code>, which meant <a href="https://github.com/nimbupani/nimbupani.github.com/blob/source/source/_includes/post_detail.html">several <code>if/else</code> statements</a>. I think this is better than replicating the same template twice, and having one go out of sync with the other.</p>

<h3>Design</h3>

<p>Octopress offers a base layout/design which I found too complicated to work with. I ended up replacing most of the Sass files (have not indulged my whim on the architecture of the layout templates). I have an <a href="https://github.com/nimbupani/nimbupani.github.com/blob/source/sass/base/_extends.scss"><code>_extends.scss</code></a> to store all <a href="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#extend">my extend rules</a>, and a <a href="https://github.com/nimbupani/nimbupani.github.com/blob/source/sass/base/_vars.scss"><code>_vars.scss</code></a> to store variables. I had to override a few disqus styles, so they went into their own scss file (with dirty <code>!important</code> at the end of each declaration!)</p>

<p>I was happy with the architecture of the older design, which is why nothing has changed significantly. I did want the previous/next links to be located at a fixed location and provide very basic navigation on top.</p>

<h3>Performance</h3>

<p>Lack of PHP and MySQL has made this page render in about 1s compared to 2.6s previously. I also don&#8217;t have frivolous resources loading which makes it better.</p>

<h3>Complaints</h3>

<p>I am overall very satisfied with Octopress, and am so glad <a href="http://imathis.com">Brandon Mathis</a> created it. Only niggling complaint I have is that the rake deployment script takes <em>years</em> to run. You could use <code>rake isolate[filename]</code> and subsequent <code>rake integrate</code> to make this faster. But I wish it were the case automatically.</p>

<p>Creating a new post is easy, but finding it in the 100s of posts I have to write it is a pain. I suspect I could add a <code>mate &lt;filename&gt;</code> to the <code>rake new_post</code> script which would make that easier.</p>

<h3>Future</h3>

<p>This site is a work in progress. I have some outstanding <a href="https://github.com/nimbupani/nimbupani.github.com/issues/1">to-dos</a> that I hope to get to soon. I do want to use this site to experiment with learning new languages/technologies, so anything you think would be an interesting idea to pursue, please <a href="https://github.com/nimbupani/nimbupani.github.com/issues/new">suggest</a>!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Summary of various exciting CSS drafts and proposals]]></title>
    <link href="http://nimbupani.github.com/summary-of-various-exciting-css-drafts-and-proposals.html"/>
    <updated>2011-12-10T18:51:00+05:30</updated>
    <id>http://nimbupani.github.com/summary-of-various-exciting-css-drafts-and-proposals</id>
    <content type="html"><![CDATA[<p>I will be attending my first ever <a href="http://lists.w3.org/Archives/Public/www-style/2011Jun/0593.html">CSS</a> Working Group Face to Face Meeting starting this Sunday, and I wanted to be at least up-to-speed on all the drafts that will be up for discussion. So, in the interest of not letting a few hours spent understanding some of them go to waste, here is a brief summary of each of these drafts and some of the concerns that will be discussed during the meeting.</p>

<p>You could probably look out for updates on the meeting <a href="http://twitter.com/csswg">@csswg</a></p>

<h3><a href="http://dev.w3.org/csswg/css3-regions/">CSS Regions</a></h3>


<p>This spec, from my understanding, is a way to define how content flows like in Adobe InDesign or Illustrator. Basically you can extract the content from a set of elements by using the property <code>flow-into: &lt;nameoftheflow&gt;</code>. Then you can make that render on another set of elements (called  <em>regions</em>) which act as a containers for that content using <code>flow-from: &lt;nameoftheflow&gt;</code>. If the containers have content, it will be replaced by the content set using the  <code>flow-from</code> property. This is controlled by using what is called as <em>named flow</em>. You control which elements belong to a flow using the <code>flow-into</code> property on them.</p>

<pre><code>.contentthatflows { flow-into: newspaper-flow; }

.region1-1, .region1-2 { flow-from: newspaper-flow; }
</code></pre>

<p>The content rendered within <code>.region1-1</code> and <code>.region1-2</code> will render with styles originally defined on the elements which belong to the <code>newspaper-flow</code>.
Properties defined on <code>.region1-1</code> or <code>.region1-2</code> will not trickle down to the content that flows into them.</p>

<p>Sometimes, content can straddle two or more such regions within the same flow. You can overwrite styles to elements which fall into a particular region using a <a href="http://www.w3.org/TR/css3-regions/#region-styling">region-styling</a> block, similar in notation to media queries.</p>

<pre><code>@region .region1-1 { 
    p {
        color: red;
    }
}
</code></pre>

<p>This means that the text of all paragraphs which fall into the <code>.region1-1</code> region will be colored red. Paragraphs which fall outside this region will have their originally defined color.</p>

<p>There is also a skeletal interface to access which region an element is part of which might be fleshed out further in the Face-to-face meeting.</p>

<h3><a href="http://www.interoperabilitybridges.com/css3-floats/"> <span class="caps">CSS3</span> Floats </a></h3>


<p></p>

<p> Expands on floats to make float possible with positioning and wrap text content around the positioned element. However this conflates floats with positioning (if you want wrapping on elements, you need to set <code>float: positioned</code> and use <code>top</code> , <code>left</code> , <code>position</code> to control the location of the wrapped element) </p>


<p> <p> The properties for controlling the wrapping is similar to those in the <span class="caps">CSS</span> Exclusions proposal - <code>wrap-type</code> (vs <code>wrap-shape-mode</code> ), <code>wrap-shape</code> (same), <code>wrap-image</code> (vs <code>wrap-shape-image</code> ), <code>wrap-image-threshold</code> (vs <code>wrap-shape-image-threshold</code> ), <code>wrap-margin</code> (vs <code>wrap-shape-margin</code> ), <code>wrap-padding</code> (vs <code>wrap-shape-padding</code> ). It seems to me that these two proposals need to be merged or the scope of one of them changed significantly so there are no conflicts. From the <a href="http://wiki.csswg.org/ideas/css3-floats-use-cases">Wrap use cases</a> , personally I like the approach of <span class="caps">CSS</span> Exclusions which seems cleaner for all the use cases mentioned. </p></p>

<h3> <a href="http://dev.w3.org/csswg/css3-exclusions/"> <span class="caps">CSS3</span> Exclusions </a> </h3>


<p></p>

<p> This has been initially proposed by Adobe (along with <span class="caps">CSS3</span> Regions). The case for wrapping is separate from positioning or floats, and wrapping can occur on any box independent of where they are located or rendered. In addition you can also specify how each wrapping shape interacts with each other (depending on what you set for wrap-shape-order, you can set which wrapping shape will clip the other when they interact). </p>


<p> <p> I like this better than <span class="caps">CSS3</span> Floats because this is not related to how an element is positioned but merely impacts the wrapping. </p></p>

<p> Both <span class="caps">CSS3</span> Exclusions and <span class="caps">CSS3</span> Floats accept <a href="http://www.w3.org/TR/2010/WD-SVG11-20100622/shapes.html"> basic <span class="caps">SVG</span> shapes </a> as values for <code>wrap-image-shape</code> ( <code>wrap-image</code> ). Both specs have equivalent properties to the background property for the wrap image, which means you can have repeating image patterns that you can use for creating your wrap shape. </p>


<p> <p>Both specs also specify an interesting alpha channel threshold which can be used to determine the shape that needs to be generated from the wrap-image specified. </p> <h3> <a href="http://dev.w3.org/csswg/css3-flexbox/"> <span class="caps">CSS3</span> Flexbox </a> </h3> <p> This has been entirely re-written and is significantly different from current implementations. What it aims to do is to provide you with flexible layout of child elements and the space around them within a parent element that has a flexbox layout. You get started by specifying <code>display: flexbox</code> on the parent element and then specifying the order in which you want the child elements to be laid out (using flex-direction). All child elements (with display set to inline or anything) will follow this direction if nothing more is specified for each of them. You can also determine how the white-space that is left after following the order should be allocated (using flex-pack). </p></p>

<p>You can also specify the order in which the child elements should occur using flex-order. Each of these child elements can have widths or heights as a function called flex(), which takes in 3 values - the amount it can expand to, the amount it can contract to, the preferred length it should have. Browsers need to follow the free space allocation algorithm to make sure each of these element’s width/height match the values provided.</p>


<p> <p>This would be very useful for mobile apps where device diversity makes creating flexible but usable designs almost mandatory. Cant wait to see this implemented across all browsers!</p></p>

<h3> <a href="http://dev.w3.org/csswg/css3-grid-align/"> <span class="caps">CSS3</span> Grid Layout </a> </h3>


<p></p>

<p> This spec would allow authors to have complete control over placement of each element on the page in a grid. It introduces completely new properties to aligning elements and like flexbox layout you use a <code>display: grid</code> on the parent element to make all the child elements be part of a grid. So, you cannot have an element that can be both a flexbox or a grid at the same time (clearly makes no sense). Do note that only block elements can take part in a grid layout and be part of a grid. </p>


<p></p>

<p>The Grid layout lets you set complicated grids of elements. The flexbox merely allows you to set how flexible the element can be and where it can be placed within the parent element, but the grid layout lets you set which elements can be part of a grid cell (each grid is made up of grid cells, grid rows, and grid columns), and where within the grid cell should each element be placed (the layer order, and if they should span multiple grid cells), and how elements should be laid out when you do not specify which grid cells they belong to. </p>


<p> <p> The Grid layout can also be used in combination with <span class="caps">CSS</span> Regions such that grid cells that are selected to be part of a region can have text flowing through them (from another grid cell). Grid cells can be selected using ::grid-cell(‘cellname’) pseudo-element selector. </p></p>

<p> This spec is pretty well-defined, which is not surprising given <a href="http://msdn.microsoft.com/en-us/ie/hh272902#_CSSGrid"> we already have an implementation in <span class="caps">IE10</span> </a> . My only concern is the redefinition of the <code>fr</code> unit which has also been used to define a flex tuple in the CSS3 Flexbox spec which will discussed at the CSS Face-to-face. </p>


<p> <h3> <a href="http://dev.w3.org/csswg/css3-images/#gradients">Gradients</a> </h3> <p> While gradients are more or less determined, there is still a big discussion on how to render gradients with keywords (using <code>top left</code> , etc). Another concern with gradients has been the interpolation of colors (which currently results in ugly blackish interpolation such as this one on the left when you have one of the color stops as <code>transparent</code> ). </p></p>

<p> <img src="http://gyazo.com/9f995e0e98ba6c0dfbf71930dce4fb66.png"> <br> ( <a href="http://jsfiddle.net/nimbu/rK9Pd/">source</a> ) </p>


<p> <p> The meaning of premultiplied color spaces <a href="http://dev.w3.org/csswg/css3-images/#color-stop-syntax">has been clarified</a> (Opera already implements this - see the gradient on the right). </p></p>

<h3> <a href="http://dev.w3.org/csswg/cssom/"> <span class="caps">CSSOM</span> </a> </h3>


<p> <span class="caps">CSSOM</span> is the Document Object Model for <span class="caps">CSS</span> . It is an <span class="caps">API</span> thats allows you to access style rules, selectors, media queries, and the <span class="caps">CSS</span> used to render the styles on a page. This has previously not been specced which meant each browser could implement its own APIs for accessing stylesheets (and they did). Now, we have a comprehensive set of interfaces to access the styles from JavaScript. </p>


<p> <p> We already have parts of <span class="caps">CSSOM</span> implemented in various browsers (Opera 11.5+, <span class="caps">IE10</span> , Chrome, <span class="caps">FF5</span> ) though! </p> <p>Any questions you have that I can ask the Working Group about?</p></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[This revolution needs new revolutionaries]]></title>
    <link href="http://nimbupani.github.com/this-revolution-needs-new-revolutionaries.html"/>
    <updated>2011-05-21T00:00:00+05:30</updated>
    <id>http://nimbupani.github.com/this-revolution-needs-new-revolutionaries</id>
    <content type="html"><![CDATA[<p>In early 2000s, when the web was in its infancy, a great number of committed activists made Open Web Standards possible. They advocated, wrote the specifications, explained them to the masses, and contributed to the revolution of using W3C Specs on the web. I owe each of them my career as a Web Designer/developer.</p>




<p>Now, we are in the middle of another revolution. The web as we know it is changing significantly. The ways of doing, implementing and working with web pages have altered. Designing with the right semantic tags or using floats instead of tables are no longer the simple goals of a good web page. We need the pages to load quickly, use the faster newer CSS selectors and DOM APIs, and better ways to create animations, dynamic images, and dealing with how to design for a variety of devices that now have browsers. </p>




<p>The best way to be a part of the revolution is to BE the revolution, not talk ABOUT the revolution. A lot of recognized individuals seem to be doing the latter. To BE the revolution, you just need to look at what some of the people at the fore-front of it are doing: <a href="http://paulirish.com">Paul Irish</a> and <a href="http://farukat.es/">Faruk Ateş</a> have made the future accessible with <a href="http://modernizr.com">Modernizr</a>. <a href="http://peter.sh/">Peter Beverloo</a> created the <a href="http://peter.sh/category/last-week/">&#8220;Last Week in…&#8221;</a> series that has been re-adopted by <a href="http://www.w3.org/QA/archive/open_web/">W3C</a> and <a href="http://blog.whatwg.org/category/weekly-review">WHATWG</a> where you can keep up with the pace of creation and implementation of web specifications. <a href="http://www.scottjehl.com/">Scott Jehl</a> created <a href="https://github.com/scottjehl/Respond">Respond.js</a> which lets older browsers understand media queries, <a href="http://www.blog.highub.com/">Shi Chuan</a> made designing for multiple devices easy by exhaustive research for <a href="http://html5boilerplate.com/mobile/">HTML5 Mobile Boilerplate</a>. Jon Neal made practical use of HTML5 elements easy with <a href="http://www.iecss.com/print-protector/">IE Print Protector</a>. <a href="http://leaverou.me/">Lea Verou</a> has been <a href="http://leaverou.me/2010/07/organizing-a-university-course-on-modern-web-development/">teaching web development</a> and is the author of significant articles on web development. <a href="http://www.accessibleculture.org/">Jason Kiss</a> has been documenting how <a href="http://www.accessibleculture.org/research/html5-aria-2011/">HTML5 elements, ARIA work with different Screen readers</a> without much fanfare. <a href="http://nicolasgallagher.com/">Nicolas Gallagher</a>, <a href="http://www.thecssninja.com/">Ryan Seddon</a>, <a href="http://mathiasbynens.be/">Mathias Bynens</a> and several others have been doing similar practical investigations on how to use what’s new and awesome in real life scenarios.</p>


<p></p>

<p>But these are not the people who are known revolutionaries. Unfortunately, the people who seem to be recognized for pushing the envelope are people who talk ABOUT the change, those who split hairs on whether to call something &#8220;Responsive&#8221; or &#8220;Adaptive&#8221; or speak about HTML5/CSS3 but have very little code to show for their understanding of it. </p>




<p>Now is the time to get developers on board the new rush of web standards, not to promote litigation on the presence or absence of a single HTML attribute, or debate a merits of the name of a technique. What it does is to deflect attention from learning, instead directs developers to spend more time beating about the bush and not be fully engaged in what’s coming.</p>




<p>It is time to move on. I acknowledge all these past trail blazers, but they are not at the forefront today. Following their advocacy does not shed light on all the practical implementations that are possible while exploring new technology. People seem to know - but not use - the latest in web standards, and several are on the fence because they do not know how to work with new standards right now. </p>




<p>It is time for us to get new idols. Here is what my idols do:</p>




<h3>Create</h3>


<p>They code. They have demos on their website or on Github.</p>




<p>They write. They write tutorials that are not browser-specific, and link back to specifications, have comments and update their posts with newer/better ideas from within the comments section.</p>




<h3>Research</h3>


<p></p>

<p>They research and publish their findings. A lot of recommended practices are dogma and hearsay - creating practical examples to test such assertions and validate them would be cornerstone of their work.</p>




<p>They know what is new. Web standards keep changing. They should know what is new, what is relevant and what shouldn&#8217;t be promoted. They talk and respond to your queries and are not too busy to find time to write code that works.</p>




<h3>Collaborate</h3>


<p>They do not work in isolation, but get people together who can create projects that benefit the web.[Bonus!] They are available on mailing-lists, forums, or IRC channels to help n00bs when they can.</p>




<p>If you think it is hard to find these people, then you are not looking. All the people I mentioned earlier are people worthy of listening to. Look at who else they are talking to, or doing projects with, follow the trail. </p>




<p>The old revolution is dead, long live the revolution.</p>

]]></content>
  </entry>
  
</feed>