<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
<channel>
<title>Rico Sta Cruz.com</title>
<link>http://ricostacruz.com</link>
<description />
<dc:language>en</dc:language>
<dc:rights>Copyright 2010</dc:rights>
<pubDate>Wed, 26 Sep 2012 17:51:34 +0800</pubDate>
<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ricostacruz" /><feedburner:info uri="ricostacruz" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
<title>Philippine Graphic Design Awards 2011</title>
<link>http://feedproxy.google.com/~r/ricostacruz/~3/pVQxigdnSns/pgda.html</link>
<description>&lt;p&gt;&lt;img src="http://ricostacruz.com/images/pgda2011.png" alt="" /&gt;&lt;/p&gt;
&lt;div class='c1 info'&gt;
&lt;p&gt;&lt;strong&gt;I will be judging in the &lt;a href="http://pgdawards.com"&gt;&lt;span class="caps"&gt;PGDA&lt;/span&gt;.&lt;/a&gt;&lt;/strong&gt; Do send in your entries! There are 13 categories, open to students and professionals alike.&lt;/p&gt;
&lt;p&gt;You can submit entries until September 20. All the relevant details are available on their website.&lt;/p&gt;
&lt;p&gt;The &lt;span class="caps"&gt;PGDA&lt;/span&gt; has been around for a few years now. Check out the great work from &lt;a href="http://pgdawards.com/2010_Winners/"&gt;last year&amp;#8217;s winners.&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class='c1 right'&gt;
&lt;p class="link"&gt;&lt;a href="http://pgdawards.com"&gt;&lt;span class="caps"&gt;PGDA&lt;/span&gt; website&lt;/a&gt;&lt;/p&gt;
&lt;p class="link"&gt;&lt;a href="http://pgdawards.com/rules-for-entry.com"&gt;Contest details&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ricostacruz/~4/pVQxigdnSns" height="1" width="1"/&gt;</description>
<pubDate>Mon, 25 Jul 2011 00:00:00 +0000</pubDate>
<feedburner:origLink>http://ricostacruz.com/2011/pgda.html</feedburner:origLink></item>
<item>
<title>Killing orphans</title>
<link>http://feedproxy.google.com/~r/ricostacruz/~3/mVl8b6nrfcY/unorphan.html</link>
<description>&lt;div class='c1'&gt;
&lt;p&gt;&lt;strong&gt;Paragraphs with single words&lt;/strong&gt; in the end are ugly. Live by this rule in the web and print. These words are called &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/Widows_and_orphans"&gt;orphans&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve just put together a one-off JQuery plugin to fix the problem of text orphans. Check out &lt;a href="http://github.com/rstacruz/jquery.unorphan"&gt;jQuery Unorphan&lt;/a&gt; for a quick, elegant solution.&lt;/p&gt;
&lt;p class="brief"&gt;&lt;a href="http://github.com/rstacruz/jquery.unorphan"&gt;Unorphan for jQuery &amp;rarr;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/ricostacruz/~4/mVl8b6nrfcY" height="1" width="1"/&gt;</description>
<pubDate>Thu, 21 Jul 2011 00:00:00 +0000</pubDate>
<feedburner:origLink>http://ricostacruz.com/2011/unorphan.html</feedburner:origLink></item>
<item>
<title>HAML and IE compatibility</title>
<link>http://feedproxy.google.com/~r/ricostacruz/~3/7jG-tkB9bj8/haml_and_ie_compatibility.html</link>
<description>&lt;p class="brief c3"&gt;I love &lt;span class="caps"&gt;HAML&lt;/span&gt;, and I love the insanely-elegant &lt;a href="http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/"&gt;Paul Irish IE conditional comments trick&lt;/a&gt; (not hack!). But can we use them together? For those that tried, I&amp;#8217;m sure you know by now that trying to shoehorn the whole snippet as a bunch of &lt;span class="caps"&gt;HAML&lt;/span&gt; comments is just gross, and impossible.&lt;/p&gt;
&lt;section class="flush"&gt;
&lt;p&gt;&lt;img src="http://ricostacruz.com/images/cc_ie_html.png" alt="" /&gt;&lt;/p&gt;
&lt;div class="caption c1"&gt;
&lt;p&gt;&lt;strong&gt;Figure 1&lt;/strong&gt;.&lt;br /&gt;
IE conditional comments allows you to target IE versions easily without any hacks. More info in &lt;a href="http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/"&gt;Paul Irish&amp;#8217;s post&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/section&gt;
&lt;section class="pt2 nb main"&gt;
&lt;div class="c c1"&gt;
&lt;h3&gt;Implementing conditional comments: the helpers way&lt;/h3&gt;
&lt;p&gt;The solution isn&amp;#8217;t that hard to accomplish! &lt;span class="caps"&gt;HAML&lt;/span&gt; lets you have helper functions that take in blocks which you can receive in your helper functions as &lt;span class="caps"&gt;HTML&lt;/span&gt;. I suppose we just put two and two together, and:&lt;/p&gt;
&lt;/div&gt;
&lt;pre class="c2 fr prettyprint lang-rb"&gt;
module ConditionalHtmlHelper
  # Implements the Paul Irish IE conditional comments HTML tag--in HAML.
  # http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/
  def cc_html(options={}, &amp;amp;blk)
    attrs = options.map { |(k, v)| " #{h k}='#{h v}'" }.join('')
    [ "&amp;lt;!--[if lt IE 7 ]&amp;gt; &amp;lt;html#{attrs} class='ie6'&amp;gt; &amp;lt;![endif]--&amp;gt;",
      "&amp;lt;!--[if IE 7 ]&amp;gt;    &amp;lt;html#{attrs} class='ie7'&amp;gt; &amp;lt;![endif]--&amp;gt;",
      "&amp;lt;!--[if IE 8 ]&amp;gt;    &amp;lt;html#{attrs} class='ie8'&amp;gt; &amp;lt;![endif]--&amp;gt;",
      "&amp;lt;!--[if IE 9 ]&amp;gt;    &amp;lt;html#{attrs} class='ie9'&amp;gt; &amp;lt;![endif]--&amp;gt;",
      "&amp;lt;!--[if (gt IE 9)|!(IE)]&amp;gt;&amp;lt;!--&amp;gt; &amp;lt;html#{attrs}&amp;gt; &amp;lt;!--&amp;lt;![endif]--&amp;gt;",
      capture_haml(&amp;amp;blk).strip,
      "&amp;lt;/html&amp;gt;"
    ].join("\n")
  end

  def h(str); Rack::Utils.escape_html(str); end
end

# Assuming Main is your Sinatra app
Main.helpers ConditionalHtmlHelper
&lt;/pre&gt;
&lt;div class="c c1"&gt;
&lt;h3&gt;Usage in &lt;span class="caps"&gt;HAML&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;Now in your &lt;span class="caps"&gt;HAML&lt;/span&gt; layouts, instead of using &lt;code&gt;%html&lt;/code&gt;, use the new helper like so:&lt;/p&gt;
&lt;/div&gt;
&lt;pre class="c2 fr prettyprint lang-rb"&gt;
!!! 5
!= cc_html(:lang =&amp;gt; 'en') do
  %head
    %meta(charset='UTF-8')
    %title Hello!

  %body
    ...
&lt;/pre&gt;
&lt;/section&gt;
&lt;section class="alert"&gt;
&lt;div class="c1"&gt;
&lt;h3&gt;Oh, and one more thing&amp;#8230;&lt;/h3&gt;
&lt;p&gt;This will make it dirt easy to implement IE-specific stuff in &lt;span class="caps"&gt;SCSS&lt;/span&gt;. Thanks to &lt;a href="http://twitter.com/marcopalinar"&gt;@marcopalinar&lt;/a&gt; for the tip.&lt;/p&gt;
&lt;/div&gt;
&lt;pre class="c1 prettyprint lang-css"&gt;
/* Fix the double margin bug */
.posts {
    margin-left: 10px;
    .ie6 &amp;amp; { margin-left: 5px; }
}
&lt;/pre&gt;

&lt;pre class="c1 prettyprint lang-css"&gt;
/* Upgrade notice */
.upgrade-your-browser {
  &amp;amp; { display: none; }
  .ie6 &amp;amp; { display: block; }
}
&lt;/pre&gt;
&lt;/section&gt;
&lt;h3 class="c c2"&gt;That&amp;#8217;s it!&lt;/h3&gt;
&lt;p class="c c2"&gt;Aura now has all it&amp;#8217;s views peppered with the conditional comments trick. Still no IE compatibility, though&amp;#8230; that&amp;#8217;ll come later. By the way, there may be a better solution &lt;a href="https://gist.github.com/636041"&gt;here&lt;/a&gt;. As usual, you can check the demo site at &lt;a href="http://aurademo.heroku.com"&gt;aurademo.heroku.com&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ricostacruz/~4/7jG-tkB9bj8" height="1" width="1"/&gt;</description>
<pubDate>Sun, 10 Oct 2010 00:00:00 +0000</pubDate>
<feedburner:origLink>http://ricostacruz.com/2010/haml_and_ie_compatibility.html</feedburner:origLink></item>
</channel>
</rss>
