<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>HugoGiraudel.com</title>
		<description>I write about front-end development stuff.</description>
		<link>http://hugogiraudel.com</link>
		<atom:link href="http://hugogiraudel.com/feeds/feed.xml" rel="self" type="application/rss+xml" />
		
			
			<item>
				<title>Things I'd like to be able to do in 2013</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;This post will be kind of &quot;personal&quot; since I want to talk about things I would like to be able to do before the end of the year. &lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;javascript&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Get better at JavaScript &lt;a href=&quot;#javascript&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;God, I suck at JavaScript.&lt;/blockquote&gt;


&lt;p&gt;God, I suck at JS. Hopefully, I get slightly better each day. My code is more and more structured but I'm far from being even acceptable at JavaScript. So many things are still a mess in my head. I'd really like to get better before the end of the year. At least good enough to do some simple stuff without struggling for hours.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;canvas&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Learning Canvas &lt;a href=&quot;#canvas&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I have good hope that once I'll be more comfortable with JavaScript, I will also be more comfortable with Canvas. This is a fantastic tool offering close to endless possibilities. I had the opportunity to use it once or twice during the past, but it was mostly coming in some kind of library.&lt;/p&gt;


&lt;p&gt;I know there are some &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/HTML/Canvas/Tutorial&quot;&gt;pretty&lt;/a&gt; &lt;a href=&quot;http://www.canvasdemos.com/type/tutorials/&quot;&gt;good&lt;/a&gt; &lt;a href=&quot;http://www.alsacreations.com/tuto/lire/1484-introduction.html&quot;&gt;tutorials&lt;/a&gt; out there to learn how to use Canvas but I didn't take the time to dig into them. What do you think guys, worth it? Or we can live without it for now?&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;flexbox&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Learn how to use Flexbox &lt;a href=&quot;#flexbox&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I have some basic knowledge regarding the &lt;a href=&quot;http://www.w3.org/TR/css3-flexbox/&quot;&gt;Flexible Box Module&lt;/a&gt;. I even made all the &lt;a href=&quot;http://css-tricks.com/almanac/&quot;&gt;CSS-Tricks Almanac&lt;/a&gt; entries on this stuff and the &lt;a href=&quot;http://css-tricks.com/snippets/css/a-guide-to-flexbox/&quot;&gt;complete guide&lt;/a&gt; for it. But I am not comfortable with this. I haven't implemented it in any project yet, and can't wait to do so.&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;I truely believe Flexbox is the future of CSS layout.&lt;/blockquote&gt;


&lt;p&gt;I truely believe Flexbox is the future of CSS layout, especially when it comes to RIA (Rich Internet Applications) and web apps. Floats and inline-blocks are sucky as hell when it comes to complex architectures.&lt;/p&gt;


&lt;p&gt;On a lesser extend (mostly because of the browser support), I think the &lt;a href=&quot;http://hugogiraudel.com/2013/04/04/css-grid-layout/&quot;&gt;Grid Layout Module&lt;/a&gt; is equally very interesting. Layout possibilities are endless, and it's only the beginning: the specification is still not over.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;z-index&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Finally understanding z-index &lt;a href=&quot;#z-index&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I consider myself as a good &quot;CSS developer&quot; (if such a thing even exists); I have solid knowledge on the language, I know how to do pretty much anything that comes in a standard-to-advanced front-end project and I'm aware of performance, accessibility, responsive design and all the topics that cool kids talk about. But if there is one thing I still don't get properly, it has to be &lt;code&gt;z-index&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure--right&quot;&gt;
&lt;img src=&quot;/images/things-to-do-2013__z-index.gif&quot; alt=&quot;&quot;&gt;
&lt;figcaption&gt;What I look like when dealing with z-index&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;I swear, guys behind the specification of this property were either sadist or completely high. If you're asking me, this is by far one of the most complicated things to understand in CSS2.1. This &lt;a href=&quot;http://philipwalton.com/articles/what-no-one-told-you-about-z-index/&quot;&gt;excellent article by Philip Walton&lt;/a&gt; proves it.&lt;/p&gt;


&lt;p&gt;
&lt;/section&gt;
&lt;section id=&quot;team-work&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Work on a medium to large scale project &lt;a href=&quot;#team-work&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I feel like I lack some experience when it comes to large-scale projects. Same goes with team work. Even if I work on a team, I use to be the only developer on projects I'm working on. Other guys are either designers or managers, and such.&lt;/p&gt;


&lt;p&gt;I'd really like to work with several developers on a same project before the end of the year. I'm sure I will learn a ton of things. It is very different to work with multiple guys on the same code basis from working alone with one's own code.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;It has been week since I first designed the first draft of this post in my head. Back then, I wanted to include &quot;go to a conference&quot;, and even &quot;speak to a conference&quot;. Hopefully, I don't have to include them since &lt;strong&gt;I'll be attending the &lt;a href=&quot;http://kiwiparty.fr/&quot;&gt;KiwiParty&lt;/a&gt; as a speaker in late June&lt;/strong&gt;. Very excited. :)&lt;/p&gt;


&lt;p&gt;Anyway, this is only the tip of the iceberg, there are so much more things I would love to learn and do before even the end of the month. Alas, time isn't expandable!&lt;/p&gt;


&lt;p&gt;What about you guys? What is it that you'd like to be able to do before the end of 2013?&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 13 May 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/05/13/things-to-do-2013/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/05/13/things-to-do-2013/</guid>
			</item>
			
		
			
			<item>
				<title>Six months of blogging</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;Hey guys! Yesterday, the blog was 6 months old. Launched in &lt;a href=&quot;http://hugogiraudel.com/2012/11/09/redesign-blog/&quot;&gt;November 9th 2012&lt;/a&gt; as a quick and dirty plateform to drop some posts when I get time, now built on &lt;a href=&quot;http://jekyllrb.com/&quot;&gt;Jekyll&lt;/a&gt;, &lt;a href=&quot;http://sass-lang.com/&quot;&gt;Sass&lt;/a&gt; and &lt;a href=&quot;https://github.com/HugoGiraudel/hugogiraudel.github.com&quot;&gt;GitHub Pages&lt;/a&gt;, I have to say I am pretty happy with what I have done so far with this.&lt;/p&gt;


&lt;p&gt;I take this article as an opportunity to make some kind of assessment. Any comment appreciated of course. ;)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;analytics&quot;&gt;&lt;/p&gt;

&lt;h2&gt;A few analytics &lt;a href=&quot;#analytics&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;h3&gt;About the blog&lt;/h3&gt;


&lt;p&gt;In 6 months, I've released exactly 30 articles (this is 31st) including 3 specials: 2 interviews (&lt;a href=&quot;http://hugogiraudel.com/2013/04/23/interview-by-clement-osternaud/&quot;&gt;one of me from Clément Osternaud&lt;/a&gt; and &lt;a href=&quot;http://hugogiraudel.com/2013/03/11/interview-manoela-ilic/&quot;&gt;one of Manoela Ilic from me&lt;/a&gt;) and a guest post (&lt;a href=&quot;http://hugogiraudel.com/2013/02/04/css-gradients/&quot;&gt;from Ana Tudor&lt;/a&gt;).&lt;/p&gt;


&lt;p&gt;The most successful article is definitely &lt;a href=&quot;http://hugogiraudel.com/2013/02/04/css-gradients/&quot;&gt;Dig deep into CSS linear gradients&lt;/a&gt; (the guest post from Ana Tudor) with more than 30,000 viewed pages and 32 comments. Then it is a very old one: &lt;a href=&quot;http://hugogiraudel.com/2012/11/13/less-to-sass/&quot;&gt;Why I switched from LESS to Sass&lt;/a&gt; with over 12,000 viewed pages for 29 comments. The third most read article is &lt;a href=&quot;http://hugogiraudel.com/2013/04/30/css-aha-moment/&quot;&gt;My CSS aha moment&lt;/a&gt; with about 11,000 viewed pages and 30 comments. Note that other articles like &lt;a href=&quot;http://hugogiraudel.com/2013/04/08/css-alternative-select/&quot;&gt;Why a CSS alternative to the select element is not possible&lt;/a&gt;, &lt;a href=&quot;http://hugogiraudel.com/2013/01/28/float-down/&quot;&gt;Simulate float: down&lt;/a&gt; and &lt;a href=&quot;http://hugogiraudel.com/2013/04/04/css-grid-layout/&quot;&gt;Future of CSS layout: Grid&lt;/a&gt; has been very welcomed as well.&lt;/p&gt;


&lt;p&gt;All articles have drawn more than &lt;strong&gt;82,000 unique visitors&lt;/strong&gt; for about &lt;strong&gt;150,000 viewed pages&lt;/strong&gt;. The average visit duration is close to one minute, and the number of page per visit is around 1.4.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure&quot;&gt;
&lt;img src=&quot;/images/six-months-blogging__visits.jpg&quot; alt=&quot;&quot;&gt;
&lt;figcaption&gt;Spiky visits between February and April&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;h3&gt;About you&lt;/h3&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;Chrome gets more than 60% of the browser share.&lt;/blockquote&gt;


&lt;p&gt;Enough about me, let's talk about you: &lt;strong&gt;28% of users come from United States&lt;/strong&gt;, 8% come from United Kingdom, then a little more than 7% from France.&lt;/p&gt;


&lt;p&gt;Regarding browser, I'm a lucky bastard: &lt;strong&gt;Chrome gets more than 60% of the browser share&lt;/strong&gt; on my site, then it's Firefox with 17.5%, and then Safari with 16%. Internet Explorer comes further with 1.8%.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure--left&quot;&gt;
&lt;img src=&quot;/images/six-months-blogging__mobile-vs-desktop.png&quot; alt=&quot;&quot;&gt;
&lt;figcaption&gt;&lt;span style=&quot;color: #50b432&quot;&gt;Mobile&lt;/span&gt; vs &lt;span style=&quot;color: #058dc7&quot;&gt;Desktop&lt;/span&gt;&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;About &lt;strong&gt;14% users are reading articles on their mobile phone&lt;/strong&gt; (cf. fig 2). and 7 out of 10 of them use an Apple phone. The 3 others use Android (I'm in).&lt;/p&gt;


&lt;p&gt;The most important traffic source is definitely &lt;a href=&quot;http://twitter.com&quot;&gt;Twitter&lt;/a&gt; (actually t.co), then it's &lt;a href=&quot;http://reddit.com&quot;&gt;Reddit&lt;/a&gt; and then &lt;a href=&quot;http://tympanus.com/codrops/&quot;&gt;Codrops&lt;/a&gt;. A little further behind, we have &lt;a href=&quot;http://sidebar.io&quot;&gt;Sidebar.io&lt;/a&gt;, &lt;a href=&quot;http://google.com&quot;&gt;Google&lt;/a&gt; and &lt;a href=&quot;http://css-tricks.com&quot;&gt;CSS-Tricks&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section&gt;&lt;/p&gt;

&lt;h2&gt;What's next? &lt;a href=&quot;#&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;You tell me. Is there anything you'd like to see?&lt;/p&gt;


&lt;p&gt;I'm thinking about adding an excerpt for each blog post to the home page. I think some people asked for it. My problem with this is that excerpt are a pain in the ass to do if you want to do it right, and when generated, it generally sucks. I'll see if I can come up with a decent solution.&lt;/p&gt;


&lt;p&gt;I would also like to add a small banner for &lt;a href=&quot;http://browserhacks.com&quot;&gt;Browserhacks&lt;/a&gt; in the sidebar. I'll work that out anytime soon.&lt;/p&gt;


&lt;p&gt;Anyway, thank you all for reading. That's what keeps me writing. ;)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Fri, 10 May 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/05/10/six-months-blogging/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/05/10/six-months-blogging/</guid>
			</item>
			
		
			
			<item>
				<title>Automatic figure numbering with CSS counters</title>
				<description></description>
				<pubDate>Thu, 02 May 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/05/02/automatic-figure-numbering/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/05/02/automatic-figure-numbering/</guid>
			</item>
			
		
			
			<item>
				<title>My CSS Aha moment</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;I'd like to share with you my CSS &quot;Aha moment&quot;. The &quot;Aha moment&quot; is when some day, in the very back of your head, two neurons get in touch and all of the sudden things become clear as crystal.&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;All elements on a page are rectangles.&lt;/blockquote&gt;


&lt;p&gt;I think mine was like two years ago or something and since then my CSS has been better than ever. I don't really remember how it came up, but suddenly I understood that &lt;strong&gt;absolutely all elements on a page are rectangles&lt;/strong&gt;.&lt;/p&gt;


&lt;p&gt;God, that sounds stupid now but it really helped in understanding how to make efficient CSS. You know, at first you don't necessarily get that a line of text isn't shaped around the text but follows the same pattern as all other elements.&lt;/p&gt;


&lt;p&gt;And when you get that and most generally the whole box-model (that says width equals &lt;code&gt;width + padding-left + padding-right + border-left + border-right.&lt;/code&gt;), everything becomes so simple.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure--right&quot;&gt;
&lt;img src=&quot;/images/css-aha-moment__box-model.jpg&quot; alt=&quot;&quot;&gt;
&lt;figcaption&gt;CSS Box Model&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;Seriously, the first thing to understand when learning CSS is that every element is following the same pattern: &lt;strong&gt;a content-box in a padding-box in a border-box in a margin-box&lt;/strong&gt;; I don't know why my teachers didn't even start with that.&lt;/p&gt;


&lt;p&gt;Once you get that, it's really not that hard to produce correct (not necessarily efficient, but still correct) CSS.&lt;/p&gt;


&lt;p&gt;What about you? What was your Aha moment?&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 30 Apr 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/04/30/css-aha-moment/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/04/30/css-aha-moment/</guid>
			</item>
			
		
			
			<item>
				<title>My interview by Clément Osternaud</title>
				<description>&lt;p&gt;&lt;section id=&quot;introduction&quot;&gt;&lt;/p&gt;

&lt;p class=&quot;explanation&quot;&gt;French front-end developer Clément Osternaud interviewed me for &lt;a href=&quot;http://myressources.com/interview-hugo-giraudel/&quot;&gt;his site&lt;/a&gt;. Below is the translation of the whole interview.&lt;/p&gt;


&lt;p&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt; Could you introduce yourself in a few lines &lt;a href=&quot;#introduction&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;My name is Hugo Giraudel. I'm a front-end developer on a work-based learning at Crédit Agricole Sud Rhône Alpes in Grenoble (France), hoping to work in a web agency starting from September. I'm really into front-end languages especially CSS &amp; JS, as well as everything that comes with those languages: ergonomy, performance, accessibility, user experience, and much more.&lt;/p&gt;


&lt;p&gt;I am the co-author of &lt;a href=&quot;http://browserhacks.com&quot;&gt;Browserhacks&lt;/a&gt; &amp;mdash; a website aiming at gathering all the dirty little secrets from browsers to do some browser sniffing ; not that I support that kind of thing but someone had to do such a tool. ;) I also developed &lt;a href=&quot;http://wildwebwatch.com&quot;&gt;Wild Web Watch&lt;/a&gt; &amp;mdash; a web-related watch tool (which unfortunately gets old pretty badly). I also take care of the Sass port of Raphaël Goetter's framework, &lt;a href=&quot;http://knacss.com&quot;&gt;KNACSS&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Beside that, I write a lot for the web, starting on my site but for &lt;a href=&quot;http://tympanus.com/codrops/author/hugogiraudel&quot;&gt;Codrops&lt;/a&gt; and &lt;a href=&quot;http://css-tricks.com&quot;&gt;CSS-Tricks&lt;/a&gt; as well, and on some other places as guest posts like for &lt;a href=&quot;http://toddmotto.com/raw-javascript-jquery-style-fadein-fadeout-functions-hugo-giraudel/&quot;&gt;Todd Motto&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;path&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt; What is your school/professional path? &lt;a href=&quot;#introduction&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Since I didn't know what to do after highscool, I decided to join Ariès Grenoble - a school for computer graphics (web, print and 3D stuff) in order to become a Game Designer.&lt;/p&gt;


&lt;p&gt;During the preparatory class, I realized I don't like 3D stuff, which makes me revise my path a little bit. Since I have two sisters and a brother in the web industry, I decided to join the &quot;Webdesign&quot; formation just to &quot;see what it looks like&quot;. A long and kind of boring year since this formation included a lot of print design (yes, this is weird for a Webdesign formation).&lt;/p&gt;


&lt;p&gt;In September 2011, I got into the &quot;Webmaster&quot; formation (still in Ariès) in a work-based learning at Crédit Agricole Sud Rhône Alpes; I felt like I fit. I wrapped my head around an array of languages &amp;mdash; going from HTML/CSS to PHP/MySQL passing by ActionScript 3 and Flex &amp;mdash; and got my diploma with commendation, pretty confident in the idea of becoming a web developer.&lt;/p&gt;


&lt;p&gt;I wanted to push this idea further last year by joining what comes close to &quot;Computer Science&quot; (still in Ariès) but I have to say I really don't belong here. Back-end languages like Java &amp; C++ and server stuff really don't please me.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;qualifications&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt; According to you, what are the required qualifications for your job? &lt;a href=&quot;#qualifications&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;I love experimenting and trying new things.&lt;/blockquote&gt;


&lt;p&gt;That ain't easy. I think the biggest &quot;problem&quot; of client-side languages is that they are dependent on the client. This implies a lot of hacks and tricks to make everything work everywhere. This is even more true today with mobile devices like tablets and smartphones or even TV screens! So this asks for a lot of patience and experience (the latter comes with time, hopefully).&lt;/p&gt;


&lt;p&gt;I also think we really have to love experimenting and trying new things. We work with constantly evolving languages which implies reading as much docs and tutorials as we can. Being aware of incoming things is part of a web developer's job.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;like&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt; What do you like the most in your job? And the least? &lt;a href=&quot;#like&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;My favourite thing in my job hasto be &lt;strong&gt;learning things&lt;/strong&gt;. It's definitely because I'm passionate that I'm comfortable with some things today. As good as my web teacher has been, I don't owe him my skills (not all of them at least). Long story short, I enjoy reading web related stuff.&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;I enjoy reading web related stuff.&lt;/blockquote&gt;


&lt;p&gt;Beyond reading, it's great to be able to easily discover and learn new things like CSS features, JavaScript APIs, preprocessors and much more (especially thanks to tools like &lt;a href=&quot;http://codepen.io&quot;&gt;CodePen&lt;/a&gt; and &lt;a href=&quot;http://github.com&quot;&gt;GitHub&lt;/a&gt;). And if we ever happen to use what we've learnt in real-life projects, then it's even better!&lt;/p&gt;


&lt;p&gt;Ironically, even if I am able to define what I like in my job I don't think I'm able to tell what I like the least. Maybe not being always able to use everything I know in real-life projects because of technical constraints like performance, maintainability or browser support. But this is part of the job; we can't use everything we know, especially when it comes to new &amp;mdash; somewhat borderline &amp;mdash; features (&quot;hello CSS grid!&quot;).&lt;/p&gt;


&lt;p&gt;But this &quot;bad side&quot; of our job is what makes it interesting. Producing clean, maintainable and future-proof code is what makes the front-end developer work fun.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;10-years&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt; Where do you see yourself in 10 years? &lt;a href=&quot;#10-years&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Haha! That's a tough one! I guess I'd love to work in a company with an interesting web unit with a dedicated team to move things forward. I particulary hope to keep my thirst of learning. If I manage to keep that, I'll consider myself happy. ;)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 23 Apr 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/04/23/interview-by-clement-osternaud/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/04/23/interview-by-clement-osternaud/</guid>
			</item>
			
		
			
			<item>
				<title>"CSS is easy"</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p class=&quot;explanation&quot;&gt;&lt;a href=&quot;https://twitter.com/verobouvier&quot;&gt;Véronique Bouvier&lt;/a&gt; translated &lt;a href=&quot;http://www.veronique-bouvier.com/css-cest-facile-par-hugo-giraudel/&quot;&gt;this article in French&lt;/a&gt; on her blog.&lt;/p&gt;


&lt;p&gt;I am studying what comes close to &quot;Programming Sciences&quot;. My mates are hardware, server or back-end guys. When I tell them I prefer front-end, especially HTML/CSS I always get the same reaction: &quot;CSS is easy&quot;.&lt;/p&gt;


&lt;p&gt;And I always tell myself the same thing &quot;Yeaaaaah... so that should explain why your CSS is a fucking mess&quot;.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;syntax&quot;&gt;&lt;/p&gt;

&lt;h2&gt;CSS is easy... syntactically &lt;a href=&quot;#syntax&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Yes. CSS has a very easy syntax based on english words. I don't think it could be much simpler since it can be summed up in 3 words: &lt;strong&gt;selector, property, value&lt;/strong&gt;.&lt;/p&gt;


&lt;p&gt;A 8-year-old child could do some CSS without even having any explanation on how to do so. Even HTML has a more complicated syntax than CSS since there are some elements which need a closing tag, some don't, some have attributes, some don't, some can't be inside others and so on. CSS is always the same.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;selector&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;selector2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;...]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:pseudo-class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;n&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;property2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;value2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;o&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;

&lt;p&gt;Most of all, CSS means something. It uses real words, understandable by anyone. When you read &lt;code&gt;.element { color: red; }&lt;/code&gt;, you can be pretty sure it means an item called &quot;element&quot; is red. It's a no brainer.&lt;/p&gt;


&lt;p&gt;&lt;section id=&quot;evolution&quot;&gt;&lt;/p&gt;

&lt;h2&gt;A constantly evolving language &lt;a href=&quot;#evolution&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;The first &quot;problem&quot; (for lack of a better word) with CSS is that it is a constantly evolving language. It was first introduced in 1994 if no mistake; so almost 20 years ago. After 3 major versions (CSS1, CSS2 and CSS2.1), CSS is now divided into modules growing at their own speed (Colors Level 3, Selectors Level 4, etc.). It means you cannot simply &quot;learn CSS&quot; then don't get back to it. You can learn the bases, yes but it's not enough.&lt;/p&gt;


&lt;p&gt;Some things I learnt 2 years ago are irrelevant now, and some things I'm learning today might disappear or become bad practices in the future. It is a non-stop evolution &amp;mdash;which is cool but&amp;mdash; which requires developers to be very careful.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;browser-dependance&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Browser dependant &lt;a href=&quot;#browser-dependance&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;The thing is, since CSS is a language compiled on the client side (meaning by the browser itself), its interpretation depends on the compiler (once again, the browser).&lt;/p&gt;


&lt;p&gt;Yes, HTML and JavaScript as well. But unless you're using new HTML5 elements (which don't provide much more than semantic), your HTML &amp;mdash;as long as it is valid&amp;mdash; won't differ from one browser to another.&lt;/p&gt;


&lt;p&gt;JavaScript is kind of like CSS. The interpretation depends on the JavaScript engine version. For example, Internet Explorer 9 doesn't use the same &lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_ECMAScript_engines&quot;&gt;ECMAScript engine&lt;/a&gt; as Firefox or Chrome (Chakra for IE9, SpiderMonkey for Firefox, V8 for Chrome).&lt;/p&gt;


&lt;p&gt;Anyway, in order to write consistent CSS, you have to know which browser supports which feature, or partially support them, and how to draw fallback, when to use hacks, and so on. It requires some knowledge, and most of all, some experience.&lt;/p&gt;


&lt;p&gt;Take the Flexbox module for example. It has been introduced in 2009 and has known 3 different syntaxes since then resulting in a blurry mess when trying to have the best browser support:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.flex&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;orient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;horizontal&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flexbox&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;webkit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;moz&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;This is the kind of thing that makes CSS tricky (some people would say annoying).&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;A simple syntax doesn't make an easy language.&lt;/blockquote&gt;


&lt;p&gt;CSS isn't easy. Combining a very permissive (somewhat broken) syntax with constantly evolving features and rendering inconsistencies makes CSS not that easy at all. Yes, the syntax is simple, but a simple syntax doesn't make an easy language.&lt;/p&gt;


&lt;p&gt;And when you have to deal with performance, modular architecture, and responsive webdesign, it becomes even less easy. But that's a whole 'nother story.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 15 Apr 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/04/15/css-is-easy/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/04/15/css-is-easy/</guid>
			</item>
			
		
			
			<item>
				<title>Raw JavaScript jQuery-style fadeIn() / fadeOut()</title>
				<description>
</description>
				<pubDate>Sun, 14 Apr 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/04/14/raw-javascript-jquery-style-fadein-fadeout/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/04/14/raw-javascript-jquery-style-fadein-fadeout/</guid>
			</item>
			
		
			
			<item>
				<title>Why a CSS alternative to &lt;select&gt; is impossible</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;A couple of weeks ago, I came across an article from Pepsized featuring a &lt;a href=&quot;http://pepsized.com/css-only-alternative-to-the-select-element/&quot;&gt;CSS-only alternative to the Select Element&lt;/a&gt;.  Sounds nice! Especially since I recall doing some &lt;a href=&quot;http://tympanus.net/codrops/2012/10/04/custom-drop-down-list-styling/&quot;&gt;dropdown styling at Codrops&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Yeah, it's very nice. Even if it's not an alternative to the Select Element. This is not possible. You cannot do a pure CSS alternative to the Select Element.&lt;/p&gt;


&lt;p&gt;There is more than just a click on a button opening a list of options to the &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element. It involves accessibility, usability, processing, shadow DOM and a lot of various options. A lot of things that CSS can't do. That &lt;strong&gt;CSS isn't supposed to do&lt;/strong&gt;.&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;You can't do a CSS alternative to the Select element.&lt;/blockquote&gt;


&lt;p&gt;Now don't get me wrong, the author at Pepsized did a wonderful job on this article, regarding both the design and the usability (which is far better than what I did at Codrops). (S)He is a good CSS developer, I don't even question that. But once again, (s)he didn't provide a CSS alternative to the &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element. Let me clear things up point per point.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;accessibility&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Accessibility &lt;a href=&quot;#accessibility&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;The major concern here is &lt;strong&gt;accessibility&lt;/strong&gt;. The default &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element is completely usable either with a mouse or a keyboard, following this process:&lt;/p&gt;


&lt;ol&gt;
    &lt;li&gt;Mouse: move your cursor over the &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element&lt;br&gt;
        Keyboard: use the tab key to focus the &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element&lt;/li&gt;
    &lt;li&gt;Mouse: click on the &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element&lt;br&gt;
        Keyboard: press enter&lt;/li&gt;
    &lt;li&gt;Mouse: move your cursor over the desired option&lt;br&gt;
        Keyboard: use the top and bottom arrow keys to pick an option&lt;/li&gt;
    &lt;li&gt;Mouse: click on the desired option&lt;br&gt;
        Keyboard: press enter&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;While making a pure CSS dropdown easily usable with the mouse can be done by pretty much any one with some CSS knowledge, making it usable with keyboard navigation is a whole other story.&lt;/p&gt;


&lt;p&gt;However, it's doable. You won't have exactly the same process as above, but you'll probably be able to pick your option with the arrow keys and such.&lt;/p&gt;


&lt;p&gt;Anyway, this introduces some new behaviour (you may call this inconsistencies) for people who can't use a mouse. Yes, not having to press enter (steps 2 and 4) is probably no big deal for you and I, but for &amp;mdash; let's say &amp;mdash; a blind user, it may be confusing.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;mobile&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Mobile devices &lt;a href=&quot;#mobile&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Mobile devices can become another problem with a home-made &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element. Mobile devices often mean touch events. There is no more mouse. There is no more keyboard. Now there is a finger.&lt;/p&gt;


&lt;p&gt;In most cases, making a custom dropdown accessible for mobile users will take no more than just a few lines of CSS. Basically it requires to change all the hover states by focus states to make things work.&lt;/p&gt;


&lt;p&gt;But &lt;strong&gt;making things work is not always enough&lt;/strong&gt;. Mobile browsers have a very efficient way to handle select dropdowns natively enabling scrolling gestures. When facing a &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; with dozens of options like a dropdown to pick your country, having a mobile-friendly UI can make the difference between a user who buy/subscribe and a user who leave.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;processing&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Processing &lt;a href=&quot;#processing&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;&lt;/p&gt;

&lt;p&gt;In most cases, as a developer you will use a &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element because you want your users to pick an option; option that you will want to use for your database, your email, or whatever.&lt;/p&gt;


&lt;p&gt;Since the &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element is a form element, it comes with a name attribute and the ability to send POST or GET data through a form. This means you can access the selected option by no more than &lt;code&gt;$_POST['name-of-select-element']&lt;/code&gt; in PHP. With JavaScript, it will probably be something like &lt;code&gt;document.getElementById('name-of-select-element').value;&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Fine. Now let's do this with CSS only. Uh-ho, not possible. If you're clever enough, you'll come up with a solution involving hidden radio inputs within your list items. Sounds fair enough; so... you end up using multiple form elements... not to use a form element. Right?&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;You end up using multiple form elements not to use a form element.&lt;/blockquote&gt;


&lt;p&gt;Let's say you don't mind the extra-processing that comes with the multiple radio buttons compared to the regular &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element... &lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;options&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Native options &lt;a href=&quot;#options&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;... what if you want to give your user the ability to select multiple options? Okay, you could still use checkboxes, that sounds legit.&lt;/p&gt;


&lt;p&gt;Then let's talk about other options like: &lt;code&gt;required&lt;/code&gt;, &lt;code&gt;disabled&lt;/code&gt; and &lt;code&gt;autofocus&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;I can think of a workaround for &lt;code&gt;disabled&lt;/code&gt; with a class on the parent element, using pointer-events to disable clicking on items. Okay.&lt;/p&gt;


&lt;p&gt;If you come up with a CSS-only solution to force the user to select an option by preventing form submit and displaying a warning message instead, I'd be more than glad to hear it!&lt;/p&gt;


&lt;p&gt;You could still use JavaScript. But then:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;it's no more a CSS-only alternative to the &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element&lt;/li&gt;
    &lt;li&gt;it adds even more code to your page, slowing it down&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;Performance&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Performance &lt;a href=&quot;#Performance&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Even if it's not much a concern, using a HTML/CSS &quot;alternative&quot; to the &lt;code&gt;&amp;lt;select&amp;gt;&lt;/code&gt; element means using at least a dozen of DOM nodes (quickly ramping up with the number of options) and maybe about 50 lines of CSS, perhaps including some heavy CSS properties like shadows or gradients.&lt;/p&gt;


&lt;p&gt;Okay, it's no big deal when you know the average page size is a little over 1.4Mb (according to &lt;a href=&quot;http://www.httparchive.org/interesting.php#bytesperpage&quot;&gt;HTTP Archive&lt;/a&gt;).&lt;/p&gt;


&lt;p&gt;But still, you could have used a single element (including Shadow DOM) and 0 line of CSS for a result which beats your alternative on all points except on design (and this is yet to be determined).&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Be native &lt;a href=&quot;#final-words&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Browser makers spend countless hours building native support for a lot of things in order to improve both user's experience and developer's life. Use these native features.&lt;/p&gt;


&lt;p&gt;Please, don't screw accessibility, performance and usability for design purpose. Those things should always come first.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 08 Apr 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/04/08/css-alternative-select/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/04/08/css-alternative-select/</guid>
			</item>
			
		
			
			<item>
				<title>Future of CSS layout: CSS Grid</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;In the last few days/weeks, I have been helping Chris Coyier with &lt;a href=&quot;http://css-tricks.com/almanac/&quot;&gt;CSS-Tricks' Almanac&lt;/a&gt;. It seems he doesn't have enough time to fill the last remaining entries, so we've been a few to help him out by writing them. I have done &lt;a href=&quot;http://css-tricks.com/almanac/properties/p/perspective/&quot;&gt;perspective&lt;/a&gt;, &lt;a href=&quot;http://css-tricks.com/almanac/properties/p/perspective-origin/&quot;&gt;perspective-origin&lt;/a&gt; and &lt;a href=&quot;http://css-tricks.com/almanac/properties/g/grid/&quot;&gt;grid&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;I've to say it's been a real pleasure to do this, mostly because I've learnt literally a ton of stuff. Some people say the best way to learn is through teaching, I can say it's mostly true. &lt;/p&gt;


&lt;p&gt;Anyway, if &lt;code&gt;perspective&lt;/code&gt; and &lt;code&gt;perspective-origin&lt;/code&gt; have been quite easy to do, I must say &lt;code&gt;grid&lt;/code&gt; has been a whole another story. This is by far the most complicated thing I have ever seen in CSS. Let me introduce the topic.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;grid&quot;&gt;&lt;/p&gt;

&lt;h2&gt;CSS Grid Layout &lt;a href=&quot;#grid&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;The &lt;a href=&quot;http://www.w3.org/TR/css3-grid-layout/&quot;&gt;CSS Grid Layout&lt;/a&gt; is currently a W3C Working Draft aiming at fixing issues with older layout techniques by providing a better way to achieve complex interface design. Indeed, each solution we (have) use(d) to make web pages has at least a flaw:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;strong&gt;HTML tables&lt;/strong&gt;: markup dependant, not flexible&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;float&lt;/strong&gt;: clearing&lt;/li&gt;
    &lt;li&gt;&lt;strong&gt;inline-blocks&lt;/strong&gt;: spacing between blocks&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The CSS Grid Layout consists on defining a 2-dimensional grid in which the children can be positioned as desired. The main benefits of this technique are:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;source order independant (!)&lt;/li&gt;
    &lt;li&gt;no need for widths or heights&lt;/li&gt;
    &lt;li&gt;no need for floats or inline-blocks&lt;/li&gt;
    &lt;li&gt;no need for margins to space columns from each others&lt;/li&gt;
    &lt;li&gt;easily adjustable when it comes to responsive&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The basic example would be something like this: my &lt;code&gt;.wrapper&lt;/code&gt; is my grid; &lt;code&gt;.header&lt;/code&gt; will all columns of the first row; &lt;code&gt;.main&lt;/code&gt; will by displayed in the second row and the first column; &lt;code&gt;.sidebar&lt;/code&gt; in the second row, second column; and &lt;code&gt;.footer&lt;/code&gt; in the third row, all columns.&lt;/p&gt;


&lt;p&gt;
&lt;/section&gt;
&lt;section id=&quot;complicated&quot;&gt;&lt;/p&gt;

&lt;h2&gt;What's complicated? &lt;a href=&quot;#complicated&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;Specifications are definitely not for random people.&lt;/blockquote
&lt;p&gt;


&lt;p&gt;First, &lt;strong&gt;reading specifications&lt;/strong&gt;. If a spec author ever reads this, I am sorry; but the specifications are definitely not for random people. I believe they are mostly made for browser makers, and they are probably very well writen but for a guy like me, it's way too complicated. Unfortunately, I had to dig deep into the spec.&lt;/p&gt;&lt;/p&gt;

&lt;p&gt;What has been difficult as well is that the only supported browser &amp;mdash;as of writing&amp;mdash; is Internet Explorer 10 (mostly because 3 of 5 authors of the Grid spec are from Microsoft). And I believe they started implementing the module in their browser engine a while ago, resulting in some inconsistencies regarding the spec which keeps moving.&lt;/p&gt;


&lt;p&gt;Not only their implementation is at a very early stage (about half the spec is currently supported), but it also differs from the spec at some point. Among other things:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;code&gt;grid-rows&lt;/code&gt; and &lt;code&gt;grid-columns&lt;/code&gt; have been renamed in &lt;code&gt;grid-definition-rows&lt;/code&gt; and &lt;code&gt;grid-definition-columns&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;grid-row&lt;/code&gt; is supposed to be a shorthand for &lt;code&gt;grid-row-position&lt;/code&gt; and &lt;code&gt;grid-row-span&lt;/code&gt;. The current implementation in Internet Explorer 10 for &lt;code&gt;grid-row&lt;/code&gt; should be the one for &lt;code&gt;grid-row-position&lt;/code&gt; (which isn't supported). Same goes for &lt;code&gt;grid-column&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;This kind of stuff definitely doesn't make things easier.&lt;/p&gt;


&lt;p&gt;Otherwise, the module is quite complicated by itself. It involves about 15 new properties, a new unit, and more important: a whole new way of thinking. Fortunately, the currently supported part of the spec is quite easily understandable and it has been very fun to play around with.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;example&quot;&gt;&lt;/p&gt;

&lt;h2&gt;A little example &lt;a href=&quot;#example&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;What I've found astonishing is the very little amount of required CSS to achieve a complex layout. I counted: with no more than 10 lines of CSS, I've been able to make a 3-columns layout including 2 fixed-size columns, with full-width header and footer. Oh, and source order independant. Please have a look at the following markup:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;div&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;wrapper&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;article&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;main&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;My awesome content here &lt;span class=&quot;nt&quot;&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;footer&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;footer&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Some informations here  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/footer&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;header&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;header&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;My site title goes here &lt;span class=&quot;nt&quot;&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;aside&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;sidebar&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Here is my side content &lt;span class=&quot;nt&quot;&gt;&amp;lt;/aside&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;aside&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;annexe&amp;quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;Some more side content  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/aside&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Now the CSS. Pay attention to the number of lines:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.wrapper&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;columns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fr&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.header&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.footer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;span&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.sidebar&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; 
&lt;span class=&quot;nc&quot;&gt;.main&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; 
&lt;span class=&quot;nc&quot;&gt;.annexe&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.header&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.footer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.sidebar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.main&lt;/span&gt;    &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.annexe&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Done. &lt;strong&gt;10 lines. No float. No inline-block. No height. No width. No margin.&lt;/strong&gt; And if you want to make everything nice on small devices, it will take no more than a couple of more lines (8 in this example). &lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: I won't explain the syntax in this article. If you want to understand how works the Grid Layout, please have a look at &lt;a href=&quot;http://css-tricks.com/almanac/properties/g/grid/&quot;&gt;CSS-Tricks' Almanac entry&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;flexbox&quot;&gt;&lt;/p&gt;

&lt;h2&gt;What about Flexbox? &lt;a href=&quot;#flexbox&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;blockquote class=&quot;quote&quot;&gt;&lt;p&gt;Are Flexbox and Grid both solutions to the same problem or do they both have their own use case?&lt;/p&gt;
&amp;mdash; &lt;a href=&quot;https://twitter.com/Lezz/status/319376112679522304&quot;&gt;@Lezz&lt;/a&gt;&lt;/blockquote&gt;


&lt;p&gt;This question comes from Twitter. However I've been questioning myself regarding this while making the entry for CSS-Tricks. Let's have a look at both specifications:&lt;/p&gt;


&lt;blockquote class=&quot;quote&quot;&gt;&lt;p&gt;The &lt;strong&gt;Flexbox specification&lt;/strong&gt; describes a CSS box model optimized for user interface design. In the flex layout model, the children of a flex container can be laid out in any direction, and can “flex” their sizes, either growing to fill unused space or shrinking to avoid overflowing the parent. Both horizontal and vertical alignment of the children can be easily manipulated. Nesting of these boxes (horizontal inside vertical, or vertical inside horizontal) can be used to build layouts in two dimensions.&lt;/p&gt;&lt;/blockquote&gt;


&lt;blockquote class=&quot;quote&quot;&gt;&lt;p&gt;&lt;strong&gt;Grid Layout&lt;/strong&gt; contains features targeted at web application authors. The Grid can be used to achieve many different layouts. It excels at dividing up space for major regions of an application, or defining the relationship in terms of size, position, and layer between parts of a control built from HTML primitives.&lt;/p&gt;
&lt;p&gt;Like tables, the Grid enables an author to align elements into columns and rows, but unlike tables, the Grid doesn’t have content structure, and thus enables a wide variety of layouts not possible with tables. For example, the children of the Grid can position themselves with Grid lines such that they overlap and layer similar to positioned elements.&lt;/p&gt;
&lt;p&gt;In addition, the absence of content structure in the Grid helps to manage changes to layout by using fluid and source order independent layout techniques. By combining media queries with the CSS properties that control layout of the Grid and its children, authors can adapt their layout to changes in device form factors, orientation, and available space, without needing to alter the semantic nature of their content.&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;So as I understand this, &lt;strong&gt;the Grid layout is &quot;macro&quot; while the Flexbox module is &quot;micro&quot;.&lt;/strong&gt; I think Grid will be perfect to organize the layout structure with high-level elements whereas Flexbox will be best-suited for some modules that require specific alignments, ordering and so like a fluid navigation for example.&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;https://twitter.com/kyle_keeling&quot;&gt;Kyle Keeling&lt;/a&gt; wrote &lt;a href=&quot;http://www.outsidethebracket.com/understanding-the-difference-between-css3-flexbox-grid-layout/&quot;&gt;an entry&lt;/a&gt; about this a couple of months ago, explaing what he thinks is the difference between Flexbox and Grid.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;I have been amazed by its efficiency.&lt;/blockquote&gt;


&lt;p&gt;For having &lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/2befd6d225b69912af8561f7cb020124&quot;&gt;played&lt;/a&gt; with the module for hours, I can tell it is quite promising. I have been amazed by its efficiency, and I even could try to mix it with CSS preprocessors: it rocks. The fact it's fully number-based makes it very easy to use in &lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/fb0e46cde228e5437993ba1305459a22&quot;&gt;loops&lt;/a&gt;, &lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/aCliz&quot;&gt;mixins and functions&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Unfortunately, it is way too soon to use the Grid layout in a real-life project, especially since the browser support is restricted to Internet Explorer 10. However, I've heard the support is coming to Firefox and Chrome nightly builds, so I think we will be able to safely play around with it in a few months from now.&lt;/p&gt;


&lt;p&gt;Then let's hope in a year from now, the browser support will be great in all modern browsers (Chrome, Firefox, Opera, IE10+, including some mobile browsers) giving us the ability to use it in projects that don't aim at old browsers.&lt;/p&gt;


&lt;p&gt;Meanwhile, you can still experiment with it on Internet Explorer. Here are a couple of useful resources on the topic:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;a href=&quot;http://www.w3.org/TR/css3-grid-layout/&quot;&gt;CSS Grid Layout in the CSS specifications&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ie/hh673533(v=vs.85).aspx&quot;&gt;CSS Grid Layout by Microsoft&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://ie.microsoft.com/testdrive/Graphics/hands-on-css3/hands-on_grid.htm&quot;&gt;Microsoft's CSS Grid layout playground&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://24ways.org/2012/css3-grid-layout/&quot;&gt;CSS Grid Layout by 24Ways&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://www.alsacreations.com/article/lire/1388-css3-grid-layout.html&quot;&gt;CSS Grid Layout by Raphael Goetter (FR)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 04 Apr 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/04/04/css-grid-layout/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/04/04/css-grid-layout/</guid>
			</item>
			
		
			
			<item>
				<title>Items on circle with CSS</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;If you like to experiment or do a little bit of webdesign, then you have probably already tried to put elements on a circle. Unless you're a CSS hacker, you've probably set a class/ID per item, then used &lt;code&gt;left&lt;/code&gt; and &lt;code&gt;top&lt;/code&gt; accordingly to position everything around the circle.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure--right&quot;&gt;
&lt;img alt='' src='/images/items-on-circle__5-items.png' /&gt;
&lt;figcaption&gt;5 images positioned along a circle with CSS&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;But in most cases, you would have ended doing this with JavaScript, or jQuery. There are plenty of &lt;a href=&quot;http://addyosmani.com/blog/jquery-roundrr/&quot;&gt;plugins&lt;/a&gt; doing this out there, and no doubt they are all good.&lt;/p&gt;


&lt;p&gt;But what if you could do it very simply with CSS? That's what &lt;a href=&quot;http://stackoverflow.com/questions/12813573/position-icons-into-circle&quot;&gt;Ana Tudor did in an answer on StackOverflow&lt;/a&gt;. Instead of using basic positioning, she relies on chained CSS transforms to do it. God, this is brilliant. Well? Let's push it further.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;current-solution&quot;&gt;&lt;/p&gt;

&lt;h2&gt;About the current solution &lt;a href=&quot;#current-solution&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Ana's work is great, I'm not questioning this. However, adding or removing elements can be tricky. Before going any further, let's see how she does this:&lt;/p&gt;


&lt;blockquote class=&quot;quote&quot;&gt;&lt;p&gt;[...] You then decide on the angles at which you want to have your links with the images and you add a class deg{desired_angle} (for example deg0 or deg45 or whatever). Then for each such class you apply chained CSS transforms, like this:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;desired_angle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; 
    &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;desired_angle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 
    &lt;span class=&quot;nt&quot;&gt;translate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;half_parent_size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; 
    &lt;span class=&quot;nt&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;desired_angle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;where you replace {desired_angle} with 0, 45, and so on...&lt;/p&gt;
&lt;p&gt;The first rotate transform rotates the object and its axes, the translate transform translates the object along the rotated X axis and the second rotate transform brings back the object into position - &lt;a href=&quot;http://dabblet.com/gist/3866686&quot;&gt;demo to illustrate how this works&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Because Ana adds specific classes to HTML elements, it's not very fast to add or remove an element. It requires to add the according class to the new element, and change the name + CSS of all other classes to distribute evenly all items along the circle. Bummer.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;sass&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Sass to the rescue! &lt;a href=&quot;#sass&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I was pretty sure I could do something cool and easy with Sass. Indeed, I ended with a mixin handling all the positioning automagically. Plus:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;You can define the number of items you want on the circle&lt;/li&gt;
&lt;li&gt;You can use any element you want as child of the container, even different ones (&lt;code&gt;li&lt;/code&gt;, &lt;code&gt;div&lt;/code&gt;, &lt;code&gt;span&lt;/code&gt;, &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;img&lt;/code&gt;, whatever)&lt;/li&gt;
&lt;li&gt;It only places items, not more not less: all the fancy stuff is up to you&lt;/li&gt;
&lt;li&gt;It includes a small reset in order to allow you to use it on unordered lists&lt;/li&gt;
&lt;li&gt;It takes care of vendor prefixes for you thanks to Compass&lt;/li&gt;
&lt;li&gt;It handles fallbacks for older browsers&lt;/li&gt;
&lt;li&gt;It's damn easy to use&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Here are the arguments you can pass to the mixin in order to suit your needs:&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;&lt;code&gt;$nb-items (integer)&lt;/code&gt;: this is the number of items you want to distribute along the circle&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$circle-size (length)&lt;/code&gt;: this is the size of your circle&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$item-size (length)&lt;/code&gt;: this is the size of an item&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$class-for-IE (string|false)&lt;/code&gt; (optional): class used as a fallback for pseudo-selectors (default is false, meaning no fallback)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Thus, usage is pretty straight forward:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.my-container&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;/* With no support for old IE &lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;     */&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;putOnCircle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;putOnCircle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;/* With support for old IE&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;     * Using class &amp;quot;item&amp;quot; (.item1, .item2, .item3, etc.)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;     */&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;putOnCircle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;item&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p class=&quot;note&quot;&gt;If the number of items in the container is superior to the parameter given in the mixin, left children are nicely stacked on top of each other at the center of the parent, not breaking anything.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;how&quot;&gt;&lt;/p&gt;

&lt;h2&gt;How does it work? &lt;a href=&quot;#how&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;It's pretty easy. It divides &lt;code&gt;360°&lt;/code&gt; by the number of elements you ask for to compute the angle between 2 items. Then, it runs a @for loop using pseudo-selectors (&lt;code&gt;:nth-of-type()&lt;/code&gt;) to assign the appropriate transforms to each element.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rot&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Rotation angle for the current item */&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;angle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;360&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;nb-items&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Angle between two items */&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@for&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;nb-items&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-of-type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; 
            &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#{$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;       &lt;span class=&quot;c&quot;&gt;/* Rotate the axis */&lt;/span&gt;
            &lt;span class=&quot;nt&quot;&gt;translate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;circle-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Move the item from the center */&lt;/span&gt; 
            &lt;span class=&quot;nt&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;     &lt;span class=&quot;c&quot;&gt;/* Rotate the item back to its default position */&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rot&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rot&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;angle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Increments the $rot variable for next item */&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Outputs (with 8 items and a 24em large container)...&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-of-type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;n&quot;&gt;translate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-0&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;   &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-of-type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;45&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;translate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-45&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-of-type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;90&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;translate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-90&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-of-type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;135&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;translate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-135&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-of-type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;translate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-180&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-of-type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;225&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;translate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-225&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-of-type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;270&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;translate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-270&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-of-type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;8&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;315&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;translate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;12em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-315&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;legacy-browsers&quot;&gt;&lt;/p&gt;

&lt;h2&gt;What about old browsers? &lt;a href=&quot;#legacy-browsers&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;The main problem with this technic is that &lt;strong&gt;IE8- doesn't support pseudo-selectors and CSS transforms&lt;/strong&gt;.&lt;/p&gt;


&lt;p&gt;The first thing is easily fixed either with a plugin like &lt;a href=&quot;http://selectivizr.com/&quot;&gt;Selectivizr&lt;/a&gt; to enable support for pseudo-selectors on old browsers or a little bit of JavaScript to add a numbered class to each child of the parent. Here is how I did it (with jQuery):&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;.parent&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;children&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;each&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addClass&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;item&amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;index&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Then, the CSS would be slightly altered:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@for&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;nb-items&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;o&quot;&gt;&amp;amp;.&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;/* ... */&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;First problem solved. Not let's deal with the biggest one: IE8- doesn't support CSS transforms. Hopefully, we can draw a fallback that will make everything cool on these browsers as well using margin.&lt;/p&gt;


&lt;p&gt;Basically, instead of rotating, translating then rotating back each element, we apply it top and left margins (sometimes negative) to place it on the circle. Fasten your belt folks, the calculations are pretty insane:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;margin-top&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rot&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;pi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;half-parent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;half-item&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;cos&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rot&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;pi&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;half-parent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;half-item&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;margin-top&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Yes, it's definitely not the easiest way to do it as it involves some complicated calculations (thanks Ana for the formulas), but it works like a charm!&lt;/p&gt;


&lt;p&gt;Now how do we use all this stuff for IE8- without messing with modern browser stuff? I found that the easiest solution is to add a flag to the mixin: if it's turned on, then it means we need to support old IE, thus we use classes and margins. Else, we use transforms and pseudo-selectors. Consider the following structure:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;putOnCircle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;nb-items&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;circle-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;item-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;class-for-IE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;/* ... */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;@for&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;nb-items&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        
        &lt;span class=&quot;c&quot;&gt;/* If we don&amp;#39;t plan on supporting old IE */&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;@if&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;class-for-IE&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;false&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-of-type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;c&quot;&gt;/* Use transforms */&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

        &lt;span class=&quot;c&quot;&gt;/* If we plan on supporting old IE */&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;@else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;&amp;amp;.&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;c&quot;&gt;/* Use margins */&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Et voila! We now have a mixin working back to IE7 (maybe even 6) thanks to very little JavaScript. Isn't that nice?&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;That's all folks! If you have any suggestion to improve it, please be sure to share! Meanwhile, you can play with my &lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/Bigqr&quot;&gt;demo&lt;/a&gt; on CodePen.&lt;/p&gt;


&lt;pre class=&quot;codepen&quot; data-height=&quot;550&quot; data-type=&quot;result&quot; data-href=&quot;Bigqr&quot; data-user=&quot;HugoGiraudel&quot; data-safe=&quot;true&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/Bigqr&quot;&gt;Check out this Pen!&lt;/a&gt;&lt;/pre&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 02 Apr 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/04/02/items-on-circle/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/04/02/items-on-circle/</guid>
			</item>
			
		
			
			<item>
				<title>8 Compass extensions you may not know</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://compass-style.org/&quot;&gt;Compass&lt;/a&gt; is a CSS authoring framework dedicated to &lt;a href=&quot;http://sass-lang.com/&quot;&gt;Sass&lt;/a&gt;. Not only is it insanely powerful, but it also includes a large range of built-in functions and mixins, easing daily tasks.&lt;/p&gt;


&lt;p&gt;It occurred to me there was a couple of Compass features which remain pretty much unknown to most users so I thought it could be a good idea to write a short blog post about them.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;opposite-position&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Opposite-position() &lt;a href=&quot;#opposite-position&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Compass defines 5 CSS &lt;a href=&quot;http://compass-style.org/reference/compass/helpers/constants/&quot;&gt;constants&lt;/a&gt;: &lt;code&gt;top&lt;/code&gt;, &lt;code&gt;right&lt;/code&gt;, &lt;code&gt;bottom&lt;/code&gt;, &lt;code&gt;left&lt;/code&gt; and &lt;code&gt;center&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;The point of these inalterable variables is to use the &lt;code&gt;opposite-position()&lt;/code&gt; function which returns the opposite value for each constant. Please consider the following example:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;opposite&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;opposite-position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Outputs &amp;quot;right&amp;quot; */&lt;/span&gt;

&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;top&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;opposite&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;opposite-position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Outputs &amp;quot;bottom left&amp;quot; */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p class=&quot;note&quot;&gt;Note: the opposite of &lt;code&gt;center&lt;/code&gt; is &lt;code&gt;center&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;I personally used this extension in this very site, when it comes to images and quotes pulling (&lt;a href=&quot;https://github.com/HugoGiraudel/hugogiraudel.github.com/blob/master/sass/_helpers.scss#L32&quot;&gt;L32&lt;/a&gt; and &lt;a href=&quot;https://github.com/HugoGiraudel/hugogiraudel.github.com/blob/master/sass/_helpers.scss#L47&quot;&gt;L47&lt;/a&gt;).&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;pull-quote&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;opposite&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;opposite-position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;nt&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;opposite&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;  
    &lt;span class=&quot;nt&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.5em&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;margin-&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;opposite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;border-&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;opposite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;6px&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;hotpink&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;padding-&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;opposite&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;So &lt;code&gt;$opposite&lt;/code&gt; equals &lt;em&gt;right&lt;/em&gt; when &lt;code&gt;$direction&lt;/code&gt; is &lt;em&gt;left&lt;/em&gt; and vice versa. Allows me to make only one mixin instead of 2!&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;display-helpers&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Elements-of-type() &lt;a href=&quot;#display-helpers&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;&lt;a href=&quot;http://compass-style.org/reference/compass/helpers/display/&quot;&gt;Element-of-type()&lt;/a&gt; is a built-in function to detect the display type of an element: &lt;code&gt;block&lt;/code&gt;, &lt;code&gt;inline&lt;/code&gt;, &lt;code&gt;inline-block&lt;/code&gt;, &lt;code&gt;table&lt;/code&gt;, &lt;code&gt;table-row-group&lt;/code&gt;, &lt;code&gt;table-header-group&lt;/code&gt;, &lt;code&gt;table-footer-group&lt;/code&gt;, &lt;code&gt;table-row&lt;/code&gt;, &lt;code&gt;table-cell&lt;/code&gt;, &lt;code&gt;list-item&lt;/code&gt; and -as odd as it may look- &lt;code&gt;html5&lt;/code&gt;, &lt;code&gt;html5-inline&lt;/code&gt; and &lt;code&gt;html5-block&lt;/code&gt;.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: &lt;code&gt;html5&lt;/code&gt;, &lt;code&gt;html5-inline&lt;/code&gt; and &lt;code&gt;html5-block&lt;/code&gt; are not real display values; they are just keywords to gather all html5 elements (inline, block or both).&lt;/p&gt;


&lt;p&gt;This may be useful as part of a CSS reset for example:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;reset-html5&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;elements&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;of&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;html5&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;This snippet forces all HTML5 elements to be displayed as block-elements, even by unsupported browsers.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;experimental&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Experimental() &lt;a href=&quot;#experimental&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;&lt;a href=&quot;http://compass-style.org/reference/compass/css3/shared/&quot;&gt;Experimental()&lt;/a&gt; has to be one of the most used function in Compass and probably one of the less known at the same time.&lt;/p&gt;


&lt;p&gt;Basically, &lt;code&gt;experimental()&lt;/code&gt; allows you to define mixins outputing content depending on enabled vendor prefixes. It is used in &lt;strong&gt;all&lt;/strong&gt; CSS3 built-in mixins. When you use &lt;code&gt;@include box-sizing(border-box)&lt;/code&gt;, here is what happen:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;box-sizing&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;unquote&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;@include&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;experimental&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;box-sizing&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;bs&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-moz&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-webkit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ms&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-khtml&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;official&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;This outputs:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;webkit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sizing&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
       &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;moz&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sizing&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sizing&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;&lt;code&gt;-o-&lt;/code&gt;, &lt;code&gt;-ms-&lt;/code&gt; (and &lt;code&gt;-khtml-&lt;/code&gt;) are omitted because the &lt;code&gt;box-sizing()&lt;/code&gt; mixin calls &lt;code&gt;experimental()&lt;/code&gt; by specifically specifying not to output lines for Opera and Internet Explorer.&lt;/p&gt;


&lt;p&gt;Now what's the point of such a tool? As an example, there is no default mixin for CSS animation in Compass. Let's make one!&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;@include&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;experimental&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-webkit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-moz&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;not&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-ms&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;official&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3s&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ease&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;This outputs:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;webkit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3s&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ease&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
       &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;moz&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3s&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ease&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3s&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ease&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;hacks&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Hacks &lt;a href=&quot;#hacks&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Hum, &lt;a href=&quot;http://compass-style.org/reference/compass/utilities/general/hacks/&quot;&gt;hacks&lt;/a&gt;. I know what you think: &lt;em&gt;NOOOOOO!&lt;/em&gt;. Anyway, Compass provides a couple of features to take advantage of Internet Explorer inconsistencies and weaknesses.&lt;/p&gt;


&lt;p&gt;You may have already heard of &lt;code&gt;has-layout&lt;/code&gt;. &lt;a href=&quot;http://www.satzansatz.de/cssd/onhavinglayout.html&quot;&gt;This article&lt;/a&gt; explains it way better than I could:&lt;/p&gt;


&lt;blockquote class=&quot;quote&quot;&gt;&lt;p&gt;“Layout” is an IE/Win proprietary concept that determines how elements draw and bound their content, interact with and relate to other elements, and react on and transmit application/user events.&lt;/p&gt;
&lt;p&gt;This quality can be irreversibly triggered by some CSS properties. Some HTML elements have “layout” by default.&lt;/p&gt;
&lt;p&gt;Microsoft developers decided that elements should be able to acquire a “property” (in an object-oriented programming sense) they referred to as hasLayout, which is set to true when this rendering concept takes effect.&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Back to our business: Compass gives two ways to trigger &lt;code&gt;hasLayout&lt;/code&gt; on elements: with &lt;code&gt;zoom&lt;/code&gt; (using the &lt;code&gt;zoom&lt;/code&gt; MS proprietary property) or with &lt;code&gt;block&lt;/code&gt; (using the &lt;code&gt;display&lt;/code&gt; property). I'd go with the zoom, even if it doesn't validate mostly because I'm used to.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.element1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;has&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;zoom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.element2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;has&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;layout&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Outputs...&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.element1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;zoom&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.element2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.element2&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;

&lt;p&gt;You now understand why I use the zoom approach. Otherwise, Compass also provides another way to target IE6 specifically called the bang hack. It relies on the inability for IE6 to understand the &lt;code&gt;!important&lt;/code&gt; flag:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.element1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;bang&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hack&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Outputs...&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.element1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;red&lt;/span&gt; &lt;span class=&quot;cp&quot;&gt;!important&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Since IE6 doesn't understand &lt;code&gt;!important&lt;/code&gt;, it will apply the later declaratation while other browsers will follow the hammer bash flaged rule.&lt;/p&gt;


&lt;p&gt;&lt;section id=&quot;image-dimensions&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Image dimensions &lt;a href=&quot;#image-dimensions&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Compass gives you a way to know the &lt;a href=&quot;http://compass-style.org/reference/compass/helpers/image-dimensions/&quot;&gt;dimensions of an image&lt;/a&gt; (given as a path) with 2 functions: &lt;code&gt;image-width()&lt;/code&gt; and &lt;code&gt;image-height()&lt;/code&gt;.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;my-awesome-background.jpg&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url($image)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;n&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;In this example, the element will have a size relative to the background-image it uses.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: beware, the path has to be relative to your project's image directory, defined in your &lt;code&gt;config.rb&lt;/code&gt; file.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;math-functions&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Math functions &lt;a href=&quot;#math-functions&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;If you're like a total nerd and want to do CSS with math, then you'll be pleased to know Compass has a bunch of built-in &lt;a href=&quot;http://compass-style.org/reference/compass/helpers/math/&quot;&gt;math functions&lt;/a&gt; like &lt;code&gt;sin()&lt;/code&gt;, &lt;code&gt;cos()&lt;/code&gt;, &lt;code&gt;pi()&lt;/code&gt; among a few others.&lt;/p&gt;


&lt;p&gt;I once had to use &lt;code&gt;sin()&lt;/code&gt; in order to make a &lt;a href=&quot;http://hugogiraudel.com/2013/02/18/sass-mixin-star/&quot;&gt;mixin for a pure CSS 6-points star&lt;/a&gt; but that's pretty much it. If you happen to have a real live use case for one of those functions, I'd be more than pleased to know more about it.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;pow&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;nt&quot;&gt;pow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Returns 16 */&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;sqrt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;sqrt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Returns 2  */&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;selectors&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Selector helpers &lt;a href=&quot;#selectors&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Compass provides some &lt;a href=&quot;http://compass-style.org/reference/compass/helpers/selectors/&quot;&gt;features&lt;/a&gt; to play with selectors like &lt;code&gt;nest()&lt;/code&gt;, &lt;code&gt;append-selector()&lt;/code&gt; or &lt;code&gt;headings()&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Once again, I am not sure if there are a bunch of real life use cases for such functions. Let me show you with a demo, maybe you'll be able to find a use case:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;c&quot;&gt;/* nest() */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;nest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;.class1&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;.class2&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;          
&lt;span class=&quot;c&quot;&gt;/* Outputs &amp;quot;.class1.class2&amp;quot; */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;nest&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;.class1, .class2&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;.class3&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; 
&lt;span class=&quot;c&quot;&gt;/* Outputs &amp;quot;.class1.class3 .class2.class3&amp;quot; */&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;/* append-selector */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;append-selector&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;.class1&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;.class2&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; 
&lt;span class=&quot;c&quot;&gt;/* Outputs &amp;quot;.class1.class2&amp;quot; */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;append-selector&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;a, p, li&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;.class&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; 
&lt;span class=&quot;c&quot;&gt;/* Outputs &amp;quot;a.class, p.class, li.class&amp;quot; */&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;/* headings() */&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;headings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;My Awesome Font&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;c&quot;&gt;/* Set font-family to all headings */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;headings&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;c&quot;&gt;/* Set font-weight to h1, h2, h3 */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;text-replacement&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Image-replacement functions &lt;a href=&quot;#text-replacement&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Compass provides several resources to ease a daily task: &lt;a href=&quot;http://compass-style.org/reference/compass/typography/text/replacement/&quot;&gt;image replacement&lt;/a&gt;. When you have an element with text content, but you want the text to disappear to see the background image instead.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;hide&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Outputs...&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;text-indent&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;110&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;white-space&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;nowrap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;hidden&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p class=&quot;note&quot;&gt;The &lt;code&gt;hide-text()&lt;/code&gt; mixin takes a direction as a parameter. The default one is &lt;code&gt;left&lt;/code&gt;, resulting in a &lt;code&gt;text-indent: -199988px&lt;/code&gt; with a &lt;code&gt;16px&lt;/code&gt; baseline. You definitely should use &lt;code&gt;right&lt;/code&gt; for better performance.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;So guys, how many of these features did you know? If you have some free time, I highly recommand you to dig into &lt;a href=&quot;http://compass-style.org/reference/compass/&quot;&gt;Compass documentation&lt;/a&gt;. You'd be surprised how little you know about the framework in most cases.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 25 Mar 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/03/25/compass-extensions/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/03/25/compass-extensions/</guid>
			</item>
			
		
			
			<item>
				<title>The ultimate PX/REM mixin</title>
				<description>&lt;p&gt;&lt;section id=&quot;rem&quot;&gt;&lt;/p&gt;

&lt;h2&gt;About REM &lt;a href=&quot;#rem&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Everybody loves relative units. They are handy and help us solve daily problems. However the most used one (&lt;code&gt;em&lt;/code&gt;) presents some issues, especially when it comes to nesting. &lt;/p&gt;


&lt;p&gt;As an example, setting both &lt;code&gt;p&lt;/code&gt; and &lt;code&gt;li&lt;/code&gt; tags font-size to &lt;code&gt;1.2em&lt;/code&gt; may seem fine. But if you ever happen to have a paragraph inside a list item, it would result in a font-size 1.44 times (1.2 * 1.2) bigger than parent font-size, and not 1.2 as wished.&lt;/p&gt;


&lt;p&gt;To avoid this, a new unit has been created: &lt;a href=&quot;http://snook.ca/archives/html_and_css/font-size-with-rem&quot;&gt;&lt;code&gt;rem&lt;/code&gt;&lt;/a&gt;. It stands for &lt;em&gt;root em&lt;/em&gt;. Basically, instead of being relative to the font-size of its direct parent, it's relative to the font-size defined for the &lt;code&gt;html&lt;/code&gt; element.&lt;/p&gt;


&lt;p&gt;You may have already seen something like this in frameworks, demo, blog posts and such:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;html&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;62&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Because all browsers have a default font-size of &lt;code&gt;16px&lt;/code&gt;, setting the font-size to 62.5% on the html element gives it a font-size of 10px (10 / 16 * 100 = 62.5) without explicitely setting it to &lt;code&gt;10px&lt;/code&gt; which would prevent zooming. Then, setting a font-size of 1.6rem on the body element simply results in a font-size of &lt;code&gt;16px&lt;/code&gt;, cascading through the whole DOM tree.&lt;/p&gt;


&lt;p&gt;Then, if I want an element to have like a &lt;code&gt;28px&lt;/code&gt; font-size, I simply have to do &lt;code&gt;.element { font-size: 2.8rem; }&lt;/code&gt;, no matter the size of its parent.&lt;/p&gt;


&lt;p&gt;Everything is great, however &lt;a href=&quot;http://caniuse.com/#feat=rem&quot;&gt;rem isn't supported in all browsers&lt;/a&gt;, especially not in Internet Explorer 8, which is still required in most projects. It means we have to &lt;strong&gt;give a fallback&lt;/strong&gt; for this browser.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;mixin&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Mixin to the rescue! &lt;a href=&quot;#mixin&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Having to define twice the font-size property everytime you have to set the size of a text element sucks. This is the moment you'd like to have a wonderful mixin handling everything for you. Well, &lt;strong&gt;WISH GRANTED!&lt;/strong&gt;&lt;/p&gt;


&lt;h3&gt;About the mixin&lt;/h3&gt;


&lt;p&gt;There are already many mixins handling &lt;code&gt;px&lt;/code&gt; fallback for &lt;code&gt;rem&lt;/code&gt; usage, most of them do it very well. However this one pushes things a step further. It is inspired by &lt;a href=&quot;https://github.com/drublic/Sass-Mixins/blob/master/rem.scss&quot;&gt;this rem mixin&lt;/a&gt; by &lt;a href=&quot;https://twitter.com/drublic&quot;&gt;Hans Christian Reinl&lt;/a&gt;, revamped by myself to make it even more awesome. Here are the features:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Accepts either &lt;code&gt;px&lt;/code&gt; or &lt;code&gt;rem&lt;/code&gt; as an input value&lt;/li&gt;
&lt;li&gt;Accepts (almost) any property as an input, not only font-size&lt;/li&gt;
&lt;li&gt;Accepts multiple values, like &lt;code&gt;10px 20px&lt;/code&gt; (for padding or margin as an example)&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Let's open the beast&lt;/h3&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;html&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;62&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* 1 */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@function&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;parseInt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* 2 */&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;@return&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;n&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;values&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* 3 */&lt;/span&gt;
  &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* 3 */&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;@each&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;values&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* 4 */&lt;/span&gt;
   
    &lt;span class=&quot;k&quot;&gt;@if&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;or&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;auto&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* 5 */&lt;/span&gt;
      &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    
    &lt;span class=&quot;k&quot;&gt;@else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
      &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;    &lt;span class=&quot;c&quot;&gt;/* 6 */&lt;/span&gt;
      &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;parseInt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* 6 */&lt;/span&gt;
      
      &lt;span class=&quot;k&quot;&gt;@if&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;unit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;px&amp;quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;/* 7 */&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
      
      &lt;span class=&quot;k&quot;&gt;@if&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;unit&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;rem&amp;quot;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* 7 */&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;));&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
      &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;@if&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;     &lt;span class=&quot;c&quot;&gt;/* 8 */&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;/* 9 */&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;c&quot;&gt;/* 9 */&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* 9 */&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;This may be a bit rough so let me explain it:&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;The mixin relies on a baseline of &lt;code&gt;10px&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;The mixin relies on a function to parse the integer from a value with a unit&lt;/li&gt;
&lt;li&gt;We define a list of values for both units&lt;/li&gt;
&lt;li&gt;We iterate through each value in the given parameter &lt;code&gt;$values&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;If the value is either &lt;code&gt;auto&lt;/code&gt; or &lt;code&gt;0&lt;/code&gt;, we append it to the list as-is&lt;/li&gt;
&lt;li&gt;If the value has a unit, we split it to get both the unit and the raw value&lt;/li&gt;
&lt;li&gt;We append according values to the lists depending on the unit of the given value&lt;/li&gt;
&lt;li&gt;If the two lists are the same, we ouput only one (like &lt;code&gt;margin-top: 0&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;We output the result&lt;/li&gt;
&lt;/ol&gt;


&lt;p class=&quot;note&quot;&gt;Thanks to &lt;a href=&quot;http://twitter.com/movingprimates&quot;&gt;Moving Primates&lt;/a&gt; to improve the mixin by adding step 8. ;)&lt;/p&gt;


&lt;h3&gt;Usage&lt;/h3&gt;


&lt;p&gt;Using it is pretty straightforward:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;html&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;62&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;... outputs:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;html&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;62&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;    &lt;span class=&quot;c&quot;&gt;/* Fallback for IE8 */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Fallback for IE8 */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rem&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;h3&gt;Remaining issues&lt;/h3&gt;


&lt;p&gt;There are still some issues with this mixin:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Doesn't work with all properties (border shorthand among others)&lt;/li&gt;
&lt;li&gt;Doesn't fallback if you input a wrong value (wrong unit or unitless value as an example)&lt;/li&gt;
&lt;li&gt;Relies on a defined baseline; however this is easily fixed by adding a &lt;code&gt;$baseline&lt;/code&gt; parameter to the mixin&lt;/li&gt;
&lt;li&gt;Relies on a &lt;code&gt;parseInt()&lt;/code&gt; function; I've proposed it to Compass, let's hope they add it anytime soon&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;If you ever happen to find a decent solution to fix one, I'll be glad to know and add it!&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;That's pretty much it folks. I'd be glad to hear your opinion on this and improve it with your ideas. :)&lt;/p&gt;


&lt;p&gt;If you want a playground to test and hack, please feel free to fork &lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/xsKdH&quot;&gt;my pen&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 18 Mar 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/03/18/ultimate-rem-mixin/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/03/18/ultimate-rem-mixin/</guid>
			</item>
			
		
			
			<item>
				<title>Can I afford a preprocessor?</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt;I just want to share my thoughts on the topic. I won't try to convince you to use a preprocessor. So please, don't tell me how good you are without one; I trust you. I'm a developer too.&lt;/p&gt;


&lt;p&gt;A couple of days ago, the famous french front-end developer &lt;a href=&quot;https://twitter.com/iamvdo&quot;&gt;Vincent De Oliveira&lt;/a&gt; has written a blog post called &lt;a href=&quot;http://blog.iamvdo.me/post/45259636008/pourquoi-je-nutilise-pas-les-preprocesseurs-css&quot;&gt;Why I don't use CSS preprocessors&lt;/a&gt; (&quot;Pourquoi je n'utilise pas les préprocesseurs CSS&quot;). If you can read French, or stand &lt;a href=&quot;http://translate.google.fr/translate?sl=fr&amp;tl=en&amp;js=n&amp;prev=_t&amp;hl=fr&amp;ie=UTF-8&amp;eotf=1&amp;u=http%3A%2F%2Fblog.iamvdo.me%2Fpost%2F45259636008%2Fpourquoi-je-nutilise-pas-les-preprocesseurs-css&quot;&gt;Google Translate&lt;/a&gt;, then I highly recommand you this article, full of good points and interesting opinions.&lt;/p&gt;


&lt;p&gt;Please don't consider this post as an answer to Vincent's one. I just wanted to &lt;strong&gt;share my opinion on the topic&lt;/strong&gt;, not open a flame war. Especially since I like this guy. :)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;tldr&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Tl;dr &lt;a href=&quot;#tldr&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;There is no point debating about whether preprocessors are good or evil: they are good. If you think they are evil, it's either because you're afraid of them, or because you suck at them. The question isn't even which one to choose: they all do pretty much the same things (even if Sass is slightly more robust than others). The main topic is: &lt;strong&gt;should or shouldn't you use one&lt;/strong&gt;?&lt;/p&gt;


&lt;p&gt;There are cases where you don't want to use a preprocessor (whatever the language). The main case is when your team involves some beginners or inexperienced developers: if they are not very comfortable with the language, it will be even worse with a preprocessor.&lt;/p&gt;


&lt;p&gt;The other case is when you are dealing with very small projects or one-shot websites, meaning you don't plan on updating often. Then, a preprocessor isn't that useful.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;/section&gt;
&lt;section id=&quot;quality-code&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Quality code &lt;a href=&quot;#quality-code&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Let's make things clear right now: &lt;strong&gt;preprocessors don't output bad code, bad developers do&lt;/strong&gt;. CSS preprocessors -whatever the one you (don't) use- do not generate top-heavy, unwiedly, unnecessarily complicated code. This is a lie bad developers will tell you to explain the quality of their code.&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;Preprocessors don't output bad code, bad developers do.&lt;/blockquote&gt;


&lt;p&gt;If the final stylesheet is less maintainable or heavier, or more complicated than the vanilla CSS version you had before using a preprocessor, &lt;a href=&quot;http://pastebin.com/Jy9PqFTy&quot;&gt;it's because you messed up&lt;/a&gt;. Not because of Sass.&lt;/p&gt;


&lt;p&gt;Vincent does an interesting comparison with PHP (HyperText Preprocessor): you can output shitty code with PHP too. Is it because of PHP? Definitely not. It's because you've messed up.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;speed&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Speed &lt;a href=&quot;#speed&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Some people say preprocessors don't make you write CSS faster. Indeed, you won't become Iron Man as soon as you run Sass, definitely not. Even if in the end, you write code slightly faster; simply by the fact you don't have to write vendor prefixes for example.&lt;/p&gt;


&lt;p&gt;You don't save much time while coding. You save time when it comes to maintain and update your stylesheets. It's a no brainer. This also means if you don't plan on updating your site, then there is less point in using a preprocessor. This makes me come to the next argument.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;maintainability&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Maintainability &lt;a href=&quot;#maintainability&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I think the key word here is &lt;strong&gt;maintainability&lt;/strong&gt;. You will never ever reach the same level of maintainability without a CSS preprocessor. Ever.&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;I think the key word here is maintainability.&lt;/blockquote&gt;


&lt;p&gt;However, you might not need that level of maintainability. As &lt;a href=&quot;https://twitter.com/kaelig&quot;&gt;Kaelig&lt;/a&gt; says in his article &lt;a href=&quot;http://blog.kaelig.fr/post/24877648508/preprocesseurs-css-renoncer-par-choix-ou-par&quot;&gt;CSS preprocessors: renounce by choice or ignorance?&lt;/a&gt; (&quot;Préprocesseurs CSS, renoncer par choix ou par ignorance?&quot;): if you work on small projects or one-shot websites, you may not need a preprocessor. Let's be realistic for a minute: you won't update the site everyday, if at all. If you ever happen to do so, you can dig into the code without having to use of a preprocessor.&lt;/p&gt;


&lt;p&gt;
&lt;/section&gt;
&lt;section id=&quot;needs&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Give CSS what CSS needs &lt;a href=&quot;#needs&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Vincent says preprocessors don't add anything to the default language. In a sense, yes. Sass isn't magic. CoffeeScript isn't magic. Markdown isn't magic. In the end, they render CSS, JS and HTML.&lt;/p&gt;


&lt;p&gt;But CSS preprocessors give CSS what CSS lacks of. CSS lacks of variables, above all. CSS possibly lacks of simple nesting for pseudo-classes. CSS might lack of functions and mixins. Preprocessors give developers all this stuff. &lt;strong&gt;Without altering performances&lt;/strong&gt;.&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;CSS lacks of variables, above all.&lt;/blockquote&gt;


&lt;p&gt;&lt;strong&gt;Yes, we can do sites without these features.&lt;/strong&gt; It's just nice to have them. Saying otherwise would be a big fat lie. But of course we can still make sites without preprocessors.&lt;/p&gt;


&lt;p&gt;In fact, &lt;strong&gt;I don't need a preprocessor&lt;/strong&gt;. I say it: I don't. I'm not working on 10000-lines stylesheets. I'm not working on multiple templates websites. I'm not working on complex CSS architectures. I could do every single project I do without Sass.&lt;/p&gt;


&lt;p&gt;But &lt;strong&gt;Sass looks better than CSS to me&lt;/strong&gt; (at least in most cases). I like being able to use variables. I like being able to use mixins and functions. I like being able to use Compass. I like all of this stuff, even if I don't necessarily need it. It feels more normal to me.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Sass also gives multiple stylesheets concatenation and file minification (among others), which is kind out of the CSS range but still awesome features nevertheless.&lt;/p&gt;


&lt;p&gt;&lt;section id=&quot;learning-curve&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Learning curve &lt;a href=&quot;#learning-curve&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;blockquote class=&quot;quote&quot;&gt;&lt;p&gt;Preprocessors make CSS more complex. [...] I said more &quot;complex&quot; not more &quot;complicated&quot;. You can think preprocessor's syntax is simple, it is still more complex than the default one.&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;Vincent is definitely right on this one. Preprocessors sometimes make the syntax more complex by adding new features; not necessarily more complicated, simply more complex (no pun intended).&lt;/p&gt;


&lt;p&gt;One of the biggest concerns when talking about CSS preprocessors (and preprocessors in general) is the learning curve. Most try to stay as close as possible to the default syntax but they involve new features with their own syntax, which need to be learnt. Yes, &lt;strong&gt;it needs some time to wrap one's head around a preprocessor&lt;/strong&gt;, especially if it involves a very different syntax from the original language (Sass, CoffeeScript).&lt;/p&gt;


&lt;p&gt;If you happen to be a beginner or work with inexperienced developers, you probably shouldn't use preprocessors. Someone who's not very comfortable with a language could do &lt;a href=&quot;http://pastebin.com/Jy9PqFTy&quot;&gt;pretty bad things&lt;/a&gt; with a preprocessor. Adapt your tools to your team.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;In the end, most arguments against preprocessors are bullshit. All those things about not speeding up the development, outputing bad code, it's irrelevant. Most people telling you this are the one who have not even tried to use a preprocessor for real.&lt;/p&gt;


&lt;p&gt;The only thing to ask is: &lt;strong&gt;can I afford one?&lt;/strong&gt; If you think you or one of your co-workers won't be able to handle everything correctly, then the answer is &lt;em&gt;no&lt;/em&gt;. Otherwise just please yourself and go ahead. :)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 14 Mar 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/03/14/css-preprocessors/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/03/14/css-preprocessors/</guid>
			</item>
			
		
			
			<item>
				<title>Interview with Manoela Ilic</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p class=&quot;explanation&quot;&gt;The wonderful &lt;a href=&quot;https://twitter.com/crnacura&quot;&gt;Manoela Ilic&lt;/a&gt; also known as Mary Lou, co-founder of &lt;a href=&quot;http://tympanus.net/codrops/&quot;&gt;Codrops&lt;/a&gt; has accepted to answer a few questions. Below is her interview. Enjoy!&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;introduction&quot;&gt;
&lt;img class=&quot;pull-image--left&quot; src=&quot;/images/interview-manoela-ilic__manoela.jpg&quot; alt=&quot;Photo Manoela Ilic&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt;You are kind of a mysterious person. Maybe could you introduce yourself? &lt;a href=&quot;#introduction&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I'm Manoela, a 31 year old web designer and developer and I create things for &lt;a href=&quot;http://tympanus.net/codrops/&quot;&gt;Codrops&lt;/a&gt; since 2009. I studied Cognitive Science in Germany and then Computational Logic in Portugal.&lt;/p&gt;


&lt;p&gt;I worked in a software company for a while before I decided to become a freelancer and launch Codrops. Since I was a kid I was always fascinated with computers and I created my first website when I was 16 (it had some fancy Flash buttons, I remember) :)&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;I created my first website when I was 16.&lt;/blockquote&gt;


&lt;p&gt;In my personal life I like to travel a lot (in fact, most of the time I am travelling). I love to eat and make good food, drink a great wine and take care of my balcony herb garden whenever I have some spare time.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;codrops&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt;Could you tell us a little bit more about Codrops? Where did the idea came from and what do you do for it? &lt;a href=&quot;#codrops&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;&lt;img class=&quot;pull-image--left&quot; src=&quot;/images/interview-manoela-ilic__codrops.png&quot; alt=&quot;Codrops logo&quot; /&gt;&lt;/p&gt;

&lt;p&gt;I set up a WordPress blog in late 2009 thinking that I could share some useful snippets with fellow developers. I was doing some beginner mobile web development back then and I just wanted to share what I learnt and what I thought could be helpful. Snippets turned into tutorials over time and now Codrops turned into an almost full-time job :)  &lt;/p&gt;


&lt;p&gt;What I do is to plan, design, implement and write tutorials together with my partner &lt;a href=&quot;https://twitter.com/o_telho&quot;&gt;Pedro&lt;/a&gt;. I also manage the blog and review articles by our writers.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;why-wordpress&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt;Why did you choose to land on Wordpress? Who did the development (CSS, scripts and stuff)? &lt;a href=&quot;#why-wordpress&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;WordPress seemed like the most fitting blog engine at the time and I've been happy with it ever since. I love the community around it. 
All the development and implementation was done by me and Pedro.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;biggest-challenge&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt;What is the biggest challenge at Codrops? &lt;a href=&quot;#biggest-challenge&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I guess the most challenging but also most exciting part is to come up with interesting and original ideas and concepts that are somehow inspiring and helpful to web designers and developers. At Codrops we try to provide ideas and new perspectives that serve as a source of inspiration. So we always create a story for what we want to show and setting up that story is the most delicate part. &lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;change-something&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt;Sounds lovely. If you could go back and change something at Codrops, what would it be? &lt;a href=&quot;#change-something&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;If you are happy with what you've learned, it was a good path to choose.&lt;/blockquote&gt;


&lt;p&gt;There are always things that could be done better when looking back. But in general I am quite happy with how Codrops turned out thanks to our readers and I wouldn't want to change anything about that I guess. It's just like with everything else in life: if you wouldn't have done it that exact way, you might have not learned what you know now. And if you are happy with what you've learned, it probably was a good path to choose. &lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;future-of-codrops&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt;What do you plan for the future of Codrops? &lt;a href=&quot;#future-of-codrops&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;There are many things that we want to add to and improve at Codrops. We are currently working on some new sections that we want to release this year. And we are of course planning to do more tutorials and provide more articles that will be interesting and useful to our readers.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;data&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt;Could you share a few datas about the site maybe? Traffic, authors, anything surprising? &lt;a href=&quot;#data&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;We currently have about &lt;strong&gt;850.000 unique visitor&lt;/strong&gt; and &lt;strong&gt;9.5 million pageviews&lt;/strong&gt; every month. Our readers spend an average of &lt;strong&gt;4.25 minutes&lt;/strong&gt; on Codrops and they view about &lt;strong&gt;6 pages per visit&lt;/strong&gt;. Almost half of them are from the United States. We have &lt;strong&gt;512 published posts&lt;/strong&gt; and more than &lt;strong&gt;20.000 comments&lt;/strong&gt;. In total, we have &lt;strong&gt;45 authors&lt;/strong&gt;, most of whom were guest authors with a single contribution. &lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;best-codrops-article&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt;What is the most successful article on Codrops so far? Related to the number of views. &lt;a href=&quot;#best-codrops-article&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;The most successful article was &lt;a href=&quot;http://tympanus.net/codrops/2011/11/02/original-hover-effects-with-css3/&quot;&gt;Original Hover Effects&lt;/a&gt; by &lt;a href=&quot;https://twitter.com/Bluxart&quot;&gt;Alessio Atzeni&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure&quot;&gt;
&lt;a href=&quot;http://tympanus.net/codrops/2011/11/02/original-hover-effects-with-css3/&quot;&gt;&lt;img src=&quot;http://cdn2.tympanus.net/codrops/wp-content/uploads/2011/11/OriginalHoverEffects.jpg?84cd58&quot; alt=&quot;&quot;&gt;&lt;/a&gt;
&lt;figcaption&gt;Original Hover Effects on Codrops&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id=&quot;side-projects&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt;Do you have any side project? What would you like to do if you had enough time? &lt;a href=&quot;#side-projects&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Yes, I have some side projects that I'm working on and I also work for some clients. If I had more time I would definitely spend it all on answering our reader's questions and help them with their problems. &lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2 class=&quot;h4&quot;&gt;&lt;span class=&quot;fontawesome-comments icon-left&quot; style=&quot;color: #aaa&quot;&gt;&lt;/span&gt;Anything left you’d like to say? :) &lt;a href=&quot;#final-words&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I'd like to thank you for the opportunity and &lt;strong&gt;I'd like to thank all the readers of &lt;a href=&quot;http://tympanus.com/codrops/&quot;&gt;Codrops&lt;/a&gt;&lt;/strong&gt; for their support. I'd also like to wish you all the best for your website and blog and I'm looking forward to read many of your articles :)&lt;/p&gt;


&lt;p class='explanation'&gt;Well, thank you very much for your time Manoela! Wish you the best for both your work at Codrops and your personal life. Oh, and congratulations for being part of the &lt;a href=&quot;http://www.awwwards.com/jury/2013&quot;&gt;2013 Awwwards jury&lt;/a&gt;! :)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 11 Mar 2013 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2013/03/11/interview-manoela-ilic/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/03/11/interview-manoela-ilic/</guid>
			</item>
			
		
			
			<item>
				<title>We don't need your CSS grid</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;blockquote class=&quot;quote&quot;&gt;&lt;p&gt;You know what would be awesome? Another CSS grid system!&lt;/p&gt;
&amp;mdash; No one ever.&lt;/blockquote&gt;


&lt;p&gt;In this era of multi devices, responsive design, frameworks and all this stuff, CSS grids have become more and more popular. The main purpose of these tools is to define a baseline in order to have a consistent and predictable layout in all situations.&lt;/p&gt;


&lt;p&gt;This is a good idea, even an important one. Being consistent on all devices is a big deal, and CSS grids really help to figure this out.&lt;/p&gt;


&lt;p&gt;So in the last few months, we have assisted to a bunch of new CSS grid systems, including &lt;a href=&quot;http://twitter.github.com/bootstrap/&quot;&gt;Twitter Bootstrap Grid module&lt;/a&gt;, &lt;a href=&quot;http://foundation.zurb.com/&quot;&gt;Zurb Fundation&lt;/a&gt;, &lt;a href=&quot;http://960.gs/&quot;&gt;960.gs&lt;/a&gt;, &lt;a href=&quot;http://cssgrid.net/&quot;&gt;The 1140px Grid&lt;/a&gt;, &lt;a href=&quot;http://onepcssgrid.mattimling.com/&quot;&gt;One%&lt;/a&gt;, &lt;a href=&quot;http://www.blueprintcss.org/&quot;&gt;Blueprint&lt;/a&gt;, &lt;a href=&quot;http://www.knacss.com/&quot;&gt;KNACSS&lt;/a&gt;, &lt;a href=&quot;http://www.columnal.com/&quot;&gt;Columnal&lt;/a&gt;, &lt;a href=&quot;http://gridiculo.us/&quot;&gt;Gridiculous&lt;/a&gt;, &lt;a href=&quot;http://www.yaml.de/&quot;&gt;YAML&lt;/a&gt;, &lt;a href=&quot;http://piira.se/projects/ingrid/&quot;&gt;Ingrid&lt;/a&gt;, &lt;a href=&quot;http://titanthemes.com/titan-framework-a-css-framework-for-responsive-web-designs&quot;&gt;Titan&lt;/a&gt;, &lt;a href=&quot;http://goldengridsystem.com/&quot;&gt;Golden Grid System&lt;/a&gt;, &lt;a href=&quot;http://inuitcss.com/&quot;&gt;InuitCSS Grid module&lt;/a&gt;, &lt;a href=&quot;http://daneden.me/toast/&quot;&gt;Toast&lt;/a&gt; and I probably forget &lt;a href=&quot;http://usablica.github.com/front-end-frameworks/compare.html&quot;&gt;a bunch of those&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;They all are great grid systems&lt;/strong&gt;. This makes me get to the point...&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;we-dont-need-yours&quot;&gt;&lt;/p&gt;

&lt;h2&gt;We don't need yours &lt;a href=&quot;#we-dont-need-yours&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;We do not need your own CSS grid.&lt;/blockquote&gt;


&lt;p&gt;Sad but true. We do not need your CSS grid, framework or whatever you like to call it. There are already too much, some of them are built by professional, teams and CSS architects, which means they will always be better than yours.&lt;/p&gt;


&lt;p&gt;Now don't get me wrong: &lt;strong&gt;building your own is a good thing&lt;/strong&gt;. But people don't need it. Ask yourself this: between all the existing grids, including ones with hundreds of closed issues, why would I chose yours?&lt;/p&gt;


&lt;p&gt;Unless you're coming up with something **really** interesting and innovative like &lt;a href=&quot;http://twitter.com/trevor_davis&quot;&gt;Trevor Davis&lt;/a&gt; did with his &lt;a href=&quot;http://viget.com/inspire/who-says-the-web-is-just-for-squares&quot;&gt;Diamond Grid&lt;/a&gt;, or &lt;a href=&quot;http://twitter.com/csswizardry&quot;&gt;Harry Roberts&lt;/a&gt; with &lt;a href=&quot;http://csswizardry.com/2013/02/introducing-csswizardry-grids/&quot;&gt;CSSWizardry-Grids&lt;/a&gt;, there is no reason people should pick yours among all the others. Sorry.&lt;/p&gt;


&lt;p&gt;But wait... There's more.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;you-dont-need-yours-either&quot;&gt;&lt;/p&gt;

&lt;h2&gt;You don't need yours either &lt;a href=&quot;#you-dont-need-yours-either&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Yes. Even you, do not need your own grid system. At least in most cases. Let's think about it: either your project truely need a grid and you'd better go with an existing one which had proven to be reliable, or you project is small enough to not need one thus you don't even need your own.&lt;/p&gt;


&lt;p&gt;Given this postulate, we can ask ourself why are there that many grid systems? Because it's fun to do, especially when you're building it upon a CSS preprocessor. It is a very good exercise to practice CSS skills and preprocessor learning.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;kiss&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Keep It Simple, Stupid! &lt;a href=&quot;#kiss&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;You may be familiar with the &lt;abbr title=&quot;Keep It Simple, Stupid&quot;&gt;KISS&lt;/abbr&gt; principle which says things are generally better when they are simple. This works for CSS grids too.&lt;/p&gt;


&lt;p&gt;If you are working on a simple layout, even a responsive one, you'll find that you can do things by hand without much hassle. I was first using 1140px Grid on this site until I realized it weigh a few kilobytes for what could be done in about 6 or 7 lines of CSS.&lt;/p&gt;


&lt;p&gt;Once again, don't get me wrong. &lt;strong&gt;I don't say grids are bad, or shouldn't be used. I'm just warning you from using a grid when you don't need one.&lt;/strong&gt; It can do more harm than good sometimes.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;If you haven't read &lt;a href=&quot;http://css-tricks.com/dont-overthink-it-grids/&quot;&gt;this good article&lt;/a&gt; by Chris Coyier about not overthinking grids, then you definitely should.&lt;/p&gt;


&lt;p&gt;Just don't overthink grids. Unless you're building a fully fluid responsive 3+ columns layout, try doing your CSS architecture without loading thousand of bytes.&lt;/p&gt;


&lt;p&gt;Keep it simple.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 04 Mar 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/03/04/css-grids/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/03/04/css-grids/</guid>
			</item>
			
		
			
			<item>
				<title>Sassy Media Queries</title>
				<description>&lt;p&gt;&lt;section&gt;
Here is a quick blog post aiming at explaining how I turned a ~250-line CSS experiment by &lt;a href=&quot;http://arleym.com&quot;&gt;Arley McBlain&lt;/a&gt; into less than 30 sexy lines of Sass.&lt;/p&gt;

&lt;p&gt;First, let me remind you what Arley did in his experiment, topic of a &lt;a href=&quot;http://css-tricks.com/lark-queries/&quot;&gt;great article at CSS-tricks&lt;/a&gt;. His idea was to change some content according to the screen size.&lt;/p&gt;

&lt;p&gt;In order to do that, he used a pseudo-element and filled the &lt;code&gt;content&lt;/code&gt; property accordingly. With about &lt;strong&gt;160 media query calls&lt;/strong&gt;, he managed to change the content every 10px from 1920px to 300px (device width).&lt;/p&gt;

&lt;p&gt;Check it live on &lt;a href=&quot;http://arleym.com/&quot;&gt;his website home&lt;/a&gt; or at &lt;a href=&quot;http://css-tricks.com/examples/LarkQueries/&quot;&gt;CSS-tricks&lt;/a&gt;.
&lt;/section&gt;
&lt;section id=&quot;sassy&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Make it Sassy, make it easy &lt;a href=&quot;#sassy&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Let's be honest, it's an amazing idea, really. It works great, it looks great, the only downside is... it's a pain in the ass to code.&lt;/p&gt;

&lt;p&gt;This is where Sass &amp;mdash; or any CSS preprocessor really &amp;mdash; can be very efficient. &lt;strong&gt;It took me about 10 minutes to divide the amount of required code by 4.&lt;/strong&gt; Plus, it makes everything so much easier to adapt and maintain.&lt;/p&gt;

&lt;pre class=&quot;codepen&quot; data-height=&quot;300&quot; data-type=&quot;result&quot; data-href=&quot;kBzra&quot; data-user=&quot;HugoGiraudel&quot; data-safe=&quot;true&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/kBzra&quot;&gt;Check out this Pen!&lt;/a&gt;&lt;/pre&gt;


&lt;p&gt;If you simply want to see the code and don't care much about how I did it, please check &lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/kBzra&quot;&gt;this CodePen&lt;/a&gt; (&lt;a href=&quot;http://codepen.io/HugoGiraudel/full/kBzra&quot;&gt;fullsize here&lt;/a&gt;) and resize your browser like a fucking obsessive.&lt;/p&gt;

&lt;h3&gt;Create the list&lt;/h3&gt;

&lt;p&gt;Okay, this is no magic. I had to write all the words Arley used all over again. I guess I could write a little JavaScript that would have parsed Arley's stylesheet then making a list of it but it would have been ever more time consuming.&lt;/p&gt;

&lt;p&gt;So basically I created a Sass list containing all words ordered from the longest to the shortest. Hopefully, Arley already did this part of the job before me so I didn't have to do it again.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;words&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Unconventional&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Flabbergasting&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Scintillating&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Extraordinary&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Unforgettable&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Unpredictable&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Dumbfounding&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Electrifying&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Overwhelming&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Incomparable&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Entertaining&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Magnificient&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Confounding&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Resourceful&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Interesting&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Adventurous&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Bewildering&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Astonishing&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Fascinating&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Outstanding&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Influential&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Imaginative&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Nonsensical&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Stimulating&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Exceptional&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Resplendent&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Commanding&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Determined&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Remarkable&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Incredible&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Impressive&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Perplexing&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Passionate&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Formidable&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Stupefying&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Refreshing&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Delightful&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Incredible&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Innovative&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Monumemtal&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Surprising&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Stupendous&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Staggering&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Delectable&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Astounding&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Responsive&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Courageous&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Outlandish&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Marvelous&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Whimsical&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Versatile&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Motivated&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Brilliant&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Eccentric&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Wonderful&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Excellent&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Thrilling&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Inspiring&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Exquisite&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Inventive&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Colourful&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Delicious&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Fantastic&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Audacious&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Dexterous&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Different&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Confident&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Enthused&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Peculiar&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Glorious&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Smashing&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Splendid&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Adaptive&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Daunting&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Imposing&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Striking&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Charming&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Dazzling&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Engaging&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Resolute&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Intrepid&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Dramatic&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Original&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Fearless&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Flexible&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Creative&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Animated&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Puzzling&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Shocking&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Intense&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Elastic&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Pointed&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Unusual&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Devoted&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Amusing&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Radiant&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Refined&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Natural&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Dynamic&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Radical&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Bizarre&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Curious&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Amazing&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Lively&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Modest&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Mighty&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;August&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Unique&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Absurd&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Brazen&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Crafty&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Astute&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Shrewd&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Daring&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Lovely&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Nimble&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Classy&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Humble&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Limber&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Superb&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Super&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Ready&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Crazy&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Proud&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;First&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Light&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Alert&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Lithe&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Fiery&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Eager&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Quick&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Risky&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Adept&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Sharp&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Smart&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Brisk&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Fresh&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Swift&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Novel&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Giant&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Funky&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Weird&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Grand&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Alive&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Happy&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Keen&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Bold&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Wild&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Spry&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Zany&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Nice&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Loud&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Lean&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Fine&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Busy&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Cool&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Rare&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Apt&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Fun&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Hot&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Big&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Pretty big, right? Don't worry, the worst part is over. Now it's all about easy and interesting stuff.&lt;/p&gt;

&lt;h3&gt;Let's loop!&lt;/h3&gt;

&lt;blockquote&gt;&lt;p&gt;One loop to rule them all,&lt;br/&gt;
One loop to bind them,&lt;br/&gt;
One loop to bring them all,&lt;br/&gt;
And in the Sass way bind them.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Now we have the list, we only have to loop through all items in it and do something, right?&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1910px&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* [1] */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.be&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:after&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;each&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;word&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;words&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* [2] */&lt;/span&gt;
        &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;media&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;screen&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* [3] */&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Be #{$word}.&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* [4] */&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
        &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;max&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* [5] */&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;First, we set a max value (not necessarly px) for the first Media Query call we will do; from there, it will decrease from 10 to 10,&lt;/li&gt;
&lt;li&gt;We loop through all items in the list,&lt;/li&gt;
&lt;li&gt;We call the Media Query setting the according maximum width,&lt;/li&gt;
&lt;li&gt;We put the current word in the &lt;code&gt;content&lt;/code&gt; property,&lt;/li&gt;
&lt;li&gt;We decrease the value from 10 for the next run in the loop.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Please note we also could write it this way:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1910px&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@each&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;word&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;words&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;screen&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;.be&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:after&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;k&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Be #{$word}.&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;max&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;max&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This outputs exactly the same thing. It's really a matter of where you want to put the Media Query call: inside or outside the selector.
&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;That's pretty much it. Fairly simple isn't it? This means we can easily add another word in the list without having to copy/paste or code anything. Simply put the word.&lt;/p&gt;

&lt;p&gt;However if we add a couple of words, the last one will trigger under 300px device width, which gets kind of small. To prevent this, we could reverse the loop, starting from the smallest width, increasing from 10 to 10.&lt;/p&gt;

&lt;p&gt;Thanks again to &lt;a href=&quot;http://twitter.com/arleym&quot;&gt;Arley McBlain&lt;/a&gt; for his awesome CSS experiment!
&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Wed, 27 Feb 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/02/27/sassy-media-queries/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/02/27/sassy-media-queries/</guid>
			</item>
			
		
			
			<item>
				<title>Introducing Browserhacks</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;Hey guys! Just a quick post to anounce the very recent launch of &lt;a href=&quot;http://browserhacks.com&quot;&gt;Browserhacks&lt;/a&gt;!&lt;/p&gt;


&lt;p class=&quot;explanation&quot;&gt;Browserhacks is an extensive list of browser specific CSS (and somewhat JavaScript) hacks gathered from all over the interwebz.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;why&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Why doing this? &lt;a href=&quot;#why&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;There are two main reasons that lead us to create Browserhacks.&lt;/p&gt;

&lt;p&gt;The first one is that we couldn't find a place where all (at least many) hacks were gathered (or it was way too old; Netscape 4 says hi!). The best spot at the moment is &lt;a href=&quot;http://paulirish.com/2009/browser-specific-css-hacks/&quot;&gt;this great blog post by Paul Irish&lt;/a&gt;, but it's a) a blog post; b) there are a lot of interesting stuff in the hundred of comments nobody will ever read anymore.&lt;/p&gt;

&lt;p&gt;Anyway, we thought it could be a good idea to get our hands a little dirty and merge &lt;a href=&quot;http://paulirish.com/2009/browser-specific-css-hacks/&quot;&gt;all&lt;/a&gt; &lt;a href=&quot;https://gist.github.com/983116&quot;&gt;the&lt;/a&gt; &lt;a href=&quot;http://www.impressivewebs.com/ie10-css-hacks/&quot;&gt;cool&lt;/a&gt; &lt;a href=&quot;http://www.webcredible.co.uk/user-friendly-resources/css/hacks-browser-detection.shtml&quot; title=&quot;&quot;&gt;sources&lt;/a&gt; we could find on the topic into a lovely tool.&lt;/p&gt;

&lt;p&gt;The other reason is that we wanted to do something together for quite a while now and it was a very good opportunity to do it! So we did.
&lt;/section&gt;
&lt;section id=&quot;who&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Who is &quot;we&quot;? &lt;a href=&quot;#why&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;We&lt;/em&gt; is the short for a group of 6 persons gathered under the sweet name of &lt;a href=&quot;http://4ae9b8.com&quot;&gt;4ae9b8&lt;/a&gt;. How cool is that name, right?! Anyway, we are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://twitter.com/timpietrusky&quot;&gt;Tim Pietrusky&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://twitter.com/mobilpadde&quot;&gt;Mads Cordes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://twitter.com/fweinb&quot;&gt;Fabrice Weinberg&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://twitter.com/thebabydino&quot;&gt;Ana Tudor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://twitter.com/sarasoueidan&quot;&gt;Sara Soueidan&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;and of course &lt;a href=&quot;https://twitter.com/hugogiraudel&quot;&gt;myself&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Even if in this project, Tim and I did most of the job. However everybody has participated by giving opinion, advices and making tests. :)
&lt;/section&gt;
&lt;section id=&quot;how&quot;&gt;&lt;/p&gt;

&lt;h2&gt;How to use it? &lt;a href=&quot;#how&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;It couldn't be any simpler. If you ever happen to be stuck on a rendering bug in let's say... Internet Explorer 7 (only an example...), you could simply:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Come to &lt;a href=&quot;http://browserhacks.com&quot;&gt;Browserhacks.com&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;Search for &quot;IE7&quot;,&lt;/li&gt;
&lt;li&gt;Copy one of the proposed hacks,&lt;/li&gt;
&lt;li&gt;Paste it in your stylesheet,&lt;/li&gt;
&lt;li&gt;Keep CSS-ing worry-free!&lt;/li&gt;
&lt;/ol&gt;


&lt;p class=&quot;note&quot;&gt;If you don't feel like using this because you don't like CSS hacks (understandable), simply don't use it. However if you start trolling, God will kill many kittens.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Browserhacks is built on a PHP/Backbone.js structure. The front-end stuff is built with &lt;a href=&quot;http://timpietrusky.github.com/crystallo/&quot;&gt;Tim's framework Crystallo&lt;/a&gt; and Sass.&lt;/p&gt;

&lt;p&gt;The source code is available on &lt;a href=&quot;https://github.com/4ae9b8/browserhacks&quot;&gt;GitHub&lt;/a&gt;. If you find a bug, want to make a suggestion or propose a hack, please open an issue in the &lt;a href=&quot;https://github.com/4ae9b8/browserhacks/issues?state=open&quot;&gt;bug tracker&lt;/a&gt;. Many kudos to you!&lt;/p&gt;

&lt;p&gt;Here is what we plan on for the next version:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Put the hacks that matches in your browser first&lt;/li&gt;
&lt;li&gt;Improve the search by adding moar filterz (like a type filter)&lt;/li&gt;
&lt;li&gt;Improve the main site in Internet Explorer 8-&lt;/li&gt;
&lt;li&gt;Add moar hackz!&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Hope you like it, happy hacking!
&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 25 Feb 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/02/25/browserhacks/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/02/25/browserhacks/</guid>
			</item>
			
		
			
			<item>
				<title>Moving to Jekyll</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;If you wonder why you may have experienced some issues when trying to reach the site a couple of days ago, it is probably because I recently decided to move my website to Jekyll and to host it on GitHub Pages. Just like that.&lt;/p&gt;


&lt;p&gt;As a reminder or for those of you who don't know what Jekyll and GitHub Pages are:&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;https://github.com/mojombo/jekyll&quot;&gt;Jekyll&lt;/a&gt; is a simple, blog aware, static site generator written on Ruby by &lt;a href=&quot;http://tom.preston-werner.com/&quot;&gt;Tom Preston Werner&lt;/a&gt;, GitHub co-founder. It takes a template directory (representing the raw form of a website), runs it through Markdown and Liquid converters to spit out a complete static website.&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://pages.github.com/&quot;&gt;GitHub Pages&lt;/a&gt; are public webpages freely hosted and easily published through GitHub.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;why&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Why Jekyll and GitHub Pages &lt;a href=&quot;#why&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;There are a couple of reasons that made me take the decision to move my perfectly-working site (or kind of) to Jekyll and GitHub Pages:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;No server-side language nor database.&lt;/strong&gt;&lt;br&gt;
  This is only good ol' HTML/CSS/JS. Frankly, I don't want to have anything to do with a database unless I absolutely have to. This also means it's worry-free: nothing to hack and unless GitHub goes down, no reason it won't work.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simpler workflow.&lt;/strong&gt;&lt;br&gt;
  I only need a text editor and Git to update the site or release a blog post. No need for a local PHP server or anything. Plus, synchronizing my local environment with the one in production takes no more than a single command.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fewer dependencies.&lt;/strong&gt;&lt;br&gt;
  No more jQuery.paginate for pagination; Jekyll has a built in plugin to do it. No more Prism.js for syntax highlighting; Jekyll comes with Pygments, a Python based syntax highlighter. Less JS (and especially no more jQuery) means faster site.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hosted on GitHub.&lt;/strong&gt;&lt;br&gt;
  Not only are static files served from GitHub blazingly fast, but the &lt;a href=&quot;https://github.com/HugoGiraudel/hugogiraudel.github.com&quot;&gt;source code is now public&lt;/a&gt;. I like the idea of making anyone able to have a look at the code behind the site. Plus, there is now a &lt;a href=&quot;https://github.com/HugoGiraudel/hugogiraudel.github.com/issues&quot;&gt;bug tracker&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discover new things.&lt;/strong&gt;&lt;br&gt;
  I've learnt to use the PHP/MySQL combo but I finally learnt how not to use it when it is not needed. I wanted to discover a new thing and it turned out to be quite simple to use in the end.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;before-jekyll&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Before Jekyll &lt;a href=&quot;#before-jekyll&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;h3&gt;Look 'ma, no CMS&lt;/h3&gt;


&lt;p&gt;When I launched the new version of the site last November, I wanted things to be as simple as possible. No complicated Rube Goldberg machine, no heavy CMS, none of this stuff. I didn't even want to use a server-side language.&lt;/p&gt;


&lt;p&gt;Every time I wanted to release an article, this what I did:&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;Create a new &lt;code&gt;.html&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;Write the article (+head, header, sidebar, footer, etc.)&lt;/li&gt;
&lt;li&gt;Push it with an FTP client&lt;/li&gt;
&lt;li&gt;Add a new entry on the home page&lt;/li&gt;
&lt;li&gt;Add a new entry in the RSS feed&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Everything was handled manually and I was pretty happy back then (what a fool...).&lt;/p&gt;


&lt;h3&gt;It was a bad idea&lt;/h3&gt;


&lt;p&gt;&lt;img src=&quot;/images/jekyll__oh-god-why.png&quot; class=&quot;pull-image--right&quot; alt=&quot;Oh god... why?&quot;&gt;&lt;/p&gt;

&lt;p&gt;But soon enough I realized I couldn't stand this any longer. Every time I had to edit a single comma in either the head, the sidebar or the footer, I had to open all the files all over again to fix it. YAAAAAAAAY!&lt;/p&gt;


&lt;p&gt;So I tried to make things work a little better by themselves. I turned everything to PHP and used &lt;code&gt;include()&lt;/code&gt; for shared parts throughout all pages. It was already way better. But once again I wanted to push things further.&lt;/p&gt;


&lt;p&gt;I created a PHP array which was kind of a database to me. It handled both the index page and the RSS feed, and allowed me to quickly show/hide an article from the site by switching a boolean. Here is what it looked like:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;nx&quot;&gt;$articles&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;title&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Article title&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;desc&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;A little article description&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;url&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;/blog/url-of-the-article&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;codrops&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;guest&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;status&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//public&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;...&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;It wasn't bad at all but still wasn't good enough. I started wondering whether or not I should get back to a real CMS like WordPress. I knew it would please me once everything would had been settled, but I also knew it would have taken weeks to get there because moving an existing site to WordPress is very complicated.&lt;/p&gt;


&lt;p&gt;Also as a developer, I would probably have not felt very proud of running WordPress for my own site. Don't get me wrong, WordPress works great but this site is also meant to show what I can do.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;jekyll&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Here comes Jekyll &lt;a href=&quot;#jekyll&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;This is why I wanted another simpler option, so I &lt;a href=&quot;https://twitter.com/HugoGiraudel/status/302826818988290048&quot;&gt;asked&lt;/a&gt; &lt;a href=&quot;https://twitter.com/HugoGiraudel/status/302839345277194240&quot;&gt;on&lt;/a&gt; &lt;a href=&quot;https://twitter.com/HugoGiraudel/status/302910551363825665&quot;&gt;Twitter&lt;/a&gt;. A couple of people recommended either Jekyll or &lt;a href=&quot;http://octopress.org/&quot;&gt;Octopress&lt;/a&gt; (which runs on Jekyll). I had already heard about it since the site redesign has been motivated by &lt;a href=&quot;http://daverupert.com/2012/11/brander-newer/&quot;&gt;Dave Rupert's&lt;/a&gt; when he moved to Jekyll.&lt;/p&gt;


&lt;p&gt;Back then, I had a look at Jekyll and it seemed nice but overly complicated — at least to me. I am really not that smart when you put CSS aside. Anyway it seemed to be quite what I was looking for so I thought I should give a try.&lt;/p&gt;


&lt;p&gt;I looked for tutorials to move a simple site to Jekyll and found a couple of posts explaining the whole process pretty well but the best one has to be &lt;a href=&quot;http://www.andrewmunsell.com/tutorials/jekyll-by-example/&quot;&gt;this one&lt;/a&gt; from Andrew Munsell. If you can read this Andrew, thank you a billion times because I couldn't have made it without your post. Two or three reads later, I was fucking ready to move that shit to Jekyll.&lt;/p&gt;


&lt;h3&gt;The install nightmare&lt;/h3&gt;


&lt;p&gt;Ironically, I think this was the hardest part. You see, when I tried to install the Jekyll gem at home (Mac OS X 10.6.8) it threw me an error. It wasn't starting well.&lt;/p&gt;


&lt;p&gt;Thanks to a &lt;a href=&quot;http://stackoverflow.com/questions/10725767/error-installing-jekyll-native-extension-build&quot;&gt;StackOverflow answer&lt;/a&gt;, I understood I missed some sort of component (Command Line Tool XCode or whatever) which could be downloaded on Apple's official website. Fair enough. After 15 minutes spent trying to remember my Apple ID, I could finally download and install this thing... only to realize it requires Mac OS X 10.7 to run. Damn it.&lt;/p&gt;


&lt;p&gt;It's Sunday morning, I have croissants and coffee. I CAN FIGURE THIS OUT! So I tried updating software components a couple of times to finally realize not only nothing was getting updated, but that it couldn't update the OS itself, thus I would never get Mac OS X 10.7 this way.&lt;/p&gt;


&lt;p&gt;After a few more Google searches and mouthfuls of delicious croissant, I found the horrifying answer: Mac OS X 10.7 cannot be upgraded for free. It is $25. DAMN IT, I JUST WANT TO RUN JEKYLL!&lt;/p&gt;


&lt;p&gt;Once again thanks to a &lt;a href=&quot;http://stackoverflow.com/questions/10989869/how-do-i-get-ruby-set-up-in-os-x-10-6-8&quot;&gt;StackOverflow answer&lt;/a&gt; I could install some other thing (called GCC) which would finally get rid of the error when trying to install Jekyll. Worst part over.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; ... kind of. I spent hours trying to install Jekyll on a Windows machine without success. It turns out the latest Rdiscount gem (required by Jekyll to compile Markdown into HTML) cannot compile due to &lt;a href=&quot;https://github.com/rtomayko/rdiscount/issues/74&quot;&gt;a bug on Windows&lt;/a&gt;. As of writing, there is no known fix for this.&lt;/p&gt;


&lt;h3&gt;Make things work locally&lt;/h3&gt;


&lt;p&gt;Making everything work locally was pretty easy I have to say, especially since my previous PHP architecture was kind of similar to the one I use with Jekyll today (includes, folder structure and such).&lt;/p&gt;


&lt;p&gt;To create a blog post, here is what I have to do:&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;Create a new Markdown file (&lt;code&gt;.md&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Fill the &quot;front-matter&quot;, which is what Liquid needs to compile everything right. As an example, here is the header (front-matter) of this post:&lt;br&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;---
title: Moving to Jekyll
layout: post
comments: true
---
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;Write my article (either in Markdown or in HTML)&lt;/li&gt;
&lt;li&gt;Push to the repo&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;It is pretty straight forward. If I want to disable comments, it requires no more than switching the &lt;code&gt;comments&lt;/code&gt; boolean to false. If it is a Codrops article, I only have to add &lt;code&gt;codrops: url&lt;/code&gt;. If it is a guest post, I only have to add &lt;code&gt;guest: Ana Tudor&lt;/code&gt;. See? Very simple.&lt;/p&gt;


&lt;p&gt;It took me no more than a couple of hours with some motivating music to make my website run locally. Not everything was perfect (and still isn't) but it was something.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;github-pages&quot;&gt;&lt;/p&gt;

&lt;h2&gt;GitHub Pages &lt;a href=&quot;#github-pages&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Setting up a GitHub Pages based website couldn't be simpler. It only consists of creating a repo named this way &lt;code&gt;username.github.com&lt;/code&gt;. Easy, right?&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;GitHub Pages is built on Jekyll.&lt;/blockquote&gt;


&lt;p&gt;The best thing with GitHub Pages is that it is built on Jekyll. This means &lt;strong&gt;you can push raw Jekyll source to your repo&lt;/strong&gt; and GitHub Pages will automagically compile it through Jekyll (on their side). This also means you only really need Jekyll the very first time to set everything up, but then — unless you plan on changing your structure everyday — you don't really need to use Jekyll at all since GitHub does the compilation.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;I could also push the compiled code to the repo but that would mean I need Jekyll everytime I want to update anything on the site. Not great, especially since I work at 4 different places.&lt;/p&gt;


&lt;p&gt;From there, I only had to push the local Jekyll site to this repo and about 10 minutes later, the whole thing was hosted and available at hugogiraudel.github.com. Easy as a pie.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;dns&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Redirect, DNS and all this shit &lt;a href=&quot;#dns&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;h3&gt;Domain changes&lt;/h3&gt;


&lt;p&gt;At this point, I had my site based on Jekyll running on GitHub Pages. However I didn't want to use hugogiraudel.github.com as the main domain name but hugogiraudel.com. Meanwhile, I had my (previous) website hosted on a OVH server, hugogiraudel.com pointing to a folder on this server.&lt;/p&gt;


&lt;p&gt;Basically I had to tell the GitHub server to serve hugogiraudel.github.com content from hugogiraudel.com, and to make hugogiraudel.com redirect at hugogiraudel.github.com.&lt;/p&gt;


&lt;p&gt;According to &lt;a href=&quot;https://help.github.com/articles/setting-up-a-custom-domain-with-pages&quot;&gt;GitHub Pages documentation&lt;/a&gt;, and a couple of &lt;a href=&quot;http://stackoverflow.com/questions/9082499/custom-domain-for-github-project-pages&quot;&gt;posts on StackOverflow&lt;/a&gt;, I understood I had to create a &lt;code&gt;CNAME&lt;/code&gt; file at the root of the repo directing to the top-level domain I wanted to serve from (hugogiraudel.com) and set an A-record pointing to the GitHub IP from my own server.&lt;/p&gt;


&lt;p class=&quot;pull-quote--right&quot;&gt;My site was down and I had no idea whether or not it would get back up.&lt;/p&gt;


&lt;p&gt;This has been done and followed by 12 hours of worry. My site was down and I had no idea whether or not it would get back up. Since I don't understand a thing about server stuff and DNS, I could have simply broken everything without even knowing it.&lt;/p&gt;


&lt;p&gt;Hopefully I did everything right and the site has been back up about 12 hours after the DNS change. However some people are still facing some &lt;a href=&quot;https://twitter.com/thebabydino/status/304194836523786240&quot;&gt;issues&lt;/a&gt; when trying to reach the site as of today. I don't think I can do anything about it except asking them to wait or use a proxy.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; I got in touch with OVH technical support. Basically they told me everything was fine. Users unable to reach the site should try clearing their cache or try from different connections.&lt;/p&gt;


&lt;h3&gt;Think of old URLs!&lt;/h3&gt;


&lt;p&gt;This was probably my biggest concern when I decided to change structure and host. I knew URLs were going to change and I had no idea how to make old URLs still working. Anyway &lt;strong&gt;I had to&lt;/strong&gt;. There are a couple of articles being linked to on a daily basis.&lt;/p&gt;


&lt;p&gt;GitHub doesn't allow &lt;code&gt;.htaccess&lt;/code&gt; config for obvious reasons, so I couldn't set server-side redirects. A &lt;a href=&quot;http://stackoverflow.com/a/13676721&quot;&gt;StackOverflow answer&lt;/a&gt; recommended a Jekyll plugin to handle automatic redirects through aliases but GitHub Pages compiles Jekyll in safe mode (no plugin), so it wasn't an option either.&lt;/p&gt;


&lt;p&gt;I opted for a very simple — yet not perfect — approach which consisted of creating HTML files at the old locations redirecting to the new files with meta tags. For example, there is a file in a &lt;code&gt;/blog&lt;/code&gt; folder called &lt;code&gt;css-gradients.html&lt;/code&gt; containing this:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;charset=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;http-equiv=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;refresh&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;0;url=/2013/02/04/css-gradients/&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Thus, trying to reach &lt;code&gt;hugogiraudel.com/blog/css-gradients&lt;/code&gt; (old URL) automagically redirects to &lt;code&gt;hugogiraudel.com /2013/02/04/css-gradients/&lt;/code&gt;. Easy peasy.&lt;/p&gt;


&lt;p&gt;However it is not perfect since it requires me to have about 15 files like this in an unused /blog folder. I could do it because I only had 15 articles, but what if I had 300? So if anyone has a clean solution, I take it! :)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;First of all, I must say I am very happy with the porting. All in all, everything has gone pretty well and the downtime hasn't been that long. Also I am proud of having done all this by myself; kind of a big deal to me.&lt;/p&gt;


&lt;p&gt;There are still a couple of things to take care of, like finding a way to preview articles before releasing them without having to run Jekyll but it's nitpicking.&lt;/p&gt;


&lt;p&gt;If you ever happen to find any bug or if you have a suggestion, please &lt;a href=&quot;https://github.com/HugoGiraudel/hugogiraudel.github.com/issues&quot;&gt;open an issue on GitHub&lt;/a&gt; or drop me a comment here.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 21 Feb 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/02/21/jekyll/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/02/21/jekyll/</guid>
			</item>
			
		
			
			<item>
				<title>Sass-ify a CSS shape</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;A couple of days ago, &lt;a href=&quot;http://twitter.com/thebabydino&quot;&gt;Ana Tudor&lt;/a&gt; showed me how she managed to do a &lt;a href=&quot;http://codepen.io/thebabydino/pen/DmklE&quot;&gt;pure CSS 6-point star&lt;/a&gt; with a single element.&lt;/p&gt;


&lt;p&gt;To be truely honest, I wasn’t impressed that much since I am pretty familiar with Ana’s work which is always amazing. If you haven’t seen &lt;a href=&quot;http://stackoverflow.com/users/1397351/ana&quot;&gt;her 3D geometric shapes&lt;/a&gt; made of pure CSS, then you definitely should.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure--right&quot;&gt;
&lt;img alt=&quot;&quot; src=&quot;/images/sass-mixin-star__css-star.png&quot;&gt;
&lt;figcaption&gt;A 6-points star mixin made with CSS&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;Anyway, when I saw this I thought it could be fun to make a &lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/LkoGE&quot;&gt;Sass version&lt;/a&gt; of it to clean the code and ease the use. Let me show you what I ended up with.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;shape&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Understand the shape &lt;a href=&quot;#shape&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;The first thing was to understand how Ana managed to achieve such a shape with a single element (and 2 pseudo-elements). Long story short:  &lt;strong&gt;chained CSS transforms&lt;/strong&gt;.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure--right&quot;&gt;
&lt;img src=&quot;/images/sass-mixin-star__rhombius.png&quot; alt=&quot;&quot;&gt;
&lt;figcaption&gt;3 rhombius = a 6-points star&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;Basically she stacks the element and its 2 pseudo-elements on top of each other after applying several chained transforms to each of them to have the appropriate shape (a &lt;a href=&quot;http://www.mathopenref.com/rhombus.html&quot;&gt;rhombus&lt;/a&gt;).&lt;/p&gt;


&lt;p&gt;Instead of covering everything in here, I let you have a look at &lt;a href=&quot;http://codepen.io/thebabydino/full/ca5fdb3582a6a27e4d3988d6d90952cb&quot;&gt;this very clear explanation&lt;/a&gt; by Ana herself on CodePen.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: we can do it with one single pseudo-element with the &lt;a href=&quot;http://davidwalsh.name/css-triangles&quot;&gt;border shaping trick&lt;/a&gt; but the hover doesn't feel right, and without pseudo-element with linear gradients.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;compute-the-height&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Compute the height &lt;a href=&quot;#compute-the-height&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I quickly noticed the height and the width of the main element were different. The width is a randomly picked number (10em), but the height seemed to be computed by some calculation since it was 8.66em.&lt;/p&gt;


&lt;p&gt;At this point, I was already able to handle a mixin to create the star, but the user had to set both the width and the height. Yet, since the height has to be calculated, it wasn’t right. How is the user supposed to know the appropriate height for the width he set?&lt;/p&gt;


&lt;p&gt;The user couldn’t figure this out and neither could I. So I asked Ana how to compute the height of the element based on the width. After a few complicated explanations, she finally gave me the formula (explanation &lt;a href=&quot;http://codepen.io/thebabydino/full/ca5fdb3582a6a27e4d3988d6d90952cb&quot;&gt;here&lt;/a&gt;).&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;computeHeight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;skewAngle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;skewAngle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;PI&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Okay, this is JavaScript but it is a good start. However this returns a radian value, which is not what we want. We want degrees. So the correct function has to be this one:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;computeHeight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;skewAngle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;skewAngle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;x&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;blockquote class=&quot;pull-quote--right&quot;&gt;I had never heard of any &lt;code&gt;sin()&lt;/code&gt; function in Sass.&lt;/blockquote&gt;


&lt;p&gt;From there, I knew how to get the height from the width, I only had to turn this into SCSS. First problem: &lt;em&gt;sin()&lt;/em&gt;. I had never heard of any &lt;code&gt;sin()&lt;/code&gt; function in Sass. Damn it.&lt;/p&gt;


&lt;p&gt;After a little Google search, I stumbled upon &lt;a href=&quot;https://github.com/adambom/Sass-Math/blob/master/math.scss&quot;&gt;a not-documentated-at-all library&lt;/a&gt; to use advanced math functions in Sass (including &lt;code&gt;sin()&lt;/code&gt;, &lt;code&gt;exp()&lt;/code&gt;, &lt;code&gt;sqrt()&lt;/code&gt;, and much more). Seemed good enough so I gave it a try.&lt;/p&gt;


&lt;p&gt;It turned out the &lt;code&gt;power()&lt;/code&gt; function (called in the &lt;code&gt;sin()&lt;/code&gt; one) was triggering a Sass error. I tried a few things but finally couldn’t make it work. So I did something unusual... Looked at the 2nd page on Google. And bam, &lt;a href=&quot;http://compass-style.org/reference/compass/helpers/math/&quot;&gt;the Holy Grail&lt;/a&gt;!&lt;/p&gt;


&lt;p&gt;Compass has built-in functions for advanced math calculation including &lt;code&gt;sin()&lt;/code&gt;. Isn’t that great? Like really awesome? Building the Sass function was a piece of cake:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;err&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;computeHeight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$skewAngle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
  &lt;span class=&quot;err&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;deg&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$skewAngle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;This worked like a charm. So &lt;strong&gt;given only the width, Sass was able to calculate the according height.&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;units&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Make any unit usable &lt;a href=&quot;#units&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;So everything was already working great but I forced the user to give a em-based unit which sucked. I wanted to make any unit available knowing that the &lt;code&gt;computeHeight()&lt;/code&gt; function requires and returns a unitless value. Basically I had to:&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;get the value given by the user&lt;/li&gt;
&lt;li&gt;split it to get both the integer and the unit&lt;/li&gt;
&lt;li&gt;store the unit&lt;/li&gt;
&lt;li&gt;pass the integer to the &lt;code&gt;computeHeight()&lt;/code&gt; function&lt;/li&gt;
&lt;li&gt;get the result&lt;/li&gt;
&lt;li&gt;apprend the unit to it&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;I had a look in the Sass documentation and I found two related built-in function:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#unitless-instance_method&quot;&gt;&lt;code&gt;unitless(number)&lt;/code&gt;&lt;/a&gt; returns a boolean wether the value has a unit or not&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#unit-instance_method&quot;&gt;&lt;code&gt;unit(number)&lt;/code&gt;&lt;/a&gt; returns the unit of the value&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The first is useless in our case, but the second one is precisely what we need to store the unit of the value given by the user. However we still have no way to parse the integer from a value with a unit. At least not with a built-in function. A &lt;a href=&quot;http://stackoverflow.com/a/12335841&quot;&gt;quick run on Stack Overflow&lt;/a&gt; gave me what I was looking for:&lt;/p&gt;


&lt;blockquote class=&quot;quote&quot;&gt;&lt;p&gt;You need to divide by 1 of the same unit. If you use unit(), you get a string instead of a number, but if you multiply by zero and add 1, you have what you need:&lt;/p&gt;&lt;/blockquote&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;err&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;strip&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;units&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;err&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Do not ask me why it works or how does it work, I have absolutely no idea. This function makes strictly no sense yet it does what we need.&lt;/p&gt;


&lt;p&gt;Anyway, at this point we can set the size in any unit we want, could it be &lt;code&gt;px&lt;/code&gt;, &lt;code&gt;rem&lt;/code&gt;, &lt;code&gt;vh&lt;/code&gt;, &lt;code&gt;cm&lt;/code&gt;, whatever.
&lt;/section&gt;
&lt;section id=&quot;improvements&quot;&gt;
&lt;h2&gt;Improve tiny bits &lt;a href=&quot;#improvements&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Last but not least, Ana used the &lt;a href=&quot;http://xiel.de/webkit-fix-css-transitions-on-pseudo-elements/&quot;&gt;inherit hack&lt;/a&gt; to enable transition on pseudo-elements. She asked me if we had a way in Sass to assign the same value to several properties.&lt;/p&gt;
&lt;p&gt;Of course we have, mixin to the rescue!&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;@each&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;prop&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;properties&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
    &lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;prop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You give this mixin a &lt;a href=&quot;http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#lists&quot;&gt;list&lt;/a&gt; of properties you want to share the same value and of course the value. Then, for each property in the list, the mixin outputs the given value. In our case:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:after&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:before&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;inherit&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;... outputs:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.selector&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:before&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.selector&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:after&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inherit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;     &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inherit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inherit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It’s really no big deal. We could totally write those 3 properties/value pairs, but it is great to see what’s possible with Sass, isn’t it?&lt;/p&gt;
&lt;/section&gt;
&lt;section id=&quot;code&quot;&gt;
&lt;h2&gt;Full code &lt;a href=&quot;#code&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Here is the full code for the mixin. As you can see, it is really not that big (especially since Ana's original code is very light).&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;@each&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;prop&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;properties&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
    &lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;prop&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@function&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;computeHeight&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;skewAngle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
  &lt;span class=&quot;k&quot;&gt;@return&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;sin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;90deg&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;skewAngle&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@function&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;strip-units&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;@return&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;number&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;star&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;computeHeight&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;strip-units&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;),&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;30deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
  
  &lt;span class=&quot;nt&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;unit&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;@include&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;transition&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;all&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.3s&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;@include&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-30deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;skewX&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;30deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    
  &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:before&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; 
  &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:after&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;properties&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;inherit&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    
  &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:before&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;skewX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-30&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;skewX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-30&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt; 
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:after&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;skewX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-30&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rotate&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-60&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;skewX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-30&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; 
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;
&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Well guys, that’s pretty much it. You have a perfectly working &lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/LkoGE&quot;&gt;Sass mixin&lt;/a&gt; to create customized single-element 6-point stars in CSS. Pretty neat, right?&lt;/p&gt;
&lt;p&gt;Using it couldn't be simpler:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.star&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5em&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;tomato&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;star&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;10em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  
  &lt;span class=&quot;o&quot;&gt;&amp;amp;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hover&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;deepskyblue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Thanks (and congratulations) to &lt;a href=&quot;http://twitter.com/thebabydino&quot;&gt;Ana Tudor&lt;/a&gt; for creating such a shape which made me do some cool Sass stuff.&lt;/p&gt;
&lt;/section&gt;

</description>
				<pubDate>Mon, 18 Feb 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/02/18/sass-mixin-star/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/02/18/sass-mixin-star/</guid>
			</item>
			
		
			
			<item>
				<title>A closer look at my Sass structure</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p class=&quot;explanation&quot;&gt;&lt;strong&gt;Edit (2013/02/27):&lt;/strong&gt; this post contains valuable yet outdated informations. To have a look at my current Sass structure, please have a look at &lt;a href=&quot;https://github.com/HugoGiraudel/hugogiraudel.github.com/tree/master/sass&quot;&gt;the GitHub repo&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Hi guys! Ever since the redesign a few weeks ago I have never stopped trying optimizing the performance of the site. One of my biggest concerns was having a stylesheet which is both nice and efficient.&lt;/p&gt;


&lt;p&gt;I think I’ve come pretty close to this point thus I thought it might be a good idea to write a bit about it and give you an inside glance at the whole thing.&lt;/p&gt;


&lt;p&gt;Please, consider this post as both a way to introduce some people to Sass and a way to ask Sass experts some advices about the way I handled things. Any comment appreciated. :)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;divide-and-rule&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Divide and rule &lt;a href=&quot;#divide-and-rule&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;One of the biggest problem one faces when building a stylesheet is the size. Depending on the number of pages, elements and templates on your site, you might end up with a huge stylesheet heavy like hell and not so maintainable.&lt;/p&gt;


&lt;p&gt;I think one of the best things when using a CSS preprocessor -whatever is your cup of tea- is you can split your stylesheets into several parts without risking degrading the performances.&lt;/p&gt;


&lt;p&gt;This is exactly what I did, spliting my stylesheets into parts. As of writing, I currently have 5 different pieces (5 different .scss files):&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;code&gt;_font-awesome.scss&lt;/code&gt;: &lt;a href=&quot;http://fortawesome.github.com/Font-Awesome/&quot;&gt;Font Awesome&lt;/a&gt; is the icon font I use in the site&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_google-fonts.scss&lt;/code&gt;: this is the snippet from &lt;a href=&quot;http://www.google.com/webfonts&quot;&gt;Google Web Fonts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_prism.scss&lt;/code&gt;: &lt;a href=&quot;http://prismjs.com/&quot;&gt;Prism.js&lt;/a&gt; is the syntax highlighter&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_helpers.scss&lt;/code&gt;: this file contains my mixins, variables and helper classes&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_styles.scss&lt;/code&gt;: the core of the CSS
&lt;/ul&gt;


&lt;p class=&quot;note&quot;&gt;Note: .scss files starting with a &lt;code&gt;_&lt;/code&gt; are not compiled into .css files.&lt;/p&gt;


&lt;p&gt;Since my website isn’t that big, I didn’t have to split the code stylesheet into smaller parts like typography, header, footer, modules, etc.&lt;/p&gt;


&lt;p&gt;So basically, my central stylesheet (&lt;code&gt;styles.min.scss&lt;/code&gt; compiled into &lt;code&gt;styles.min.css&lt;/code&gt;) looks like this:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;compass/css3/images&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;compass/css3&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;font-awesome&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; 
        &lt;span class=&quot;s2&quot;&gt;&amp;quot;google-fonts&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; 
        &lt;span class=&quot;s2&quot;&gt;&amp;quot;prism&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; 
        &lt;span class=&quot;s2&quot;&gt;&amp;quot;helpers&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; 
        &lt;span class=&quot;s2&quot;&gt;&amp;quot;styles&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;The first two lines are Compass related imports. It doesn’t compile into the final CSS. They enable use of Compass embedded mixins, sparing me from writing vendor prefixes. The last line imports the 5 files into a single one (top to bottom).&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: when importing Sass/SCSS files, you don't need to add underscores or file extensions.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;kiss&quot;&gt;&lt;/p&gt;

&lt;h2&gt;KISS (Keep It Simple Stupid) &lt;a href=&quot;#kiss&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;At first I was using &lt;a href=&quot;http://cssgrid.net&quot;&gt;the 1140px grid&lt;/a&gt; but then it occurred to me I didn’t need a framework as simple as it is to handle a 2-columns layout. I could do it myself and so did I. &lt;/p&gt;


&lt;p&gt;My point is: I decided to keep my stylesheet as simple (light) as possible. Thus, I did a huge cleaning in the font-awesome stylesheet. I only kept what was needed: the @font-face call, about ten lines to improve icons position, and the 8 icons I use on the whole site (instead of about 300).&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;helpers&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Helpers &lt;a href=&quot;#helpers&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Depending on your project size, you may have various files for that. Maybe one file for variables, one file for mixins, one file for helper classes, and whatever else you like.&lt;/p&gt;


&lt;p&gt;My project is fairly (not to say really) small so I gathered everything into a single file. Let’s dig a little bit into it, part by part.&lt;/p&gt;


&lt;h3&gt;Mixins&lt;/h3&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;Mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;providing&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;PX&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;fallback&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;REM&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;font-sizes&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;val&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;px&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;val&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;rem&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;Mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;handling&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;breakpoints&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;media&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;queries&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;breakpoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;point&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;@if&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;point&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;mama-bear&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;48em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;@if&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;point&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;baby-bear&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;38em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Just two. Why having one hundred mixins when you use just two? The first one allows me to use &lt;code&gt;rem&lt;/code&gt; safely for font-size by providing a &lt;code&gt;px&lt;/code&gt; fallback. This is a very nice mixin from Chris Coyier at &lt;a href=&quot;http://css-tricks.com/snippets/css/less-mixin-for-rem-font-sizing/&quot;&gt;CSS-tricks&lt;/a&gt;. &lt;/p&gt;


&lt;p&gt;The second one also comes from &lt;a href=&quot;http://css-tricks.com/media-queries-sass-3-2-and-codekit/&quot;&gt;CSS-tricks&lt;/a&gt; and is a nice way to handle breakpoints for Media Queries within a single MQ declaration. If either I want to change the breakpoints, I don’t have to go through all my stylesheets to find occurrences; all I have to do is edit it in the mixin.&lt;/p&gt;


&lt;p&gt;Whenever I want to use a Media Query, I just have to run &lt;code class=&quot;language-css&quot;&gt;@include breakpoint(baby-bear) { /* My stuff here */ }&lt;/code&gt;.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: I use &lt;code&gt;em&lt;/code&gt; in media queries in order to prevent some layouts problem when zooming in the browser. More about it in &lt;a href=&quot;http://blog.cloudfour.com/the-ems-have-it-proportional-media-queries-ftw/&quot;&gt;this article&lt;/a&gt; from Lyza Gardner.&lt;/p&gt;


&lt;h3&gt;Variables&lt;/h3&gt;


&lt;p&gt;Ah variables. The most awesome thing in any informatic language in the world. This little piece of thing that spare you from repeating again and again the same things. &lt;/p&gt;


&lt;p&gt;Native CSS variables are coming but currently only supported by Chrome so meanwhile we rely on CSS preprocessors for variables. I have to say I really didn’t use much in my project. Actually I used 4, not more.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;pink&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#FF3D7F&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;lightgrey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#444&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;mediumgrey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#666&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;darkgrey&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#999&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;At first I named my variables like &lt;code&gt;$color1&lt;/code&gt;, &lt;code&gt;$color2&lt;/code&gt;, etc but then it occurred to me I was not able to know what variable I had to set in order to have the right color so I switched back to real color names. It feels easier to me this way.&lt;/p&gt;


&lt;h3&gt;Helper classes&lt;/h3&gt;


&lt;p&gt;Helpers are classes you can add to any element to have a quick effect without having to give this element any id or specific class, then set styles and all this stuff.&lt;/p&gt;


&lt;p&gt;I have quite a few helper classes, some very useful, other a bit less but I use them all in the site. This kind of collection grow up as the project grow so for now it’s kind of small.&lt;/p&gt;


&lt;p&gt;Let's start with the basics:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;code&gt;%clearfix&lt;/code&gt; is an invisible class meant to be extended (@extend) to clear floats in an element containing only floated elements&lt;/li&gt;
&lt;li&gt;&lt;code&gt;.icon-left&lt;/code&gt; and &lt;code&gt;.icon-right&lt;/code&gt; are used on inline icons to prevent them from sticking the text&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;clearfix&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;&amp;amp;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;after&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;clear&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;both&lt;/span&gt; 
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.icon-left&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.iconright&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Then, two helpers to give content specific meaning:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;code&gt;.visually-hidden&lt;/code&gt; simply make the text disappear while keeping it accessible for both screen readers and search engine bots.&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;.note&lt;/code&gt; is used to tell a paragraph is a note which could be removed without affecting the sense of the content&lt;/li&gt;
&lt;/ul&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.visually-hidden&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;hidden&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;clip&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rect&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-1px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.note&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-style&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;italic&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;padding-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;And now let's dig into more interesting stuff. I have built some useful classes to pull images or quotes out of the flow and put them on the side in order to emphasize them. Both are built in the same way:&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;code&gt;%pull-quote&lt;/code&gt; and &lt;code&gt;%pull-image&lt;/code&gt; are invisible classes; it means they won’t be compiled in the stylesheet, they are only here to be extended&lt;/li&gt;
    &lt;li&gt;&lt;code&gt;.pull-quote--left&lt;/code&gt;, &lt;code&gt;.pull-quote--right&lt;/code&gt;, &lt;code&gt;.pull-image--left&lt;/code&gt; and &lt;code&gt;.pull-image--right&lt;/code&gt; respectively inherit (&lt;code&gt;@extend&lt;/code&gt;) styles from &lt;code&gt;%pull-quote&lt;/code&gt; and &lt;code&gt;%pull-image&lt;/code&gt;&lt;/li&gt;
    &lt;li&gt;Plus, they have some specific styles like margins, float, borders, etc.&lt;/li&gt;
    &lt;li&gt;On small screens, they are not floated any more, pulled back in the flow and centered&lt;/li&gt;
&lt;/ul&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;pull-image&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;breakpoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;baby&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bear&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.pull-image--left&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extend&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pull&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.pull-image--right&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extend&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pull&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;pull-quote&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;250px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;35&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1.5em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;o&quot;&gt;&amp;amp;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;after&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;&amp;amp;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;before&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:before&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;\201c&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:after&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&amp;#39;\201d&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;@include&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;breakpoint&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;baby-bear&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
        &lt;span class=&quot;nt&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1em&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;pink&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;border-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;border-right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1em&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.5em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.pull-quote--left&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extend&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pull&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;quote&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;padding-right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;border-right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pink&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.pull-quote--right&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extend&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pull&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;quote&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;padding-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;border-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pink&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Please note how I nest media queries inside their related selectors. There are two main reasons for this:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;This makes the stylesheet easier to maintain since you have everything at the same place: regular rules + conditional rules. No need of going at the bottom of the stylesheet to find all the conditional CSS.&lt;/li&gt;
&lt;li&gt;When compiling, Sass doesn’t generate a bunch of media queries but a single one. So no performance issue on this point.&lt;/li&gt;
&lt;/ul&gt;


&lt;p class=&quot;note&quot;&gt;Note: if you ever wonder about the double dashes or underscores in class names, it is related to the BEM (Block Element Modifier) approach. More on the topic in &lt;a href=&quot;http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/&quot;&gt;this excellent post&lt;/a&gt; from Harry Roberts.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;core&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Core of styles&lt;a href=&quot;#core&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Now we’ve seen pretty much everything else than what makes the site what it is, I think it’s time to dig into the main stylesheet. For reading concern I’ll split it into several code snippets here. Plus it will be easier for commenting.&lt;/p&gt;


&lt;h3&gt;Reset&lt;/h3&gt;


&lt;p&gt;This is not optional, every project needs to use some kind of way to reset CSS styles. Depending on your tastes it might be &lt;a href=&quot;http://meyerweb.com/eric/tools/css/reset/&quot;&gt;Eric Meyer’s CSS reset&lt;/a&gt;, &lt;a href=&quot;http://necolas.github.com/normalize.css/&quot;&gt;Normalize CSS&lt;/a&gt; or as I like to call it the &lt;strong&gt;barbarian CSS&lt;/strong&gt; as below.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;o&quot;&gt;*,&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:before&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:after&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sizing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Yes I know, this is dirty. I shouldn’t not reset CSS this way but honestly on small projects like this, it’s really not a big deal. At first I used Normalize CSS but then I realized loading kilobytes of code when 2 lines are enough is not necessary. So barbarian CSS reset guys!&lt;p&gt;
&lt;p&gt;Please note I use the simplest box-sizing since IE (all versions) represents less than 1.5% of my traffic.&lt;/p&gt;
&lt;h3&gt;Overall stuff&lt;/h3&gt;
&lt;p&gt;I didn’t really know how to call this.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;html&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;HelveticaNeue-Light&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;Helvetica Neue Light&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;Helvetica Neue&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;Helvetica&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;Arial&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;Lucida Grande&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#555&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;text-shadow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;border-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pink&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(&amp;quot;data:image/png;base64,hErEiSaFuCkInGlOnGdAtAuRiaSaBaCkGrOuNd&amp;quot;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;breakpoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;baby&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bear&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;border-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;border-top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pink&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;pink&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;text-decoration&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;o&quot;&gt;&amp;amp;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;hover&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;text-decoration&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;underline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Basic stuff here. Font-size, color, font-families, text-shadows and everything that needs to cascade on the whole document are set on the root element (&lt;code&gt;html&lt;/code&gt;). I also give a little custom styles to anchor tags.&lt;/p&gt;
&lt;h3&gt;Containers&lt;/h3&gt;
&lt;p&gt;This used to be in the 1140px stylesheet but since I don’t use anymore, I moved it back here. It’s all about main wrappers and containers.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.row&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;57em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.main&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extend&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;68&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;breakpoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mama&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bear&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;border-bottom&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3px&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#D1D1D1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.sidebar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;extend&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;padding-top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;content&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;padding-bottom&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;3em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;include&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;breakpoint&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;mama&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;bear&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;.row&lt;/code&gt; is the main wrapper: it contains the header, the main column (&lt;code&gt;.main&lt;/code&gt;), the sidebar (&lt;code&gt;.sidebar&lt;/code&gt;) and the footer.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;.content&lt;/code&gt; is an invisible shared class between both the main column and the sidebar.&lt;/p&gt;
&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;
&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I deliberately skipped the rest of the stylesheet since I think it's not the most interesting part in my opinion. It mostly consists on setting styles for various content elements like paragraphs, lists, tables, images, titles, and so on. Plus, it's classic CSS, not really SCSS magic.&lt;/p&gt;
&lt;p&gt;I think I have covered most of my Sass structure. If you feel like something could be improved or if you have any question, please be sure to drop a comment. :)&lt;/p&gt;
&lt;/section&gt;

</description>
				<pubDate>Mon, 11 Feb 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/02/11/sass-structure/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/02/11/sass-structure/</guid>
			</item>
			
		
			
			<item>
				<title>Dig deep into CSS linear gradients</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p class=&quot;explanation&quot;&gt;The following is a guest post by &lt;a href=&quot;http://twitter.com/thebabydino&quot; target=&quot;blank&quot;&gt;Ana Tudor&lt;/a&gt;. She is passionate about experimenting and learning new things. Also she loves maths and enjoys playing with code.&lt;/p&gt;


&lt;p&gt;I had no idea how powerful CSS gradients could be until late 2011, when I found the &lt;a href=&quot;http://lea.verou.me/css3patterns/&quot; target=&quot;blank&quot;&gt;CSS3 Patterns Gallery&lt;/a&gt; made by Lea Verou. The idea that you can obtain many shapes using just gradients was a starting point for many CSS experiments I would later do.&lt;/p&gt;


&lt;p&gt;Recently, while browsing through the demos on CodePen, I came across &lt;a href=&quot;http://codepen.io/bitmap/pen/eBbHt&quot; target=&quot;blank&quot;&gt;a CSS3 Color Wheel&lt;/a&gt; and thought &lt;q&gt;hey, I could do it with just one element and gradients&lt;/q&gt;. So I did and the result can be seen &lt;a href=&quot;http://codepen.io/thebabydino/pen/hkxGp&quot; target=&quot;blank&quot;&gt;here&lt;/a&gt;. And now I'm going to explain the reasoning behind it.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure--right&quot;&gt;
&lt;img src=&quot;/images/css-gradients__rainbow_wheel_screen.gif&quot; alt=&quot;&quot; /&gt;
&lt;figcaption&gt;Rainbow wheel made of CSS&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/section&gt;
&lt;section id=&quot;breaking-it-down&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Breaking it down &lt;a href=&quot;#breaking-it-down&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;The wheel - or you can think of it as a pie - is first split horizontally into two halves and then each half is split into five slices, so there are ten slices in total. Which means that the &lt;a href=&quot;http://en.wikipedia.org/wiki/Central_angle&quot; target=&quot;blank&quot;&gt;central angle&lt;/a&gt; for each slice is &lt;code&gt;&lt;a href=&quot;http://www.mathopenref.com/degrees.html&quot; target=&quot;blank&quot;&gt;360°&lt;/a&gt;/10 = 36°&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;The pen below shows graphically how to layer the multiple backgrounds. It also has a pause button so that the infinite animation doesn't turn into a performance problem.&lt;/p&gt;


&lt;pre class=&quot;codepen&quot; data-height=&quot;340&quot; data-type=&quot;result&quot; data-href=&quot;Kuvom&quot; data-user=&quot;thebabydino&quot; data-safe=&quot;true&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;a href=&quot;http://codepen.io/thebabydino/pen/qgoBL&quot; target=&quot;blank&quot;&gt;Check out this Pen!&lt;/a&gt;s&lt;/pre&gt;


&lt;p&gt;For both the original pen and this helper demo, the interesting part is this one:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; 
&lt;span class=&quot;nt&quot;&gt;linear-gradient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;36deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#272b66&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.34&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;transparent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.34&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%),&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;linear-gradient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;72deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#2d559f&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.48&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;transparent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.48&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%),&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;linear-gradient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-36deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#9ac147&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.34&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;transparent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;42&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.34&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;linear-gradient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-72deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#639b47&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.48&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;transparent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.48&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; 
&lt;span class=&quot;nt&quot;&gt;linear-gradient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;36deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;transparent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;57&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.66&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#e1e23b&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;57&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.66&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;linear-gradient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;72deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;transparent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.52&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#f7941e&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.52&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;linear-gradient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-36deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;transparent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;57&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.66&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#662a6c&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;57&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.66&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;linear-gradient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;-72deg&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;transparent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.52&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#9a1d34&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;24&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.52&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; 
&lt;span class=&quot;nf&quot;&gt;#43a1cd&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;linear-gradient&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;#ba3e2e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;#ba3e2e&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;background-repeat&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;no-repeat&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;background-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;We first specify the nine gradient backgrounds, their positioning and the &lt;code&gt;background-color&lt;/code&gt; using the shorthand &lt;code&gt;background&lt;/code&gt; syntax.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;background-shorthand&quot;&gt;&lt;/p&gt;

&lt;h2&gt;The background shorthand &lt;a href=&quot;#background-shorthand&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;For anyone who doesn't remember, the background layers are listed from the top one to the bottom one and the &lt;code&gt;background-color&lt;/code&gt; is specified together with the bottom layer. A background layer includes the following:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;background-image&amp;gt;&lt;/code&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;background-position&amp;gt;&lt;/code&gt; / &lt;code&gt;&amp;lt;background-size&amp;gt;&lt;/code&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;background-repeat&amp;gt;&lt;/code&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;background-attachment&amp;gt;&lt;/code&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;background-origin&amp;gt;&lt;/code&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;background-clip&amp;gt;&lt;/code&gt;
&lt;/ul&gt;


&lt;p&gt;If the &lt;code&gt;background-position&lt;/code&gt; is not specified, then the &lt;code&gt;background-size&lt;/code&gt; isn't specified either. Also, since &lt;code&gt;background-origin&lt;/code&gt; and &lt;code&gt;background-clip&lt;/code&gt; both need the same kind of value (that is, a box value like &lt;code&gt;border-box&lt;/code&gt; or &lt;code&gt;content-box&lt;/code&gt;), then, if there is only one such value, that value is given to both &lt;code&gt;background-origin&lt;/code&gt; and &lt;code&gt;background-clip&lt;/code&gt;. Other than that, any value except the one for &lt;code&gt;background-image&lt;/code&gt; can be missing and then it is assumed to be the default.&lt;/p&gt;


&lt;p&gt;Since we have nine background layers and we want to have the same non-default values for &lt;code&gt;background-repeat&lt;/code&gt; and &lt;code&gt;background-size&lt;/code&gt; for all of them, we specify these outside the shorthand so that we don't have to write the same thing nine times.&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;Safari doesn't support background-size inside the shorthand.&lt;/blockquote&gt;


&lt;p&gt;In the case of &lt;code&gt;background-size&lt;/code&gt;, there is also another reason to do that: Safari doesn't support &lt;code&gt;background-size&lt;/code&gt; inside the shorthand and, until recently (up to and including version 17), Firefox didn't support that either. Also, two values should be always given when the &lt;code&gt;background-image&lt;/code&gt; is a gradient, because giving it just one value is going to produce different results in different browsers (unless that one value is 100%, in which case it might as well be missing as that is the default).&lt;/p&gt;


&lt;p&gt;The &lt;code&gt;background-color&lt;/code&gt; is set to be a light blue (&lt;code&gt;#43a1cd&lt;/code&gt;) and then, on top of it, there are layered nine non-repeating (&lt;code&gt;background-repeat: no-repeat&lt;/code&gt; for all) background images created using CSS gradients. All nine of them are half the &lt;code&gt;width&lt;/code&gt; and the &lt;code&gt;height&lt;/code&gt; of the element (&lt;code&gt;background-size: 50% 50%&lt;/code&gt;).&lt;/p&gt;


&lt;p&gt;The bottom one - horizontally centred (&lt;code&gt;50%&lt;/code&gt;) and at the bottom (&lt;code&gt;100%&lt;/code&gt;) - is really simple. It's just a gradient from a firebrick red to the same color (&lt;code&gt;linear-gradient(#ba3e2e, #ba3e2e)&lt;/code&gt;), so the result is simply a solid color square.&lt;/p&gt;


&lt;p&gt;The other eight are gradients from &lt;code&gt;transparent&lt;/code&gt; to a solid color or from a solid color to &lt;code&gt;transparent&lt;/code&gt;. Four of them look like double slices, having a central angle of &lt;code&gt;2*36° = 72°&lt;/code&gt;, but half of each such double slice gets covered by another single slice (having a central angle of &lt;code&gt;36°&lt;/code&gt;).&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;about-linear-gradients&quot;&gt;&lt;/p&gt;

&lt;h2&gt;A few things about linear gradients &lt;a href=&quot;#about-linear-gradients&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;In order to better understand gradient angles and how the &lt;code&gt;%&lt;/code&gt; values for color stops are computed, let's see how a linear gradient is defined. Hopefully, this demo that lets you change the gradient angle helps with that - just click the dots.&lt;/p&gt;


&lt;pre class=&quot;codepen&quot; data-height=&quot;640&quot; data-type=&quot;result&quot; data-href=&quot;qgoBL&quot; data-user=&quot;thebabydino&quot; data-safe=&quot;true&quot;&gt;&lt;code&gt;&lt;/code&gt;
&lt;a href=&quot;http://codepen.io/thebabydino/pen/qgoBL&quot; target=&quot;blank&quot;&gt;Check out this Pen!&lt;/a&gt;&lt;/pre&gt;


&lt;p&gt;The &lt;em&gt;gradient angle&lt;/em&gt; is the angle - measured clockwise - between the vertical axis and the &lt;em&gt;gradient line&lt;/em&gt; (the blue line in the demo). This is for the new syntax, which is not yet supported by WebKit browsers (however, &lt;a href=&quot;https://bugs.webkit.org/show_bug.cgi?id=67166&quot; target=&quot;blank&quot;&gt;this is going to change&lt;/a&gt;). The old syntax measured angles just like on the &lt;a href=&quot;http://en.wikipedia.org/wiki/Unit_circle&quot; target=&quot;blank&quot;&gt;trigonometric unit circle&lt;/a&gt; (counter-clockwise and starting from the horizontal axis).&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: coming from a mathematical background, I have to say the old way feels more natural to me. However, the new way feels consistent with other CSS features, like rotate transforms, for which the angle values are also clockwise.&lt;/p&gt;


&lt;p&gt;What this means is that we (almost always) have different angle values in the standard syntax and in the current WebKit syntax. So, if we are not using something like &lt;a href=&quot;http://leaverou.github.com/prefixfree/&quot; target=&quot;blank&quot;&gt;-prefix-free&lt;/a&gt; (which I do almost all the time), then we should to be able to compute one when knowing the other. That is actually pretty simple. They are going in opposite directions, so the formula for one includes the other with a minus sign. Also, there is a &lt;code&gt;90°&lt;/code&gt; difference between them so this is how we get them: &lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;nx&quot;&gt;newSyntax&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;°&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;oldSyntax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;oldSyntax&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;90&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;°&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;newSyntax&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p class=&quot;note&quot;&gt;Note: if no gradient angle or destination side is specified (for example, &lt;code&gt;linear-gradient(lime, yellow)&lt;/code&gt;), then the resulting gradient is going to have a gradient angle of &lt;code&gt;180°&lt;/code&gt;, not &lt;code&gt;0°&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;All the points on a line that is &lt;a href=&quot;http://www.mathopenref.com/perpendicular.html&quot; target=&quot;blank&quot;&gt;perpendicular&lt;/a&gt; on the gradient line have the same color. The perpendicular from the corner in the quadrant that's opposite to the quadrant of the angle is the &lt;code&gt;0%&lt;/code&gt; line (the crimson line in the demo) and its intersection with the gradient line is the &lt;em&gt;starting point&lt;/em&gt; of the gradient (let's call it &lt;code class=&quot;var&quot;&gt;S&lt;/code&gt;). The perpendicular from the opposite corner (the one in the same quadrant as the gradient angle) is the &lt;code&gt;100%&lt;/code&gt; line (the black line in the demo) and its intersection with the gradient line is the &lt;em&gt;ending point&lt;/em&gt; of the gradient (let's call it &lt;code class=&quot;var&quot;&gt;E&lt;/code&gt;).&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure&quot;&gt;
&lt;img src=&quot;/images/css-gradients__gradient.png&quot; alt=&quot;&quot; /&gt;
&lt;figcaption&gt;Gradient with gradient line, 0% line and 100% line&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;In order to compute the &lt;code&gt;%&lt;/code&gt; value of any point &lt;code class=&quot;var&quot;&gt;P&lt;/code&gt;, we first draw a perpendicular on the gradient line starting from that point. The intersection between the gradient line and this perpendicular is going to be a point we'll name &lt;code class=&quot;var&quot;&gt;I&lt;/code&gt;. We now compute the ratio between the lengths of &lt;code class=&quot;var&quot;&gt;SI&lt;/code&gt; and &lt;code class=&quot;var&quot;&gt;SE&lt;/code&gt; and the &lt;code&gt;%&lt;/code&gt; value for that point is going to be &lt;code&gt;100%&lt;/code&gt; times that ratio.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;putting-it-all-to-work&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Putting it all to work &lt;a href=&quot;#putting-it-all-to-work&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Now let's see how we apply this for the particular case of the rainbow wheel.&lt;/p&gt;


&lt;p&gt;Let's first consider a gradient that creates a single slice (one with a central angle of &lt;code&gt;36°&lt;/code&gt;). This is a square image (see below), with a blue slice having an angle of &lt;code&gt;36°&lt;/code&gt; in the lower part. We draw the horizontal and vertical axes through the point &lt;code class=&quot;var&quot;&gt;O&lt;/code&gt; at which the diagonals intersect. We draw a perpendicular from that point to the line that separates the dark blue part from the transparent part. This is going to be the gradient line. As it can be seen, there is a &lt;code&gt;36°&lt;/code&gt; angle between the vertical axis and the gradient line, so the angle of the gradient is &lt;code&gt;36°&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure&quot;&gt;
&lt;img src=&quot;/images/css-gradients__slice_1.png&quot; alt=&quot;&quot; /&gt;
&lt;figcaption&gt;Applying the theory for the first slice&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;We now draw a perpendicular from the corner of the square in the quadrant that is opposite to the one in which the gradient angle is found. This is the &lt;code&gt;0%&lt;/code&gt; line. Then we draw a perpendicular from the corner of the square in the same quadrant (&lt;code&gt;Q I&lt;/code&gt;) as the gradient angle - this is the &lt;code&gt;100%&lt;/code&gt; line.&lt;/p&gt;


&lt;p&gt;The &lt;a href=&quot;http://www.mathopenref.com/square.html&quot; target=&quot;blank&quot;&gt;intersection of the diagonals of a square splits each one of them into two&lt;/a&gt;, so &lt;code class=&quot;var&quot;&gt;AO&lt;/code&gt; and &lt;code class=&quot;var&quot;&gt;BO&lt;/code&gt; are equal. The &lt;code class=&quot;var&quot;&gt;BOE&lt;/code&gt; and &lt;code class=&quot;var&quot;&gt;AOS&lt;/code&gt; angles are equal, as they are &lt;a href=&quot;http://www.mathopenref.com/anglesvertical.html&quot; target=&quot;blank&quot;&gt;vertical angles&lt;/a&gt;. Moreover, the &lt;code class=&quot;var&quot;&gt;BOE&lt;/code&gt; and &lt;code class=&quot;var&quot;&gt;AOS&lt;/code&gt; triangles are &lt;a href=&quot;http://www.mathopenref.com/righttriangle.html&quot; target=&quot;blank&quot;&gt;right triangles&lt;/a&gt;. All these three &lt;a href=&quot;http://en.wikipedia.org/wiki/Triangle#Similarity_and_congruence&quot; target=&quot;blank&quot;&gt;mean that the two triangles are also congruent&lt;/a&gt;. Which in turn means that &lt;code class=&quot;var&quot;&gt;SO&lt;/code&gt; and &lt;code class=&quot;var&quot;&gt;EO&lt;/code&gt; are equal, so the length of &lt;code class=&quot;var&quot;&gt;SE&lt;/code&gt; is going to be twice the length of &lt;code class=&quot;var&quot;&gt;EO&lt;/code&gt; or twice the length of &lt;code class=&quot;var&quot;&gt;SO&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure--right&quot;&gt;
&lt;img src=&quot;/images/css-gradients__right_triangle_trigonometric_functions.png&quot; alt=&quot;&quot; /&gt;
&lt;figcaption&gt;A right angled triangle and how to compute sin and cos functions&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p class=&quot;note&quot;&gt;Note: before moving further, let's go through a couple of trigonometry concepts first. The longest side of a right-angled triangle is the one opposing that right angle and it's called the &lt;a href=&quot;http://www.mathopenref.com/hypotenuse.html&quot; target=&quot;blank&quot;&gt;hypotenuse&lt;/a&gt;. The other two sides (the ones forming the right angle) are called the &lt;a href=&quot;http://en.wikipedia.org/wiki/Cathetus&quot; target=&quot;blank&quot;&gt;catheti&lt;/a&gt; of the right triangle. The &lt;a href=&quot;http://www.mathopenref.com/sine.html&quot; target=&quot;blank&quot;&gt;sine&lt;/a&gt; of an acute angle in a right triangle is the ratio between the cathetus opposing that angle and the hypotenuse. The &lt;a href=&quot;http://www.mathopenref.com/cosine.html&quot; target=&quot;blank&quot;&gt;cosine&lt;/a&gt; of the same angle is the ratio between the adjacent cathetus and the hypothenuse.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure--right&quot;&gt;
&lt;img src=&quot;/images/css-gradients__slice_1_BOE.png&quot; alt=&quot;&quot; /&gt;
&lt;figcaption&gt;The BOE triangle&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;Computing the length of &lt;code class=&quot;var&quot;&gt;EO&lt;/code&gt; in the right triangle &lt;code class=&quot;var&quot;&gt;BOE&lt;/code&gt; is really simple. If we take the length of the side of the square to be &lt;code class=&quot;var&quot;&gt;a&lt;/code&gt;, then the length of the half diagonal &lt;code class=&quot;var&quot;&gt;BO&lt;/code&gt; is going to be &lt;code class=&quot;var&quot;&gt;a*sqrt(2)/2&lt;/code&gt;. The &lt;code class=&quot;var&quot;&gt;BOE&lt;/code&gt; angle is equal to the difference between the &lt;code class=&quot;var&quot;&gt;BOM&lt;/code&gt; angle, which is &lt;code&gt;45°&lt;/code&gt;, and the &lt;code class=&quot;var&quot;&gt;EOM&lt;/code&gt; angle, which is &lt;code&gt;36°&lt;/code&gt;. This makes &lt;code class=&quot;var&quot;&gt;BOE&lt;/code&gt; have &lt;code&gt;9°&lt;/code&gt;. Since &lt;code class=&quot;var&quot;&gt;BO&lt;/code&gt; is also the hypotenuse in the right triangle &lt;code class=&quot;var&quot;&gt;BOE&lt;/code&gt;, the length of &lt;code class=&quot;var&quot;&gt;EO&lt;/code&gt; is going to be &lt;code&gt;(&lt;span class='var'&gt;a&lt;/span&gt;*sqrt(2)/2)*cos9°&lt;/code&gt;. Which makes the length of &lt;code class=&quot;var&quot;&gt;SE&lt;/code&gt; be &lt;code class=&quot;var&quot;&gt;a*sqrt(2)*cos9°&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;&lt;figure class=&quot;figure--right&quot;&gt;
&lt;img src=&quot;/images/css-gradients__slice_1_APD.png&quot; alt=&quot;&quot; /&gt;
&lt;figcaption&gt;The APD triangle&lt;/figcaption&gt;
&lt;/figure&gt;&lt;/p&gt;

&lt;p&gt;We now draw a perpendicular from &lt;code class=&quot;var&quot;&gt;A&lt;/code&gt; to the &lt;code class=&quot;var&quot;&gt;PI&lt;/code&gt; line. &lt;code class=&quot;var&quot;&gt;ASID&lt;/code&gt; is a rectangle, which means that the length of &lt;code class=&quot;var&quot;&gt;SI&lt;/code&gt; equals the length of &lt;code class=&quot;var&quot;&gt;AD&lt;/code&gt;. We now consider the rectangular triangle &lt;code class=&quot;var&quot;&gt;APD&lt;/code&gt;. In this triangle, &lt;code class=&quot;var&quot;&gt;AP&lt;/code&gt; is the hypotenuse and has a length of &lt;code class=&quot;var&quot;&gt;a&lt;/code&gt;. This means that &lt;code class=&quot;var&quot;&gt;AD&lt;/code&gt; is going to have a length of &lt;code class=&quot;var&quot;&gt;a*sin36°&lt;/code&gt;. But &lt;code class=&quot;var&quot;&gt;SI&lt;/code&gt; is equal to &lt;code class=&quot;var&quot;&gt;AD&lt;/code&gt;, so it also has a length of &lt;code class=&quot;var&quot;&gt;a*sin36°&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Since we now know both &lt;code class=&quot;var&quot;&gt;SI&lt;/code&gt; and &lt;code class=&quot;var&quot;&gt;SE&lt;/code&gt;, we can compute their ratio. It is &lt;code&gt;sin36°/(sqrt(2)*cos9°) = 0.4234&lt;/code&gt;. So the &lt;code&gt;%&lt;/code&gt; value for the color stop is &lt;code&gt;42.34%&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;In this way, we've arrived at: &lt;code&gt;linear-gradient(36deg, #272b66 42.34%, transparent 42.34%)&lt;/code&gt;&lt;/p&gt;


&lt;p&gt;Computing the &lt;code&gt;%&lt;/code&gt; values for the other background layers is done in the exact same manner.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;automating&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Automating all this &lt;a href=&quot;#automating&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;By now, you're probably thinking it sucks to do so many computations. And it must be even worse when there are more gradients with different angles...&lt;/p&gt;


&lt;p&gt;Even though for creating the rainbow wheel experiment I did compute everything on paper... I can only agree with that! This is why I made a really basic little tool that computes the &lt;code&gt;%&lt;/code&gt; for any point inside the gradient box. You just need to click inside it and the &lt;code&gt;%&lt;/code&gt; value appears in a box at the bottom center.&lt;/p&gt;


&lt;pre class=&quot;codepen&quot; data-height=&quot;320&quot; data-type=&quot;result&quot; data-href=&quot;FDbdB&quot; data-user=&quot;thebabydino&quot; data-safe=&quot;true&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;a href=&quot;http://codepen.io/thebabydino/pen/FDbdB&quot;&gt;Check out this Pen!&lt;/a&gt;&lt;/pre&gt;


&lt;p&gt;You can change the dimensions of the gradient box and you can also change the gradient itself. It accepts the newest syntax for linear gradients, with angle values in degrees, &lt;code&gt;to &amp;lt;side&amp;gt;&lt;/code&gt; values or no value at all for describing the direction of the gradient.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;CSS gradients are really powerful and understanding how they work can be really useful for creating all sorts of imageless textures or shapes that would be difficult to obtain otherwise.&lt;/p&gt;


&lt;blockquote class=&quot;quote&quot;&gt;
&lt;img src=&quot;http://www.gravatar.com/avatar/bee436794e066a5423040cf673c7506f?s=200&quot; alt=&quot;Ana Tudor's gravatar&quot; class=&quot;pull-image--left&quot;&gt;
&lt;p&gt;Ana Tudor excels in CSS, especially when it comes to CSS transforms and well, as you may have seen, CSS gradients.&lt;/p&gt;
&lt;p&gt;You definitely should follow her on &lt;a href=&quot;http://twitter.com/thebabydino&quot; target=&quot;blank&quot;&gt;Twitter&lt;/a&gt; or have a look at &lt;a href=&quot;http://about.me/thebabydino&quot; target=&quot;blank&quot;&gt;her profile&lt;/a&gt; to know more about her and what she does.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 04 Feb 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/02/04/css-gradients/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/02/04/css-gradients/</guid>
			</item>
			
		
			
			<item>
				<title>Simulate float: down</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;Back in september, some guy exposed a very interesting problem on &lt;a href=&quot;http://css-tricks.com/forums/discussion/19610/float-items&quot;&gt;CSS-tricks forums&lt;/a&gt;. To sum up, he had a list of elements floated to the left. However, he wanted to float items top to bottom on each column and not left to right on each row.&lt;/p&gt;


&lt;p&gt;He started with:&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://img401.imageshack.us/img401/4723/98791854.jpg&quot;&gt;&lt;/p&gt;

&lt;p&gt;And wanted to end with:&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://imageshack.us/scaled/landing/88/51843399.jpg&quot;&gt;
&lt;/section&gt;
&lt;section id=&quot;solutions&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Solutions to the problem&lt;a href=&quot;#solutions&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;h3&gt;Flexbox&lt;/h3&gt;


&lt;p&gt;Even if I'm not a flexbox expert, I'm pretty confident saying there is a way to do it very easily. The problem with flexbox is that it's not fully compatible so we had to look for another option.&lt;/p&gt;


&lt;p&gt;Actually &lt;a href=&quot;http://twitter.com/bennettfeely&quot;&gt;Bennett Feely&lt;/a&gt; did it very nicely already on &lt;a href=&quot;http://codepen.io/bennettfeely/pen/firxL&quot;&gt;CodePen&lt;/a&gt;.&lt;/p&gt;


&lt;h3&gt;Manually&lt;/h3&gt;


&lt;p&gt;I first managed to do it with &lt;code&gt;:nth-child()&lt;/code&gt; selectors, replacing manually each one of the ten elements (&lt;a href=&quot;http://jsfiddle.net/VAdT3/1/&quot;&gt;JSFiddle&lt;/a&gt;). It sucked because it was:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Manual,&lt;/li&gt;
&lt;li&gt;Dependant of the number of items,&lt;/li&gt;
&lt;li&gt;CSS heavy,&lt;/li&gt;
&lt;li&gt;Not elegant.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;JavaScript&lt;/h3&gt;


&lt;p&gt;I was very upset not finding any proper way to do it with CSS so I did it with a mix of CSS and JavaScript (in fact jQuery). I don't know if it's the best way to do it in JavaScript but here is what I came up with:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;nx&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;.myList &amp;gt; li:odd&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;().&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;appendTo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;.myList&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Basically I target one out of two items with &lt;code&gt;:nth-child(even)&lt;/code&gt; then remove it from the DOM to finally append it again. This does exactly what was asked so I think it's a decent solution (&lt;a href=&quot;http://jsfiddle.net/VAdT3/6/&quot;&gt;JSFiddle&lt;/a&gt;).&lt;/p&gt;


&lt;h3&gt;Margins&lt;/h3&gt;


&lt;p&gt;Finally someone came up with a better idea (and probably a better understanding of CSS) than mine with a pure CSS and very elegant solution (&lt;a href=&quot;http://codepen.io/wolfcry911/pen/IkBbu&quot;&gt;CodePen&lt;/a&gt;).&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;even&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;110px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-110px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;c&quot;&gt;/* Given a 100*100px element with a 10px margin */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Wolfcry911 simply used margins to reposition one out of two items. It's a brilliant solution, really.&lt;/p&gt;


&lt;p&gt;However it relies on CSS advanced pseudo-selectors so for a deeper browser support, you might want get back to the JavaScript solution.&lt;/p&gt;


&lt;h3&gt;Columns (edit 31/01/2013)&lt;/h3&gt;


&lt;p&gt;I just noticed &lt;a href=&quot;http://codepen.io/estelle&quot;&gt;Estelle Weyl&lt;/a&gt; did it in another clever way with CSS columns (&lt;a href=&quot;http://codepen.io/estelle/pen/zkjrn&quot;&gt;CodePen&lt;/a&gt;). I'm actually wondering if it's not the better option all in all since it requires only one single CSS line (prefixes omitted).&lt;/p&gt;


&lt;p&gt;&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;ul&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;columns&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Congratulations to her for such a smart solution. :)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;moar&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Pushing it further&lt;a href=&quot;#moar&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;A few days ago, Chris Coyier found Wolfcry911's work and &lt;a href=&quot;https://twitter.com/chriscoyier/status/295223893516500993&quot;&gt;tweeted&lt;/a&gt; about it. Someone (in the person of &lt;a href=&quot;http://twitter.com/arashmilan&quot;&gt;Arash Milani&lt;/a&gt;) answered it wasn't possible to do it with more than 2 rows.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;CHALLENGE ACCEPTED!&lt;/strong&gt; This made me want to give it a shot. Honestly, it took me a few tries and no more than 10 minutes to find a solution for 3 rows.&lt;/p&gt;


&lt;p&gt;&lt;/p&gt;

&lt;pre class=&quot;codepen&quot; data-height=&quot;450&quot; data-type=&quot;result&quot; data-href=&quot;DoAIB&quot; data-user=&quot;HugoGiraudel&quot; data-safe=&quot;true&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/DoAIB&quot;&gt;Check out this Pen!&lt;/a&gt;&lt;/pre&gt;


&lt;p&gt;Instead of doing &lt;code&gt;:nth-child(even)&lt;/code&gt;, we need two different selectors:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;3n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;120px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-110px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;limegreen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;3n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;230px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-110px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;crimson&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;sass&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Automating the process&lt;a href=&quot;#sass&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;So I found a solution to do it with the number of rows we want, pretty cool. Immediately, I thought about automating this. And guess what? I succeeded.&lt;/p&gt;


&lt;h3&gt;Prepare the ground&lt;/h3&gt;


&lt;p&gt;First, I had to move everything to em units in order to make the whole thing easier to customize. I also created a few variables:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;rows&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;baseline&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;4em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;4em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;nc&quot;&gt;.4em&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;A few explanations about the variables:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$rows&lt;/code&gt; stands for the number of rows you want,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$baseline&lt;/code&gt; is set as a font-size to the root element (&lt;code&gt;html&lt;/code&gt;) in order to be able to use em everywhere,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$width&lt;/code&gt; is the width of each item; in my demo it equals 100px,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$height&lt;/code&gt; is the height of each item; in my demo it equals 100px as well,&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$margin&lt;/code&gt; is the gap between each item; I set it to 10% of the size of an item.&lt;/li&gt;
&lt;/ul&gt;


&lt;p class=&quot;note&quot;&gt;Note: you may wonder why using 2 different variables for size when one would be enough. This allows you to use non-square items if you want to: try it, it works.&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt;Looping!&lt;/h3&gt;


&lt;p&gt;Now let's get to the funny part. I figured out there is some kind of pattern to achieve this and to be honest it took me a while (no pun intended) to create the while loop for this, struggling between my comprehension of the problem and Sass syntax errors. Anyway, this is the main idea:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;javascript&quot;&gt;&lt;span class=&quot;nx&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$rows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Initializing the loop&lt;/span&gt;

&lt;span class=&quot;err&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;gt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;nth&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$rows&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;$j&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// Setting a $i-1 variable&lt;/span&gt;

        &lt;span class=&quot;nx&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$j&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$height&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
        &lt;span class=&quot;nx&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;$width&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;nx&quot;&gt;$i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;$i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;It is pretty tough. Let me show you how it compiles when $rows is set to 4 (other variables remain unchanged):&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;4n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;13.6em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;4&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-4.4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;4em&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;4n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;9.2em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;3&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-4.4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;4em&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;4n&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4.8em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-4.4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;//&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;4em&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0.4em&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;I think the pattern should be easier to see now thanks to the comments. For X rows you'll have &lt;code&gt;X-1&lt;/code&gt; different selectors starting from &lt;code&gt;:nth-child(Xn+Y)&lt;/code&gt; (where X and Y are the same) until Y becomes stricly superior than 1 (so Y equals 2).&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;demo&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Demo&lt;a href=&quot;#demo&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;pre class=&quot;codepen&quot; data-height=&quot;530&quot; data-type=&quot;result&quot; data-href=&quot;AxmBK&quot; data-user=&quot;HugoGiraudel&quot; data-safe=&quot;true&quot;&gt;&lt;code&gt;&lt;/code&gt;&lt;a href=&quot;http://codepen.io/HugoGiraudel/pen/AxmBK&quot;&gt;Check out this Pen!&lt;/a&gt;&lt;/pre&gt;


&lt;p&gt;Try changing the number of rows by editing &lt;code&gt;$rows&lt;/code&gt; and see the magic happen.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words&lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;There are still some problems with this method like: what if items have various sizes? Or what if we want different margins? Or what if we set a disproportionate number of rows given the number of items?&lt;/p&gt;


&lt;p&gt;I guess we could complicate the whole thing to accept more parameters and be even more flexible but would it worth it? I guess not. &lt;strong&gt;The simple way is to use JavaScript. The funny way is to use Sass.&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;

&lt;script async src=&quot;http://codepen.io/assets/embed/ei.js&quot;&gt;&lt;/script&gt;

</description>
				<pubDate>Mon, 28 Jan 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/01/28/float-down/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/01/28/float-down/</guid>
			</item>
			
		
			
			<item>
				<title>My development environment</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p class=&quot;explanation&quot;&gt;&lt;strong&gt;Edit (2013/02/21):&lt;/strong&gt; this post might contain outdated informations since I &lt;a href=&quot;http://hugogiraudel.com/2013/02/21/jekyll/&quot;&gt;moved my site to Jekyll and GitHub Pages&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Hey guys! I recently blogged about the tools I use for front-end development, but someone pointed out on Twitter I didn't tell anything about my development environment. Let's fix my mistake and talk about it!&lt;/p&gt;


&lt;p&gt;Well, first of all, it is kind of complicated because I work at 3 different places, which means I have 3 different development environments (5 actually, I have 3 computers at home). There is -well- home, but I also happen to do some stuff at school or at work when I have some time, mostly during the lunch break.&lt;/p&gt;


&lt;p&gt;Anyway, I will try to describe what I use to work.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;os&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Operating system &lt;a href=&quot;#os&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Let's start with the easy thing: the operating system. First, &lt;strong&gt;I use both Mac and Windows&lt;/strong&gt;. At home, I mostly use my girlfriend's laptop which is a 4-year old Mac. I also have 2 computers I use(d) for gaming which runs Windows 7 and Windows Vista.&lt;/p&gt;


&lt;p&gt;At work, I am on Windows XP. Yeah, that's not cool, I know. But the whole infrastructure is based on Windows XP, so even developers work stations are using XP. Anyway, I can live with it.&lt;/p&gt;


&lt;p&gt;At school we're on Windows 7. The computers there are pretty cool I must say.&lt;/p&gt;


&lt;p&gt;I didn't try Linux yet but I think I might come to it sooner or later. I like challenge.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;browser&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Browser &lt;a href=&quot;#browser&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Ah, browsers. Our main tools. For the record, not so long ago I swear only by Firefox. But when I started doing a lot of stuff on the web at the same time (running many tabs with somewhat heavy content like videos, WebGL, CSS animations, etc.), it occurred to me Firefox was suffering from a bad memory management. Which wasn't the case of Chrome.&lt;/p&gt;


&lt;p&gt;So I switched to Chrome and never looked back. I even pushed it one step further, using &lt;a href=&quot;https://www.google.com/intl/en/chrome/browser/canary.html&quot;&gt;Chrome Canary&lt;/a&gt;. This in order to access to a few things Chrome doesn't support (or didn't support at the time I switched to Canary) like CSS shaders, exclusions, regions and so on.&lt;/p&gt;


&lt;blockquote class=&quot;pull-quote--right&quot;&gt;I don't dislike Firefox -it's a wonderful browser- but I clearly prefer Chrome.&lt;/blockquote&gt;


&lt;p&gt;At work for something which looks like SSL issue, I am also running &lt;a href=&quot;http://www.mozilla.org/fr/firefox/channel/&quot;&gt;Firefox Aurora&lt;/a&gt; which is the future version of Firefox, like Canary for Chrome. I don't dislike Firefox -it's a wonderful browser- but I clearly prefer Chrome.&lt;/p&gt;


&lt;p&gt;I also have Opera and Safari on some computers to make unusual tests. Since I am not a freelance web designer living from the sites I make, I'm not using any browser testing tool like &lt;a href=&quot;http://www.browserstack.com/&quot;&gt;BrowserStack&lt;/a&gt;. I would really love a BrowserStack license, but I can't (or don't want to) afford a $20/month subscription.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;ide&quot;&gt;&lt;/p&gt;

&lt;h2&gt;IDE &lt;a href=&quot;#ide&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;&lt;img src=&quot;/images/development-environment__sublime-text.png&quot; alt=&quot;Sublime Text 2&quot; class=&quot;pull-image--right&quot;&gt;&lt;/p&gt;

&lt;p&gt;I used to be a huge fan of Notepad++, even if everybody was using Dreamweaver. Honestly I never liked DW; it is super heavy while doing not much than a regular text editor.&lt;/p&gt;


&lt;p&gt;Now I am standing on &lt;a href=&quot;http://www.sublimetext.com/2&quot;&gt;Sublime Text 2&lt;/a&gt; on all my computers, with no intention to change soon. The thing Sublime Text 2 provides that Notepad++ doesn't is the ability to open a whole folder in order to have access to any file of your project in the arborescence. This is really cool. Plus Sublime Text 2 looks better in my opinion. :)&lt;/p&gt;


&lt;p&gt;&lt;/p&gt;

&lt;p&gt;That being said, I'm carefully looking into &lt;a href=&quot;http://brackets.io/&quot;&gt;Brackets&lt;/a&gt; from Adobe which is a web-based IDE looking pretty cool.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;ftp&quot;&gt;&lt;/p&gt;

&lt;h2&gt;FTP &lt;a href=&quot;#ftp&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Call me old fashioned, I do still use a FTP client. Yes, I know it's not 2000' anymore but I don't know how to use FTP from the command line, so I am stuck with a &lt;a href=&quot;http://filezilla-project.org/&quot;&gt;FileZilla&lt;/a&gt;. It is actually pretty cool and very easy to use.&lt;/p&gt;


&lt;p&gt;However I would like to move forward, thus I am currently learning how to do some FTP stuff through the command line but I'm still not very good at it so for now I keep using my beloved FileZilla.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;design&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Design &lt;a href=&quot;#design&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Well, I am a huge fan of this &lt;strong&gt;design in the browser&lt;/strong&gt; thing, plus I am very sucky when it comes to any designing tool. I mean you, Photoshop. So really, I hardly use Photoshop, unless I am forced to.&lt;/p&gt;


&lt;p&gt;However I have the good luck to have an Adobe Creative Suite on most of my development workflows. Work provides official liences, we have student licences at school and I have a student licence at home as well.&lt;/p&gt;


&lt;p&gt;You may find this silly but 9 out of 10 times, I use Photoshop to resize and save a screenshot I just took. Yeah... A $3000 software to make screenshots is a bit expensive I guess.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;tools&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Other tools &lt;a href=&quot;#tools&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I didn't know how to call this section because it gathers various tools doing various things I use at various occasions. I hope it's clear enough. :P&lt;/p&gt;


&lt;h3&gt;Sass &amp;amp; Compass&lt;/h3&gt;


&lt;p&gt;&lt;img src=&quot;/images/development-environment__sass-compass.jpg&quot; alt=&quot;Sass and Compass&quot; class=&quot;pull-image--right&quot;&gt;&lt;/p&gt;

&lt;p&gt;Not so long ago I gave a try to CSS preprocessors, because I am both curious and a CSS lover. It turned out I like CSS preprocessors, they give a lot more options than regular CSS.&lt;/p&gt;


&lt;p&gt;Anyway, I am using &lt;a href=&quot;http://sass-lang.com/&quot;&gt;Sass&lt;/a&gt; and &lt;a href=&quot;http://compass-style.org/&quot;&gt;Compass&lt;/a&gt; on most of my projects now. As an example, this site is built on Sass.&lt;/p&gt;


&lt;p&gt;I am running Sass through the command line. Yes, it's scary. But actually it is really not that hard. I would like to have some sort of application taking care of everything for me like &lt;a href=&quot;http://incident57.com/codekit/&quot;&gt;CodeKit&lt;/a&gt;, unfortunately I am not always on Mac OS plus CodeKit is not free ($25). If I was always using the same development environment, I would definitely buy CodeKit but sadly I am not.&lt;/p&gt;


&lt;p&gt;I know there are CodeKit equivalents for Windows. Most people will tell you about &lt;a href=&quot;http://mhs.github.com/scout-app/&quot;&gt;Scout&lt;/a&gt;. I tried it yesterday (as I told you I am curious). Guess what: it turns out Scout was messing with my stylesheets, introducing errors in those. My opinion about it? It sucks. Back to command line.&lt;/p&gt;


&lt;h3&gt;Git&lt;/h3&gt;


&lt;p&gt;Yaaaaay! Git, my dear friend! Guys, &lt;strong&gt;I suck at Git&lt;/strong&gt;. I understand the main idea, I even know how to do some very basic stuff but every single time I need to do something it takes me about 20 minutes, I have to try every command I know (which is about 6 or 7), fail, get upset, read the doc, don't understand anything either and finally ask my brother. Long story short, I don't like Git... yet.&lt;/p&gt;


&lt;p&gt;But I still have an &lt;a href=&quot;https://github.com/HugoGiraudel&quot;&gt;account at GitHub&lt;/a&gt; which only has 2 repositories as of today (good ones tho!). I hope I'll push other things in the not so distand future.&lt;/p&gt;


&lt;h3&gt;Local server&lt;/h3&gt;


&lt;p&gt;When I have to do some server side stuff, mostly PHP (sometimes MySQL), I use EasyPHP when I'm on a Windows machine or Mamp when I'm on Mac.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Well I guess I have covered pretty much everything I thought about. If I missed anything, just tell me and I will edit the post.&lt;/p&gt;


&lt;p&gt;What about you guys? What's your development environment?&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Wed, 23 Jan 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/01/23/development-environment/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/01/23/development-environment/</guid>
			</item>
			
		
			
			<item>
				<title>A little LESS puzzle</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;Hi guys! What do you think of a little puzzle to wake up your neurons? I think I've found something tricky enough to worth a blog post and a little challenge about it.&lt;/p&gt;


&lt;p&gt;First of all, this will be a LESS puzzle, so if you're really unfamiliar with this CSS preprocessor, I think you might feel a bit lost here. Sorry! :(&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;requirements&quot;&gt;&lt;/p&gt;

&lt;h2&gt;What are the requirements &lt;a href=&quot;#requirements&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;So the main idea is to enable a Google Web Font using a variable to have only one occurrence of the font name without leaving the stylesheet. Let me explain the requirements a little better:&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;Pick a Google font &lt;a href=&quot;http://www.google.com/webfonts&quot;&gt;here&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;Click on &quot;Quick use&quot;, then &quot;@import&quot;, and copy the given URL to your clipboard,&lt;/li&gt;
&lt;li&gt;Open &lt;a href=&quot;http://codepen.io&quot;&gt;CodePen&lt;/a&gt;, click on &quot;New pen&quot; and pick LESS as a CSS preprocessor,&lt;/li&gt;
&lt;li&gt;Create a variable for the font name, like this &lt;code&gt;@my-font: &quot;NameOfMyFont&quot;;&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;Import the font from Google CDN with &lt;code&gt;@import url()&lt;/code&gt; using the variable as the font name in the URL,&lt;/li&gt;
&lt;li&gt;Give any element (&lt;code&gt;&amp;lt;h1&amp;gt;&lt;/code&gt; would be good) this font.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;strong&gt;Bonus:&lt;/strong&gt; make it work with compound font names (such as &quot;Roboto Condensed&quot;).&lt;/p&gt;


&lt;p&gt;Accustomed to SASS like me will wonder where is the difficulty in this little exercise. Problem is LESS is extremely annoying when it comes to both url() and string concatenation. I partially covered the topic in &lt;a href=&quot;less-to-sass&quot;&gt;this article&lt;/a&gt;. &lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;c&quot;&gt;/* SASS version */&lt;/span&gt;

&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;my-font&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;Merriweather&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;http://fonts.googleapis.com/css?family=#{$my-font}&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;h1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;font&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;I struggled about one hour on this and couldn't make it work. All my respect to the one who will find the solution.&lt;/p&gt;


&lt;p&gt;Good luck!&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;conclusion&quot;&gt;&lt;/p&gt;

&lt;h2&gt;&lt;span style=&quot;text-decoration:line-through&quot;&gt;Solution&lt;/span&gt; Conclusion (edit January 26th, 2013) &lt;a href=&quot;#conclusion&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Loïc Giraudel (secondarily my dear brother) pointed out &lt;a href=&quot;https://github.com/cloudhead/less.js/issues/410&quot;&gt;a thread on GitHub&lt;/a&gt; mentioning that what I called a &quot;puzzle&quot; is in fact a real bug reported more than a year ago.&lt;/p&gt;


&lt;p&gt;However as of today, &lt;strong&gt;there is no fix for this neither is there a workaround&lt;/strong&gt;. So unless anyone comes up with a solution, this is currently not possible unfortunately.&lt;/p&gt;


&lt;p&gt;Plus, the guys behind LESS imply fixing this bug would require a large amount of work and deep code restructuration.&lt;/p&gt;


&lt;p&gt;No luck.&lt;/p&gt;


&lt;p&gt;
&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 21 Jan 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/01/21/less-puzzle/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/01/21/less-puzzle/</guid>
			</item>
			
		
			
			<item>
				<title>Blog changes</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;Hi guys! It’s now been two months since I launched the new and active version of hugogiraudel.com and I took the opportunity to make a few changes. Let me introduce them, hoping you find them cool. :)&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt; (January 22nd, 2013): I did a lot of changes after writing this post notably regarding SEO, performances and accessibility. Be sure &lt;a href=&quot;#features&quot;&gt;you read&lt;/a&gt; about it!&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;layout&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Layout &lt;a href=&quot;#layout&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;h3&gt;Content shuffling&lt;/h3&gt;


&lt;p&gt;As you can see, the layout has been updated! It’s now a 2-columns website. There are a number of reasons which made me change it but I think the most important one was that I was sick of seeing this stuff about me on the home page.&lt;/p&gt;


&lt;p&gt;Let's be realistic: the main content is the blog not the 20 lines about me you could see everytime you loaded the first page. I wanted to enhance the articles so now the main page lists available articles. It seems muuuch better to me this way, what do you think?&lt;/p&gt;


&lt;p&gt;However, I wanted to provide visitors a quick glance at who I am, so I thought it could be a good idea to have a little sidebar to display informations about me. Now, I’m thinking of adding a picture of me in the sidebar; I know a lot of people do that on their blog. Any thought about that?&lt;/p&gt;


&lt;p&gt;Another thing that occured to me is that the lines were too long. It may be silly but when lines are too extented, it makes the reading more difficult. Now the main column is narrower, reading an article is easier and de facto nicer. &lt;/p&gt;


&lt;h3&gt;Responsive concern&lt;/h3&gt;


&lt;p&gt;I felt like the old layout lacked of responsiveness. It wasn’t bad since it already provided a mobile-friendly version but I wanted a little bit more. This is why I landed on &lt;a href=&quot;http://cssgrid.net/&quot;&gt;the 1140px CSS grid&lt;/a&gt; by Andy Taylor.&lt;/p&gt;


&lt;p&gt;I’m particularly happy with this grid system. It is very easy to set up and as you can see it’s pretty darn efficient!&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;design&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Design &lt;a href=&quot;#design&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I didn’t change many things design speaking except the left border on the whole page to wedge everything from the left. I guess both the header and the footer are better delimited thanks to the solid borders; it’s probably better this way. Also, what do you think of the new Codrops tag on the home page? Pretty nice, right?&lt;/p&gt;


&lt;p&gt;However I slightly improved the mobile version, especially regarding the nav bar. It was a little bit messy with the previous version; it should now be properly centered. I'm thinking about centering the footer on mobiles as well. Don't know yet.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;development&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Development &lt;a href=&quot;#development&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I now rely on a PHP structure for convenience. Actually, I was kind of sick of having to edit a dozen of files every single time I want to make a tiny little change in the header or the footer. So I now have only PHP files, letting me use &lt;code&gt;include()&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;But, switching all my files to .php means a terrible thing: old URLs won’t work anymore! What about all these tweets, links and poor souls unable to reach my blog posts? No worry. My brother helped me doing some .htaccess in order to allow reaching the blog posts through old URLs. Big thanks to him. :)&lt;/p&gt;


&lt;p&gt;While we’re talking about .htaccess: you can now access articles without the file extension like this: &lt;a href=&quot;tools&quot;&gt;http://hugogiraudel/blog/tools&lt;/a&gt;. Pretty cool, right?&lt;/p&gt;


&lt;p&gt;I also decided to rely on a CDN rather than on self hosting for &lt;a href=&quot;http://fortawesome.github.com/Font-Awesome/&quot;&gt;Font Awesome&lt;/a&gt; (now in v3.0.1 since a couple of days). I was especially concerned about the file size of my stylesheet because Font Awesome -as any other icon font- uses a lot of CSS. Anyway, I'm now using &lt;a href=&quot;http://timpietrusky.com&quot;&gt;Tim Pietrusky's&lt;/a&gt; CDN &lt;a href=&quot;http://weloveiconfonts.com&quot;&gt;WeLoveIconFonts&lt;/a&gt; and I'm pretty happy with it. ;)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;features&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Features &lt;a href=&quot;#features&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I tried to add a few features in order to make your experience nicer. Nothing big, just a few things which are -according to me- UX improvements. Among those:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Links to articles on the home page are now paginated in order to make the whole page lighter. Only the last 7 articles will be displayed (including Codrops ones) on the first page. To see older blog posts, you'll have to use the little buttons at the bottom of the screen.&lt;/li&gt;
&lt;li&gt;You can now link to specific sections inside an article thanks to anchor tags on titles. When you hover a level-2 title (like &quot;Features&quot; or &quot;Performances&quot; for example), you'll see a little # character appearing. Click on it to have a section-specific URL.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;performances&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Performances &lt;a href=&quot;#Performances&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p class=&quot;pull-right&quot;&gt;I always try to make the page as fast as I can.&lt;/p&gt;


&lt;p&gt;I'm kind of psychotic when it comes to performance. I always try to make the page as fast as I can. I'm really pissed off when I'm waiting for a page to load more than 2 seconds, so I tried to do my best to make the loading time as quick as possible.&lt;/p&gt;


&lt;p&gt;Among the many things I did on the topic, I:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Did a lot of work on the CSS to clean it, make it faster, with less selectors, faster selectors, ans so on.&lt;/li&gt;
&lt;li&gt;Reduced the number of HTTP requests.&lt;/li&gt;
&lt;li&gt;Am still working on the JavaScript part to make it asynchronous.&lt;/li&gt;
&lt;li&gt;Asked &lt;a href=&quot;http://twitter.com/timpietrusky&quot;&gt;Tim Pietrusky&lt;/a&gt; to improve caching and compressing at &lt;a href=&quot;http://weloveiconfonts.com&quot;&gt;WeLoveIconFonts.com&lt;/a&gt;. Thanks dude!&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;accessibility&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Accessibility &lt;a href=&quot;#accessibility&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I don't know if it's a sudden realisation or the recent &lt;a href=&quot;http://a11yproject.com/&quot;&gt;A11y project&lt;/a&gt; which motivated me to do that but I took some time to improve accessibility on the site. Plus, it gave me the opportunity to learn some things on the topic.&lt;/p&gt;


&lt;p&gt;First of all, I switched a bunch of my divs to &quot;new&quot; HTML5 elements. So I'm now using &amp;lt;header&amp;gt;, &amp;lt;article&amp;gt;, &amp;lt;aside&amp;gt;, &amp;lt;footer&amp;gt;, &amp;lt;section&amp;gt;, and so on. I must say it feels right, really.&lt;/p&gt;


&lt;p&gt;Secondly, I dug a little into ARIA roles. I have to say I didn't know it was such a deep and complex topic, so I may have understand a few things wrong. Anyway, I added a &lt;code&gt;role=&quot;&quot;&lt;/code&gt; attribute to many elements in the site, especially on the home page.&lt;/p&gt;


&lt;p&gt;I also gave a few tries to keyboard navigations and I have to say it's really not that bad. If you have a few minutes left, try it on the home page and tell me what you think about it. &lt;/p&gt;


&lt;p&gt;By the way, if some accessibility ninja is passing by and finds something wrong, please be sure to tell me. :)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;seo&quot;&gt;&lt;/p&gt;

&lt;h2&gt;SEO &lt;a href=&quot;#seo&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;h3&gt;Microdatas&lt;/h3&gt;


&lt;p&gt;SEO, big thing! I decided to push it one step further by trying microdatas. Man, this is not an easy thing. If you're not familiar with microdatas, the main idea is to label content to describe a specific type of information (person, event, review, etc.). This aims at helping search engine bots understanding  the content they index.&lt;/p&gt;


&lt;p&gt;Now if you inspect the sidebar code, you might see some microdatas about me including name, job title, nationality, urls, and so on. I believe it will help search engines indexing datas about me. We'll see if it works.&lt;/p&gt;


&lt;h3&gt;Hidden content&lt;/h3&gt;


&lt;p&gt;I also edited the &lt;a href=&quot;https://github.com/wesnolte/Pajinate&quot;&gt;jQuery plugin&lt;/a&gt; I use for pagination on the home page because it was using &lt;code&gt;.hide()&lt;/code&gt; to hide content from other pages but the current one. And you're not without knowing search engines don't index stuff set to &lt;code&gt;display: none;&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;So I gathered my courage, opened the file and changed those hide and show methods by a class toggling. This class hides things with CSS, letting search engine index the content. It may sound silly but for a JS douche like me, editing a plugin is a pretty big deal. :D&lt;/p&gt;


&lt;p&gt;
&lt;/section&gt;
&lt;section id=&quot;to-do&quot;&gt;&lt;/p&gt;

&lt;h2&gt;To do &lt;a href=&quot;#to-do&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;You tell me. If you have any request, comment, advise or any feedback to do, be sure to speak. Thanks a lot.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 17 Jan 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/01/17/blog-changes/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/01/17/blog-changes/</guid>
			</item>
			
		
			
			<item>
				<title>Understanding the CSS clip property</title>
				<description>
</description>
				<pubDate>Wed, 16 Jan 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/01/16/codrops-css-clip/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/01/16/codrops-css-clip/</guid>
			</item>
			
		
			
			<item>
				<title>Handy tools I use for front-end development</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;So I’ve been thinking (yeah, true story). And it occured to me, it would be a good idea to write a little blog post about some of the cool tools I use almost everyday. &lt;/p&gt;


&lt;p&gt;If you're a webdesigner or developer, you’ve probably already stumbled upon some wonderful online tools / services. Not necessarly complicated things, just things you definitely need. There are really a bunch of them, and &lt;a href=&quot;http://wildwebwatch.com&quot;&gt;Wild Web Watch&lt;/a&gt; is pretty much focused on listing them, but I’d like to focus on just a few of them. The ones I use very often.&lt;/p&gt;


&lt;p&gt;So here are the tools I’ll cover in this article:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#css-coloratum&quot;&gt;CSS Coloratum&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#weloveiconfonts&quot;&gt;WeLoveIconFonts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#pagespeedinsights&quot;&gt;PageSpeed Insights&lt;/a&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#colorzilla&quot;&gt;Colorzilla Extension&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#colorzilla&quot;&gt;Colorzilla Gradient Generator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#caniuse&quot;&gt;CanIUse&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;css-coloratum&quot;&gt;&lt;/p&gt;

&lt;h2&gt;CSS Coloratum &lt;a href=&quot;#css-coloratum&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;ul&gt;
&lt;li&gt;Author: Lea Verou&lt;/li&gt;
&lt;li&gt;Link: &lt;a href=&quot;http://css.coloratum.com/&quot;&gt;http://css.coloratum.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Category: Design&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;CSS Coloratum is a handful tool helping you convert colors in different syntaxes. It currently supports keywords, hexadecimal, RGB and HSL. Plus, it shows a preview.&lt;/p&gt;


&lt;p&gt;Probably one of the best tools I know, especially when you’re working with hexadecimal colors you want to convert to colors accepting an alpha value (RGBa / HSLa).&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;/images/tools__css-coloratum.jpg&quot; alt=&quot;CSS Coloratum&quot;&gt;
&lt;/section&gt;
&lt;section id=&quot;weloveiconfonts&quot;&gt;&lt;/p&gt;

&lt;h2&gt;WeLoveIconFonts &lt;a href=&quot;#weloveiconfonts&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;ul&gt;
&lt;li&gt;Author: Tim Pietrusky&lt;/li&gt;
&lt;li&gt;Link: &lt;a href=&quot;http://weloveiconfonts.com&quot;&gt;http://weloveiconfonts.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Category: Development&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;WeLoveIconFonts (yes we do!) is some kind of CDN (Content Delivery Network) for icon fonts, like Google Web Fonts for web fonts. It currently supports Brandico, Entypo, Font Awesome, Fontelico, Maki, OpenWeb Icons, Typicons and Zocial.&lt;/p&gt;


&lt;p&gt;It’s very easy to use. You pick one or more fonts, you copy the @import line into your stylesheet and you’re done. You can put icons all over your website. No more struggle with font files.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;/images/tools__weloveiconfonts.jpg&quot; alt=&quot;WeLoveIconFonts&quot;&gt;
&lt;/section&gt;
&lt;section id=&quot;pagespeedinsights&quot;&gt;&lt;/p&gt;

&lt;h2&gt;PageSpeed Insights &lt;a href=&quot;#pagespeedinsights&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;ul&gt;
&lt;li&gt;Author: Google&lt;/li&gt;
&lt;li&gt;Link: &lt;a href=&quot;https://developers.google.com/speed/pagespeed/insights&quot;&gt;https://developers.google...&lt;/a&gt; (+ &lt;a href=&quot;https://chrome.google.com/webstore/detail/pagespeed-insights-by-goo/gplegfbjlmmehdoakndmohflojccocli?utm_source=chrome-ntp-icon&quot;&gt;Chrome&lt;/a&gt; and &lt;a href=&quot;https://developers.google.com/speed/docs/insights/using_firefox&quot;&gt;Firefox&lt;/a&gt; extensions&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Category: Optimization&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;PageSpeed Insights is a tool made by Google which analyzes the content of a web page, then generates suggestions to make things faster. What I really like about PSI is it also exists as a Chrome and a Firefox extension, which means you can inspect your page directly from the WebDeveloper Tools / Firebug. Isn’t that awesome?&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;/images/tools__page-speed-insights.jpg&quot; alt=&quot;PageSpeed Insights&quot;&gt;
&lt;/section&gt;
&lt;section id=&quot;colorzilla&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Colorzilla &lt;a href=&quot;#colorzilla&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;ul&gt;
&lt;li&gt;Author: Colorzilla&lt;/li&gt;
&lt;li&gt;Link: &lt;a href=&quot;http://colorzilla.com/&quot;&gt;http://colorzilla.com/&lt;/a&gt; (+ &lt;a href=&quot;http://www.colorzilla.com/chrome/&quot;&gt;Chrome&lt;/a&gt; and &lt;a href=&quot;http://www.colorzilla.com/firefox/&quot;&gt;Firefox&lt;/a&gt; extensions)&lt;/li&gt;
&lt;li&gt;Category: Design&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;ColorZilla provides 2 really awesome things: a CSS gradient generator and a Chrome / Firefox extension to deal with colors. I really recommand the 2, so I’ll talk about both.&lt;/p&gt;


&lt;h3&gt;Colorzilla Gradient Generator&lt;/h2&gt;
&lt;p&gt;Colorzilla Gradient Generator is, well, a CSS gradient generator and probably the best you’ll find so far. It provides a bunch of options like gradient orientation, reversing, size, IE support with filters, color adjustments and much more. And of course, you can copy and paste the CSS code for all browsers. Plus, it also provides 137 presets gradients.&lt;/p&gt;
&lt;img src=&quot;/images/tools__cz-gradient-generator.jpg&quot; alt=&quot;ColorZilla Gradient Generator&quot;&gt;
&lt;h3&gt;Colorzilla Extension&lt;/h3&gt;
&lt;img src=&quot;/images/tools__cz-extension.jpg&quot; alt=&quot;ColorZilla extension&quot; class=&quot;pull-image--right&quot;&gt;
&lt;p&gt;Colorzilla is also a Chrome / Firefox extension to manage colors. This extension provides a lot of features, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An eyedropper (with copy to clipboard feature)&lt;/li&gt;
&lt;li&gt;An advanced color picker&lt;/li&gt;
&lt;li&gt;A webpage color analyzer&lt;/li&gt;
&lt;li&gt;A palette viewer&lt;/li&gt;
&lt;li&gt;A color history&lt;/li&gt;
&lt;li&gt;Keyboard shortcuts&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I know there are a bunch of colorpickers / eyedropper extensions outhere but you want find any like this. Colorzilla is really, really awesome and I wonder how I could work so long without using it.&lt;/p&gt;
&lt;/section&gt;
&lt;section id=&quot;caniuse&quot;&gt;
&lt;h2&gt;CanIUse &lt;a href=&quot;#caniuse&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Author: Alexis Deveria&lt;/li&gt;
&lt;li&gt;Link: &lt;a href=&quot;http://weloveiconfont.com&quot;&gt;http://caniuse.com/&lt;/a&gt; (+ &lt;a href=&quot;https://chrome.google.com/webstore/detail/can-i-use/kinefpelfmogilfkmjlbfkamgmofmedf/reviews?utm_source=chrome-ntp-icon&quot;&gt;Chrome extension&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Category: Development&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;CanIUse.com is the perfect tool when building HTML5 and CSS3 websites or applications. It groups together compatibility tables for most of HTML5, CSS3, SVG and JS API features. From there, you have access to browser support statistics coming from StatCounters for both desktop and mobiles browsers plus some various notes you may want to know about before using a feature.&lt;/p&gt;
&lt;p&gt;This awesome tool has quickly become &lt;strong&gt;the reference&lt;/strong&gt; when it comes to browser support documentation. I use it almost everyday and I would probably be lost without it. As a front-developer, it's a really really useful tool. &lt;/p&gt;
&lt;p&gt;It also exists as a Chrome extension meaning you can search for features directly into your browser without having to visit caniuse.com but I don't use it much since the search engine isn't that good (&quot;border-image&quot; doesn't give any result while &quot;border image&quot; does for example).&lt;/p&gt;
&lt;img src=&quot;/images/tools__caniuse.jpg&quot; alt=&quot;Can I Use&quot;&gt;
&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;
&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;There are plenty more tools I'd like to talk about but I think it will be for another article. Enough for one day! What about you guys, what are the tools you always use? Be sure to share your opinion!&lt;/p&gt;
&lt;/section&gt;

</description>
				<pubDate>Mon, 14 Jan 2013 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2013/01/14/tools/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2013/01/14/tools/</guid>
			</item>
			
		
			
			<item>
				<title>How I built a Tetris with C# and Unity</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;As part of my formation in programming sciences, I had the opportunity to build a little Tetris game with C# on Unity and I thought it could be a good idea to write a little blog post about my experience. Plus, it changes a little from CSS things.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Why Tetris?&lt;/strong&gt; Well first, it's a pretty classic game which doesn't need a good design layer to be fun to play. Plus, the logic behind the game is simple enough to start, but there are still some difficulties which are very interesting to learn from.&lt;/p&gt;


&lt;p&gt;As a reminder:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Unity_(game_engine)&quot;&gt;&lt;strong&gt;Unity&lt;/strong&gt;&lt;/a&gt;: Unity is a cross-platform game engine and IDE developed by Unity Technologies, targeting web plugins, desktop platforms and mobile devices.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/C_Sharp_(programming_language)&quot;&gt;&lt;strong&gt;C#&lt;/strong&gt;&lt;/a&gt;: C# is a programming language developed by Microsoft within its .NET initiative and later approved as a standard by ECMA and ISO.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;If you don't give a fuck about how I built this up and simply want to give it a try, please refer to &lt;a href=&quot;#play&quot;&gt;this section&lt;/a&gt; at the bottom of the article. Have fun! ;)&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Disclaimer!&lt;/strong&gt; Please, understand this game is one of my first works in Unity with C#, so it’s pretty dirty. There are still some bugs, and there have been absolutely no work on the design layer. &lt;strong&gt;The point was to try to make a game which is playable&lt;/strong&gt;. It’s more than enough for a first work, don’t you think?&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;making-of&quot;&gt;&lt;/p&gt;

&lt;h2&gt;The making of &lt;a href=&quot;#making-of&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;&lt;img src=&quot;/images/tetris__tetris.jpg&quot; class=&quot;pull-image--right&quot;&gt;&lt;/p&gt;

&lt;h3&gt;Neuron Tetris&lt;/h3&gt;


&lt;p&gt;Before doing any code, I had the &quot;how the fuck am I supposed to do this?&quot; moment. I had to think about the process behind the program, the way it would work. This is what I started with:&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;Instantiate a random brick&lt;/li&gt;
&lt;li&gt;Allow move and rotate on the current brick&lt;/li&gt;
&lt;li&gt;Stop the brick when its bottom hits another brick or the floor&lt;/li&gt;
&lt;li&gt;Destroy complete lines&lt;/li&gt;
&lt;li&gt;Goto(1);&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Even if I’m clearly not a good C# developer neither I'm a Unity ninja, I was pretty confident with the making of this game. Given the process above, I thought it would be fairly easy to do. Boy, I was wrong. It’s been rough. Let’s see why!&lt;/p&gt;


&lt;h3&gt;When things go wrong&lt;/h3&gt;


&lt;h4&gt;Collision detection&lt;/h4&gt;


&lt;p&gt;There are a few things that were really not easy to do with my current skills and knowledge of both the language and the program but one was really above all: &lt;strong&gt;collision detection&lt;/strong&gt;. What a bitch.&lt;/p&gt;


&lt;p&gt;Basically, I wanted to:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;prevent the brick from crossing left and right edges of the frame&lt;/li&gt;
&lt;li&gt;prevent the brick from crossing another brick&lt;/li&gt;
&lt;li&gt;stop the brick when hitting either the floor or another brick&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;At a first glance, it seems easy, especially when you know Unity engine implements a collision detection system. To put it simple, the collision detection module from Unity permanently checks if something is touching your current item. If there is, it returns the item touching it, else it returns false.&lt;/p&gt;


&lt;p&gt;First problem: how to distinguish bottom collisions from side collisions? Because this isn’t the same thing. If you detect a collision on the bottom, you have to make the brick stop moving, and if you detect a collision on a side, you have to prevent the user to move the brick on this side.&lt;/p&gt;


&lt;p&gt;I’ve spend hours trying to make it work with no success, so I ended using a completely different approach: &lt;strong&gt;rays&lt;/strong&gt;. To put it simple, you can cast an invisible ray from the center of an item in the direction you want and to the distance you want. From there, it returns you a boolean: there is something or there is not.&lt;/p&gt;


&lt;p&gt;So what I did was casting rays in 3 direction (left, bottom, right) at a very short distance. If the ray returns something on a side, I prevent the brick from moving on this side. If there is something below, I stop the brick and instantiate a new one. It seems to work well.&lt;/p&gt;


&lt;h4&gt;Brick positioning&lt;/h4&gt;


&lt;p&gt;Another problem of mine was placing the bricks correctly. During the first phase of testing, bricks were slightly overlapping each other (see figure). Not much, but enough to be seen and to involve some line destroying issues.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;/images/tetris__bricks-overlapping.png&quot; class=&quot;img-right mt05 bordered&quot;&gt;&lt;/p&gt;

&lt;p&gt;This was caused by the collision detection problem. Because whatever the method I could use (rays, OnCollisionEnter, OnTriggerEnter, …), the brick wasn’t stopped at the right position. It was always “more or less&quot; where it should have ended. This lack of accuracy was problematic.&lt;/p&gt;


&lt;p&gt;I ended doing something I didn’t want to, but I had no choice: brick repositioning after landing. Basically, it means when a brick stops moving, I round up its coordinates to place it where it should have ended. It’s not great, it involves some calculations, but I couldn’t think of any other option to fix this issue.&lt;/p&gt;


&lt;h4&gt;Brick rotation&lt;/h4&gt;


&lt;p&gt;When I started coding, I was expecting the brick rotation to be very simple. In some way, I wasn't wrong: make the brick rotate on itself is the easy part. When pressing top or bottom arrow, the brick makes a 90° rotation clockwise or counter-clockwise, no problem.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;/images/tetris__tetris-bug.png&quot; class=&quot;pull-image--right&quot;&gt;&lt;/p&gt;

&lt;p&gt;What was much harder however was &lt;strong&gt;prevent the rotation when too close to the wall&lt;/strong&gt;. Rotating a red bar near the wall could mean wedging the bar into the wall. I succeded in preventing the rotation when too close to the wall, however there is still a bug with the purple L brick which cannot rotate when placed at a 1-unit gap from the wall. Sadly, I don't know how to fix it.&lt;/p&gt;


&lt;p&gt;The other big problem I had and still have with brick rotation is rotating near another brick. Unlike the walls, there is no restriction for rotating a brick near another one, meaning you can overlap bricks with this method. In most cases, this bug won't be noticed because the common behaviour when playing Tetris is rotating and moving the brick while falling, not moving the brick at the very last moment of its fall. Still, there is a bug I couldn't fix.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;improvements&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Let's make improvements &lt;a href=&quot;#improvements&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Once I figured out how to fix most of the previously seen problems, it was time to do some improvements to make the game enjoyable. This includes increasing difficulty overtime, displaying the next brick, showing the score, having a main screen, allow pause, and so on. Actually,  it's kind of all the features. Making the game work is the hard part, but making the game cool is very important as well.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;/images/tetris__tetris-options.jpg&quot; class=&quot;pull-image--right&quot;&gt;&lt;/p&gt;

&lt;h3&gt;Score&lt;/h3&gt;


&lt;p&gt;Showing the score was very easy to do. Basically, everytime a brick is spawned a score variable is incremented by 10 points. When a line is destroyed, the score variable gains 100 points. What was a little harder was displaying the score on the main screen once you lose the game. (This makes me notice I forgot to reset the number of lines when playing again. :x)&lt;/p&gt;


&lt;p&gt;On Unity, when you want to do various &quot;levels&quot;, you have to create multiple scenes. Like you would do in Flash if you know what I mean. So in our case, the main menu is a scene, and the game is another one. Problem is, objects in a scene are not accessible from another scene by default, so I had to do some trickery.&lt;/p&gt;


&lt;h3&gt;Difficulty&lt;/h3&gt;


&lt;p&gt;To increase the difficulty over time, I had multiple options:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;The Classic Tetris way: you have to do X lines to change level. Each level is faster than the previous one. However, it would have required me to do multiple scenes which would have pissed me off, so it was not an option to me.&lt;/li&gt;
&lt;li&gt;Increase speed over time since game start: it didn't seem very accurate to me since; the difficulty has to go higher when you can stand it, not when you're struggling to place your bricks.&lt;/li&gt;
&lt;li&gt;Increase speed over score: something like &lt;code&gt;speed = score / 100&lt;/code&gt; or I don't know. Same reason as above.&lt;/li&gt;
&lt;li&gt;Increase speed over completed lines: every time a line is completed, the speed increases.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So I decided to increase speed every time you complete a line. Not much, so you don't notice it, but progressively, you're starting to feel it. This option seems great to me because it increases speed only when you're winning without requiring any other scene breaking the game flow.&lt;/p&gt;


&lt;p&gt;From there, displaying some kind of level was only a math concern. The result is you're passing a level every 10 lines. I think it's pretty accurate regarding the Classic Tetris.&lt;/p&gt;


&lt;h3&gt;Rotating camera&lt;/h3&gt;


&lt;p&gt;An interesting point of making a game on Unity is you're using 3D. You can choose to ignore it, but I feel like it can be a plus to the game when used correctly (which is not the case in this game :D). I wanted to try slowly moving the camera during the game to increase difficulty. Hopefully, I didn't have to struggle with quaternion calculations for rotation concerns since I managed to do everything directly in the IDE with default animations.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;/images/tetris__tetris-camera.jpg&quot; class=&quot;pull-image--right&quot;&gt;&lt;/p&gt;

&lt;p&gt;It was pretty easy to do, however I felt like it could be really annoying for some people (including me) to have the camera moving permanently so I simply added an option to enable/disable it. The &lt;code&gt;C&lt;/code&gt; key in game, as in camera. True story.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;play&quot;&gt;&lt;/p&gt;

&lt;h2&gt;About the game &lt;a href=&quot;#play&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;&lt;strong&gt;Disclaimer (once again)!&lt;/strong&gt; This game is kind of a learning experiment so it may be pretty dirty. As explained above, there are still some bugs and the design layer hasn't been done at all.&lt;/p&gt;


&lt;h3&gt;Features&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;Classic tetris gameplay&lt;/li&gt;
&lt;li&gt;3D view&lt;/li&gt;
&lt;li&gt;Score + number of lines&lt;/li&gt;
&lt;li&gt;Kind of levels with speed increase&lt;/li&gt;
&lt;li&gt;Quick fall while pressing space&lt;/li&gt;
&lt;li&gt;Preview of next brick&lt;/li&gt;
&lt;li&gt;Pause&lt;/li&gt;
&lt;li&gt;Rotating camera&lt;/li&gt;
&lt;li&gt;Epic 8-bit Tetris soundtrack&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Play it!&lt;/h3&gt;


&lt;p&gt;Even if it’s not perfect, I still have fun playing it, you can try it if you want:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a target=&quot;blank&quot; href=&quot;http://tank-a-faire.com/tetris/WebPlayer.html&quot;&gt;Play online&lt;/a&gt;; you’ll be ask to download Unity’s Web Player, hopefully it’s extremely light and quick to install&lt;/li&gt;
&lt;li&gt;Try the &lt;a href=&quot;http://tank-a-faire.com/tetris/flash/tetris.html&quot;&gt;Flash version&lt;/a&gt; (a bit laggy) if you don't want to download the UWP&lt;/li&gt; 
&lt;li&gt;&lt;a target=&quot;blank&quot; href=&quot;http://tank-a-faire.com/tetris/windows/tetris.zip&quot;&gt;Download it for Windows 64 bits&lt;/a&gt; (~8Mb)&lt;/li&gt;
&lt;li&gt;&lt;a target=&quot;blank&quot; href=&quot;http://tank-a-faire.com/tetris/mac/tetris.app.zip&quot;&gt;Download it for Mac OS&lt;/a&gt; (~8Mb)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;to-do&quot;&gt;&lt;/p&gt;

&lt;h2&gt;What's next? &lt;a href=&quot;#to-do&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I don't know yet if I'm going to continue this game, but I think it's a good start, so I may try to improve it in a not so far future. I have a few plans to make it nicer, including:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Fixing the brick rotation bugs&lt;/li&gt;
&lt;li&gt;Fixing the number of lines bug&lt;/li&gt;
&lt;li&gt;Improving the design layer&lt;/li&gt;
&lt;li&gt;Hiding the game when paused&lt;/li&gt;
&lt;li&gt;Giving the ability to disable music&lt;/li&gt;
&lt;li&gt;Improving performances&lt;/li&gt;
&lt;li&gt;Making it run on mobile&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So guys, how far did you manage to go? My best score is 9840 points, level 7 I guess.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;

&lt;script&gt;var disqus_url = &quot;http://hugogiraudel.com/blog/tetris&quot;;&lt;/script&gt;

</description>
				<pubDate>Thu, 20 Dec 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/12/20/tetris/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/12/20/tetris/</guid>
			</item>
			
		
			
			<item>
				<title>CSS Clicks event</title>
				<description>
</description>
				<pubDate>Mon, 17 Dec 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/12/17/codrops-css-click-events/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/12/17/codrops-css-click-events/</guid>
			</item>
			
		
			
			<item>
				<title>How I start a new project</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;Hi guys! I recently asked on Twitter a topic to blog about because I had frankly no idea. Christoph Rumpel (&lt;a href=&quot;https://twitter.com/christophrumpel&quot;&gt;@christophrumpel&lt;/a&gt;) proposed something about the way I start a new project. I thought it could be a good idea, plus I’m currently working on a new project at work so it may help me as well!&lt;/p&gt;


&lt;p&gt;I’ll probably talk a lot about my blog in this article because it’s the latest project I ran, and I really tried to make things right. So I may do some parallelisms as examples. Anyway, let's go!&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;thinking&quot;&gt;&lt;/p&gt;

&lt;h2&gt;The thinking &lt;a href=&quot;#thinking&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;The very first thing I do when starting a new web project is &lt;strong&gt;thinking&lt;/strong&gt;. I spend like days boggling my mind about the way I should do this and this, and this... Jumping on the IDE to start coding isn’t a good idea. I used to do this in the past, and it often results in costly mistakes.&lt;/p&gt;


&lt;p&gt;So, let’s think about it. And when I think I have a decent idea of what it’s going to look like, I’m sketching some sort of schedule. In most cases, this is as follow:&lt;/p&gt;


&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Write the objectives&lt;/strong&gt;. Who’s the target? What’s the point? What are the main features?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Find the content&lt;/strong&gt;. What do I have? What is my content, what will fit the blank pages?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Think about the arborescence&lt;/strong&gt;, the structure of the site / application.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make a sketch&lt;/strong&gt;, then a mockup. I start large then I go to the details.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Develop&lt;/strong&gt;. Yaaay, let’s run the IDE and write some lines of code!&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Things may vary depending on what’s the project, what’s its scale and such but in most cases this is the process I try to follow. I think it’s very important to make things in the right order; &lt;strong&gt;the objectives define the content which defines the architecture, which defines the design, which defines the way to code&lt;/strong&gt;. &lt;/p&gt;


&lt;p&gt;Please note this only my way of doing, do not take this as the Holy Bible. And please be sure to tell if you feel like something is wrong here. Okay so now we have some kind of way to go, let’s dig in each part a little deepier, shall we?&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;objectives&quot;&gt;&lt;/p&gt;

&lt;h2&gt;The objectives &lt;a href=&quot;#objectives&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;This is the very first thing you have to do. Actually, it should even be implicit since you need a goal in order to achieve something. When you eat, it’s because you’re hungry. When you open a new tab on your browser, it’s because you want to make a search or visit a website. If you want to make a website or an application, it’s to suit some needs, to fill a goal.&lt;/p&gt;


&lt;p&gt;When I redesigned my website because the old one was just a single page with 5 lines of text on it, I tried to think about what would this site be for. Here is what I came with:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Have a landing page for people looking for me for any reason&lt;/li&gt;
&lt;li&gt;Put my resume online&lt;/li&gt;
&lt;li&gt;Talk about things on what we can call a blog&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Even if it’s implicit, it’s important to write things down. I often found myself in the past coding something I hadn’t think about at first, which resulted in refactoring large chunks of code. Writing things down from the beginning is a good way to know where you’re going.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;content&quot;&gt;&lt;/p&gt;

&lt;h2&gt;The content &lt;a href=&quot;#content&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Now we have thought about the goal of the site/application, it’s time to &lt;strong&gt;think about the content&lt;/strong&gt; which will fill that goal. &lt;strong&gt;There can be no site without content&lt;/strong&gt;, it’s lame and completely useless. Sometimes I see people asking for a website without anything to put in and I wonder what is the point? Having a place on the internet with your name on it? Okay actually that’s kind of cool, but that’s even better if you have things to tell.&lt;p&gt;
&lt;p&gt;My way to do is to find the maximum of content for each of the objectives of the site/application. Then, if there is too much, I filter to keep only the best ideas. Too much is better than too few. You might want to readnotes from Luke Wroblewski about Jeffrey Zeldman talk at AEA Washington DC about &lt;a href=&quot;http://www.lukew.com/ff/entry.asp?1598&quot;&gt;&quot;Content first&quot;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For this website, the content was pretty straight forward: the landing page should have some informations about me (like contact stuff) and about &lt;a href=&quot;http://wildwebwatch.com&quot;&gt;Wild Web Watch&lt;/a&gt;, one of my main projects. The resume should be, well, my resume. And I had already 2 ideas of articles for the new blog (&lt;a href=&quot;redesign-blog.html&quot;&gt;one about the redesign&lt;/a&gt;, and &lt;a href=&quot;less-to-sass.html&quot;&gt;one about CSS preprocessors&lt;/a&gt;).&lt;/p&gt;
&lt;/section&gt;
&lt;section id=&quot;arborescence&quot;&gt;
&lt;h2&gt;The arborescence &lt;a href=&quot;#arborescence&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;So we managed to find some general content for our website/application. We can now think about the architecture of the whole thing. How will it be divided? In most cases, this step is pretty easy to do. You can think of it as “what my main navigation will look like?”.&lt;/p&gt;
&lt;p&gt; Maybe it’ll have a contact page, a products page, a shop section and so on. Then, ask yourself if there will be another level of structure in a section. Shop may contain various other sections. All of this will give you a structure for your site.&lt;/p&gt;
&lt;p&gt;This site's structure is very easy:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Home&lt;/li&gt;
&lt;li&gt;Blog
&lt;ul&gt;
&lt;li&gt;Articles&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Resume&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Plus, it occured to me doing that helps me creating the development environment during when I come to the coding part.&lt;/p&gt;
&lt;/section&gt;
&lt;section id=&quot;design&quot;&gt;
&lt;h2&gt;The design &lt;a href=&quot;#design&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This is when things are getting fun. Yeah cause the previous steps were pretty boring, right? Who want to spend hours thinking about something? WE WANT TO MAKE THINGS! So here it is. From now on, it’s like doing a bunch of stuff. &lt;/p&gt;
&lt;p&gt;But there is still no code. We first have to &lt;strong&gt;draw a sketch&lt;/strong&gt; of the website/application. What will it look like? Physically I mean. This is where I’m facing some troubles as far as I am concerned. If like me you never know how to start, then I figured out asking some very basic questions often help finding out where to start. Things like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;What layout do I want (number of columns, structure, etc.)?&lt;/li&gt;
&lt;li&gt;What will be the &lt;a href=&quot;http://tympanus.net/codrops/2012/09/17/build-a-color-scheme-the-fundamentals/&quot; title=&quot;Build a color scheme: the fundamentals&quot;&gt;color scheme&lt;/a&gt; and how many colors will compose it?&lt;/li&gt;
&lt;li&gt;What do I want to put &lt;a href=&quot;http://css-tricks.com/responsive-web-above-the-fold/&quot; title=&quot;Responsive Web Design - Above the fold&quot;&gt;above the fold&lt;/a&gt; (main content, important stuff)?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;I like starting on paper&lt;/strong&gt;. I think it’s easier because you can’t hide behind visual effects like gradients, shadows and such. It’s all about structure and where will be positioned the various elements.&lt;/p&gt;
&lt;p&gt;When I’m finally happy with a sketch, I try to redo it on my computer. Sometimes I go straight to CSS when things look quite simple, but it occured to me there are better ways to go. I think one of the best would be to use an online tool like &lt;a href=&quot;http://wireframe.cc/&quot;&gt;WireFrame.cc&lt;/a&gt; (or &lt;a href=&quot;http://styloapp.com&quot;&gt;StyloApp&lt;/a&gt;) to make a nicer sketch than the one you drew on paper but still focused on structure, not visual effects.&lt;/p&gt;
&lt;img src=&quot;/images/process-wcc.jpg&quot; alt=&quot;WireFrame.cc&quot;&gt;
&lt;p&gt;When it looks good, I personally go for CSS. Some people prefer working a detailed mockup on PhotoShop first but since I’m shitty as hell when it comes to this software and I’m quite confident with CSS, I prefer go straight with CSS and design in the browser. Plus, designing in the browser is very trend those days!&lt;/p&gt;
&lt;p&gt;Although I know some designers simply can not design in the browser because they turn their brain to &quot;technical mode&quot;, losing their creative mind. I don't blame at all since I'm not a designer, browser or not browser. Anyway, if you plan on using Photoshop, I’d suggest not doing too much on visual effects but it’s more like a matter of opinion here. I think this stuff can be figured out afterwards, and not necessarly during the design process but I could be wrong.&lt;/p&gt;
&lt;/section&gt;
&lt;section id=&quot;development&quot;&gt;
&lt;h2&gt;The development &lt;a href=&quot;#development&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Yaaaaay! Here comes the code! The funny part. But before coding, I like to set up my workflow in order to make everything right for the whole development process. Setting up the working environment can mean a lot of things depending on the project:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Building the arborescence (creating folders and such)&lt;/li&gt;
&lt;li&gt;Setting up the development environment (EasyPHP/Mamp, JDK, Sass &amp; Compass, etc.)&lt;/li&gt;
&lt;li&gt;Creating some default files&lt;/li&gt;
&lt;li&gt;Whatever you think is good&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is the way I go.&lt;/p&gt;
&lt;h3&gt;Creating the project&lt;/h3&gt;
&lt;p&gt;I really like when things are well ordered plus I don’t want to keep messing with relative paths, so I like to make the whole arborescence at first to not bother about it anymore. Here is the way I do it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sass/&lt;/code&gt; for SCSS stylesheets if I use Sass&lt;/li&gt;
&lt;li&gt;&lt;code&gt;stylesheets/&lt;/code&gt; for CSS stylesheets&lt;/li&gt;
&lt;li&gt;&lt;code&gt;scripts/&lt;/code&gt; for JavaScript scripts&lt;/li&gt;
&lt;li&gt;&lt;code&gt;images/&lt;/code&gt; for images&lt;/li&gt;
&lt;li&gt;&lt;code&gt;fonts/&lt;/code&gt; for both web and icon fonts&lt;/li&gt;
&lt;li&gt;&lt;code&gt;feeds/&lt;/code&gt; for RSS&lt;/li&gt;
&lt;li&gt;&lt;code&gt;resources/&lt;/code&gt; for various stuff&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This site also uses a &lt;code&gt;blog/&lt;/code&gt; folder and a &lt;code&gt;resume/&lt;/code&gt; folder to keep things clean.&lt;/p&gt;
&lt;p&gt;A project involving some kind of back-office would also include a fake &lt;code&gt;admin/&lt;/code&gt; folder (with a fake login form) and a real admin folder with some random name.&lt;/p&gt;
&lt;h3&gt;Setting up the development environment&lt;/h3&gt;
&lt;p&gt;Depending on the project, the development environment may vary. A PHP project requires EasyPHP or Mamp to work, a Java-based project would require JDK, and so on. Even for the front-end side, you may want to have some tools like pre-processors (Markdown for HTML, Sass for CSS, CoffeeScript for JS or whatever).&lt;/p&gt;
&lt;p&gt;Speaking of preprocessors, I build most of my projects on Sass so there are a few things I do before coding. I don’t know about you, but I don’t use any tool to manage Sass stuff (like Compass.app or CodeKit). Not because I'm a command-line nerd but because I work on different computers with different OS, meaning I would have to install everything all over again. So I tend to do Sass stuff with command lines through Ruby Command Prompt.&lt;/p&gt;
&lt;p&gt;Depending on what I need for the project, I might also need some scripts like jQuery, Modernizr, Prefixfree, Prism or other things. I may also want to include an icon font I don't know, so I download files before going any further, just in case.&lt;/p&gt;
&lt;h3&gt;Creating default files&lt;/h3&gt;
&lt;p&gt;To speed up the development time, I like to do all the dirty stuff at the beginning of a project to be able to focus on the cool stuff without being interrupted. So I often create a bunch of files I know I will have to do.&lt;/p&gt;
&lt;h4&gt;HTML&lt;/h4&gt;
&lt;p&gt;The following code is a valid HTML document which can be used to create any page in the site. Its content may vary according to the needs of the project but in most cases it includes conditional HTML classes, IE stylesheet, commented scripts, jQuery call, Google Analytics snippet and so on. Everything's ready!&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;html&quot;&gt;&lt;span class=&quot;cp&quot;&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;html&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;class=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;no-js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;charset=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;utf-8&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;http-equiv=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;X-UA-Compatible&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;IE=edge,chrome=1&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;meta&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;name=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;viewport&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;content=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;width=device-width&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;title&amp;gt;&lt;/span&gt;New title&lt;span class=&quot;nt&quot;&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;link&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;rel=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;type=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;href=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;stylesheets/styles.min.css&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if lte IE 7]&amp;gt; &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;stylesheets/ie.css&amp;quot;&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;&amp;lt;!--[if lt IE 9]&amp;gt; &amp;lt;script src=&amp;quot;http://html5shiv.googlecode.com/svn/trunk/html5.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; &amp;lt;![endif]--&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- &amp;lt;script src=&amp;quot;scripts/modernizr-2.6.2.min.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;script &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;src=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js&amp;quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;window&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;jQuery&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&amp;#39;&amp;lt;script src=&amp;quot;js/jquery-1.8.2.min.js&amp;quot;&amp;gt;&amp;lt;\/script&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;      

    &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- &amp;lt;script src=&amp;quot;js/functions.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt; --&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;&amp;lt;!-- &amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;    var _gaq=[[&amp;#39;_setAccount&amp;#39;,&amp;#39;UA-XXXXX-X&amp;#39;],[&amp;#39;_trackPageview&amp;#39;]];&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;    (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;    g.src=(&amp;#39;https:&amp;#39;==location.protocol?&amp;#39;//ssl&amp;#39;:&amp;#39;//www&amp;#39;)+&amp;#39;.google-analytics.com/ga.js&amp;#39;;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;    s.parentNode.insertBefore(g,s)}(document,&amp;#39;script&amp;#39;));&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;    &amp;lt;/script&amp;gt; --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h4&gt;Stylesheets&lt;/h4&gt;
&lt;p&gt;What’s cool with Sass it’s it gives you the option to use a bunch of stylesheets and concatenate all of them into one single file without any performance loss. The following is my &lt;code&gt;styles.scss&lt;/code&gt; file.&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;“&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;mixins&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;”&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;variables&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;default&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;reset&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;typography&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;grid&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;font-awesome&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@import&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;main&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When compiled, it takes all the following SCSS stylesheets and concatenate and compress all of them into one single &lt;code&gt;styles.min.css&lt;/code&gt; file.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;_variables.scss&lt;/code&gt; contains things like colors, default margins and such&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_default.scss&lt;/code&gt; has stuff like border-box, clearfix and useful classes&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_reset.scss&lt;/code&gt; contains Eric Meyer’s CSS reset&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_typography.scss&lt;/code&gt; comes from Twitter Bootstrap and includes a bunch of typographic rules&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_grid.scss&lt;/code&gt; is the &lt;a href=&quot;http://cssgrid.net/&quot;&gt;1140px Grid&lt;/a&gt; stylesheet&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_font-awesome.scss&lt;/code&gt; is the FA stylesheet, now replaced by the CDN from Tim Pietrusky &lt;a href=&quot;http://weloveiconfonts.com&quot;&gt;WeLoveIconFonts&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;_main.scss&lt;/code&gt; contains stuff relative to the current project, the actual CSS (empty at first)&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;JavaScript&lt;/h4&gt;
&lt;p&gt;Most projects require at least a little bit of JavaScript. Especially since I'm really not good at JavaScript, meaning I feel like I have to use jQuery in order to achieve anything. Anyway, I use to have a few things in the scripts/ folder to begin with:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The last and minified version of jQuery in case Google's CDN is unavailable (currently &lt;code&gt;jquery-1.8.2.min.js&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;The last and minified version of Modernizr to do some feature detection for graceful degradation (currently &lt;code&gt;modernizr-2.6.2.min.js&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;functions.js&lt;/code&gt; where I put my stuff to run various things&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In the past, I used to use Prefix-free as well for CSS prefixing but I don't anymore since Compass does it for me.&lt;/p&gt;
&lt;p&gt;Anyway, once I've done all this stuff, I can go further into the actual development.&lt;/p&gt;
&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;
&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;I guess I've covered pretty much everything I'm dealing with when starting a new project. Some things may vary depending on the project, but here is the general process.&lt;/p&gt;
&lt;p&gt;What about you? How do you deal with another project? What's your workflow?&lt;/p&gt;
&lt;/section&gt;

</description>
				<pubDate>Wed, 12 Dec 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/12/12/process/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/12/12/process/</guid>
			</item>
			
		
			
			<item>
				<title>Colors in CSS</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;Hi everyone! Today, we will talk about colors in CSS. There are many color specifications and we'll be talking about their history, what they mean and how to use them.&lt;/p&gt;


&lt;p&gt;If you'd like to read about how to build a color scheme for a website then you might be interested in this article &lt;a href=&quot;http://tympanus.net/codrops/2012/09/17/build-a-color-scheme-the-fundamentals/&quot;&gt;Build a color scheme: the fundamentals&lt;/a&gt;, or the article &lt;a href=&quot;http://tympanus.net/codrops/2012/02/28/principles-of-color-and-the-color-wheel/&quot; title=&quot;Principles of Color and the Color Wheel&quot;&gt;Principles of Color and the Color Wheel&lt;/a&gt; if you'd like to read about the color wheel.&lt;/p&gt;


&lt;p&gt;We will see how we can define colors in style sheets, what each one can be used for and more. But first, let me introduce the topic.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;types-of-colors&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Various types of colors in CSS &lt;a href=&quot;#types-of-colors&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Colors in CSS are defined on a &lt;a href=&quot;http://en.wikipedia.org/wiki/SRGB&quot;&gt;sRGB&lt;/a&gt; color space. sRGB stands for &quot;Standard Red Green Blue&quot; where colors are defined through three channels: Red, Green and Blue.&lt;/p&gt;


&lt;p&gt;From there, we have various ways to describe color with CSS. Some of them like keywords and hexadecimal has been there almost since the beginning of the web, while other like HSL or RGB came later.&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#rgb&quot;&gt;&lt;strong&gt;RGB&lt;/strong&gt;&lt;/a&gt; and &lt;strong&gt;RGBA&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#hex&quot;&gt;&lt;strong&gt;Hexadecimal&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#keywords&quot;&gt;&lt;strong&gt;Keywords&lt;/strong&gt;&lt;/a&gt; (+transparent and currentColor)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#hsl&quot;&gt;&lt;strong&gt;HSL&lt;/strong&gt;&lt;/a&gt; and &lt;strong&gt;HSLA&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#system-colors&quot;&gt;&lt;strong&gt;System colors&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Let's talk about each one of these definitions to understand them better.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;rgb&quot;&gt;&lt;/p&gt;

&lt;h2&gt;RGB &lt;a href=&quot;#rgb&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Let me start with the RGB syntax since it’s the most fundamental thing to understand in order to comprehend how other notations like hexadecimal work. &lt;/p&gt;


&lt;h3&gt;What is RGB?&lt;/h3&gt;


&lt;p&gt;As I said above, RGB stands for Red, Green and Blue. Remember when you were a little kid and were painting with some cheap watercolor? Well, this is kind of the same thing, except that colors behave a little bit differently on screen and on paper. Let me explain myself:&lt;/p&gt;


&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;On paper&lt;/th&gt;
&lt;th&gt;On screen&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Main colors are Red, Yellow and Blue&lt;/td&gt;
&lt;td&gt;Main colors are Red, Green and Blue&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mixing 3 colors makes a brownish black&lt;/td&gt;
&lt;td&gt;Mixing 3 colors makes a grey shade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A bit of blue + some red make nice purple&lt;/td&gt;
&lt;td&gt;A bit of blue + some red make dark purple&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The less color you use, the brighter it is&lt;/td&gt;
&lt;td&gt;The less color you use, the darker it is&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Representation is a circle with neither white nor black&lt;/td&gt;
&lt;td&gt;Representation is a cube with black and white&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;


&lt;p&gt;&lt;img src=&quot;/images/css-colors__color-cube.jpg&quot; class=&quot;pull-image--left&quot; alt=&quot;Color Cube&quot; /&gt;&lt;/p&gt;

&lt;blockquote class=&quot;quote&quot;&gt;This picture is the RGB color model mapped to a cube. What you can see is this: the horizontal x-axis as red values increasing to the left, y-axis as blue increasing to the lower right, and the vertical z-axis as green towards the top. The origin, black, is the vertex hidden from the view.&lt;/blockquote&gt;


&lt;h3 style=&quot;clear:both&quot;&gt;How do we define RGB colors?&lt;/h3&gt;


&lt;p&gt;To describe a color using the RGB model, you have to define a value for the red channel, a value for the green channel and a value for the blue channel. Okay, but what type of value? Percentages? Arbitrary? Any?&lt;/p&gt;


&lt;p&gt;A RGB value can be defined using four different syntaxes but only two of them are available in CSS:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;A percentage from 0% (black) to 100% (white)&lt;/li&gt;
&lt;li&gt;An integer value from 0 (black) to 255 (white); 255 is the range of a 8-bit byte&lt;/li&gt;
&lt;li&gt;A float number from 0 to 1 (0.58935); it’s more like a theoretical approach &lt;strong&gt;unavailable in CSS&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;A large integer 10, 16, 24, 32, 48 or even 64-bit units, but clearly that's &lt;strong&gt;unavailable in CSS&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;So, summarized, we end up with two different ways to display CSS colors with the &lt;code&gt;rgb()&lt;/code&gt; function: percentages and integers between 0 and 255. Let’s illustrate this with an example, shall we?&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.black&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m black! */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.white&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m white! */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.purple&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m medium purple! */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;128&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;128&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.light-purple&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m fuchsia! */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.dark-purple&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m deep purple! */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;64&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;25&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: when using percentages, you have to set the unit even if it is 0. If you don’t, some browsers may be unable to parse it.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: even if the percentage version seems more intuitive, it’s actually the integer version that seems to be more commonly used.&lt;/p&gt;


&lt;h3&gt;What about the alpha-channel?&lt;/h3&gt;


&lt;p&gt;As seen previously, while using the RGB system we can also use an alpha channel which is by default set to 1. This channel allows us to modify the opacity of a color, or its transparency if you will.&lt;/p&gt;


&lt;p&gt;To use this channel in CSS, you’ll call the &lt;code&gt;rgba()&lt;/code&gt; function instead of the &lt;code&gt;rgb()&lt;/code&gt;. However note the alpha-channel is always defined with a float clamped between 0 and 1.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.black&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m half transparent black! */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.white&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m 2/3 transparent white! */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;33&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;33&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m fully transparent red, so kind of invisible */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;This can be very useful in various situation. Let’s say you have some kind of background image and want to write on it without losing readability or putting a big white box on top of it. This is the perfect usecase for RGBa!&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.parent&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(‘my-picture.jpg’)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.child&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;51&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;51&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;51&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;This way, the child element will have a white background with 75% opacity, showing its parent’s background without risking any issue with readability.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: when dealing with decimal values between 0 and 1, you don’t have to write the 0 before the dot. So you can write &lt;code&gt;rgba(0, 0, 0, .5)&lt;/code&gt; and still be perfectly valid.&lt;/p&gt;


&lt;p&gt;&lt;em&gt;Note: the &lt;code&gt;rgb()&lt;/code&gt; function is perfectly valid CSS2.1. However the &lt;code&gt;rgba()&lt;/code&gt; function is part of the CSS3 specification and is not supported by all browsers (Internet Explorer 6, 7, 8).&lt;/em&gt;&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;hex&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Hexadecimal &lt;a href=&quot;#hex&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;h3&gt;What is hexadecimal?&lt;/h3&gt;


&lt;p&gt;Most of the time, CSS colors are specified using the hexadecimal format which is a 6 (or 3) characters long string using numbers from 0 to 9 and letters from A to F, starting by the hash sign # (ex: #1A2B3C). We refer as this syntax as a “hex triplet”.&lt;/p&gt;


&lt;p&gt;Okay, but what does this mean? I agree it’s not that simple. Basically, hexadecimal colors are some sort of code for RGB colors: the first two characters stand for the red value; the 3rd and 4th characters stand for greens; and the last two characters are here for the blue.&lt;/p&gt;


&lt;p&gt;Since the range of a 8-bit byte is 256, we usually use a base 16 system to display values. This system is called hexadecimal. So basically those 3*2 digits stand for 3 values from 0 to 255 converted to base 16, as you would do in RGB.&lt;/p&gt;


&lt;p&gt;Okay, I can understand you’re lost here, so we’ll try a little example. Let’s say you want to make a pure red (rgb(255, 0, 0)): thanks to &lt;a href=&quot;http://wims.unice.fr/wims/wims.cgi&quot;&gt;this awesome converter&lt;/a&gt;, you convert 255 to base 16 and know it equals FF. If you try to convert 0, you’ll see it’s 0 as well in base 16. So your hex triplet would be #FF0000. Simple, isn’t it?&lt;/p&gt;


&lt;p&gt;So this was the theory, alright? It doesn’t mean you have to use a base 16 converter every single time you want to use a color in CSS. I’m simply explaining you how are hexadecimal colors composed. Now in real life, you’ll simply use a color palette like Photoshop or whatever.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: you may see some hex triplets reduced to 3 digits instead of 6. It only happens when the two digits of each of the 3 components of the triplet are the same. To apply it on our previous example, the red color (#FF0000) can be written like #F00. If any of the 3 components have 2 different digits, you can’t do this.&lt;/p&gt;


&lt;h3&gt;What about transparency?&lt;/h3&gt;


&lt;p&gt;Alas, you can’t edit the alpha-channel when defining colors in hexadecimal, it’s actually not possible. If ever you really want to change the opacity, you still can turn your hex triplet to a RGBa quadruplet, or use the opacity property.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Important&lt;/strong&gt;: however beware of the opacity property. It changes the opacity of the element itself, and all its child elements. Plus, it is &lt;a href=&quot;http://caniuse.com/#feat=css-opacity&quot;&gt;not supported by Internet Explorer 6, 7 and 8&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;keywords&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Keywords &lt;a href=&quot;#&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;h3&gt;What are color keywords?&lt;/h3&gt;


&lt;p&gt;The fact is, hexadecimal is really unfriendly. Nobody knows what color is associated to a hex triplet at the first glance, because it’s a computed syntax by the machine and for the machine.&lt;/p&gt;


&lt;p&gt;RGB is slightly better, especially when you’re using percentage values but it’s not wonderful either. If I tell you &lt;code&gt;rgb(54%, 69%, 23%)&lt;/code&gt;, can you tell me what color it will be? Even approximately? I guess not.&lt;/p&gt;


&lt;p&gt;That’s why there are keywords. Keywords are real color names like red, green and blue associated to actual RGB / hex triplets. Back in the days, the HTML 4.01 Standard proposed 16 different keywords:&lt;/p&gt;


&lt;ul style=&quot;list-style: none; margin-left: 0;&quot;&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: aqua&quot;&gt;Aqua&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: black; color: white&quot;&gt;Black&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: blue; color: white&quot;&gt;Blue&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: fuchsia;&quot;&gt;Fuchsia&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: gray; color: white&quot;&gt;Gray&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: green; color: white&quot;&gt;Green&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: lime;&quot;&gt;Lime&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: maroon; color: white&quot;&gt;Maroon&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: navy; color: white&quot;&gt;Navy&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: olive; color: white&quot;&gt;Olive&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: purple; color: white&quot;&gt;Purple&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: red; color: white&quot;&gt;Red&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: silver;&quot;&gt;Silver&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: teal; color: white&quot;&gt;Teal&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: white;&quot;&gt;White&lt;/li&gt;
&lt;li style=&quot;padding: 5px; margin-bottom: 2px; background: yellow;&quot;&gt;Yellow&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Then the CSS2.1 specification added the &lt;span style=&quot;background: orange; display: inline-block; padding: 0 5px;&quot;&gt;orange&lt;/span&gt; keyword. Finally, CSS3 came with 130 additional keywords for a total of 147 keywords (134 non-gray, 13 gray).
I won’t list all of them here because it would be too long however, this is a visualization of all of them on a hue wheel by &lt;a href=&quot;http://meyerweb.com/eric/css/colors/hsl-147.html&quot;&gt;Eric Meyer&lt;/a&gt; (see &lt;a href=&quot;http://www.xanthir.com/blog/b4JC0&quot;&gt;annotated version by Tab Atkins Jr.&lt;/a&gt;):&lt;/p&gt;


&lt;p&gt;&lt;img alt=&quot;Color Wheel&quot; src=&quot;/images/css-colors__color-wheel.jpg&quot;/&gt;&lt;/p&gt;

&lt;p&gt;The point of this work is to show keywords are associated to random colors: they are chosen according to their position on the hue wheel.&lt;/p&gt;


&lt;p&gt;Eric Meyer also created a color equivalents table in order to know what keyword is associated to which color, with hexadecimal, RGB (both syntax) and HSL versions you &lt;a href=&quot;http://meyerweb.com/eric/css/colors/&quot;&gt;can find here&lt;/a&gt;.&lt;/p&gt;


&lt;h3&gt;Keywords usage&lt;/h3&gt;


&lt;p&gt;The point of keywords is to use basic colors with words that actually mean something. I say “basic” because most of the time, you’ll want a custom color who doesn’t have a keyword. But whenever you want to use a plain red or a silver grey, you don’t have to use a hex or RGB triplet; you can use the keyword.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: the 147 keywords are all perfectly valid, even on old browsers like Internet Explorer 6.&lt;/p&gt;


&lt;h3&gt;Special keywords&lt;/h3&gt;


&lt;p&gt;There are two keywords which are a little bit special since they do not refer to a RGB triplet. Those are &lt;code&gt;transparent&lt;/code&gt; and &lt;code&gt;currentColor&lt;/code&gt;.&lt;/p&gt;


&lt;h4&gt;Transparent&lt;/h4&gt;


&lt;p&gt;The transparent value exists since CSS1 but was only valid as a value for the background property. Nowadays &lt;code&gt;transparent&lt;/code&gt; is a valid keyword for any property accepting a color value (color, border-color, background, shadows, gradients, etc.).&lt;/p&gt;


&lt;p&gt;Its effect is pretty straight forward: it makes the color (or background-color or whatever) of the element transparent, as it is by default when no color is specified.&lt;/p&gt;


&lt;p&gt;What’s the point you say? To restore the default transparent color if a color value you can’t remove is already set.&lt;/p&gt;


&lt;h4&gt;CurrentColor&lt;/h4&gt;


&lt;p&gt;The currentColor is a CSS3 value allowing you to take the color as a default value for another property. Have a look at the code below.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.my-element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;border-color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;currentColor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;The border will be red since the defined color is red. If no color was set, it would have been black, since the default value for the color property is black.&lt;/p&gt;


&lt;p&gt;You want to know what’s awesome? &lt;code&gt;currentColor&lt;/code&gt; is a default value for a bunch of things. From my tests:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Border-color&lt;/li&gt;
&lt;li&gt;Color component in box-shadow&lt;/li&gt;
&lt;li&gt;Color component in text-shadow&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;It means you can do one of those and be perfectly valid:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.my-element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;border-color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;solid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;   &lt;span class=&quot;c&quot;&gt;/* This will be red */&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;shadow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* This will be red */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;text-shadow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;    &lt;span class=&quot;c&quot;&gt;/* This will be red */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p class=&quot;note&quot;&gt;Note: the cap on the C letter is not required. It’s only a writing convention.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;hsl&quot;&gt;&lt;/p&gt;

&lt;h2&gt;HSL &lt;a href=&quot;#hsl&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;h3&gt;What is HSL?&lt;/h3&gt;


&lt;p&gt;HSL stands for Hue, Saturation and Lightness. Please don’t worry, HSL is not another format of color. It’s only another representation of the RGB model. This cylindric representation aims at showing the RGB model in a more intuitive way than the previous seen cube.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;/images/css-colors__color-hsl.jpg&quot; alt=&quot;Color HSL&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Hue&lt;/h4&gt;


&lt;p&gt;The angle around the central vertical axis of the cylinder corresponds to the “hue”, which is basically the color you want. Take a chromatic wheel: at 0° you have red, at 120° you have green, at 240°you have blue and you go back to red when you reach 360°.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;/images/css-colors__color-wheel.png&quot; alt=&quot;Color Wheel&quot; /&gt;&lt;/p&gt;

&lt;h4&gt;Saturation&lt;/h4&gt;


&lt;p&gt;The distance from the central vertical axis of the cylinder corresponds to “saturation” (also called “chroma”). It can be understood as the quantity of black and white you add to your color. When set to 100%, the color is “pure”, but when you reduce the saturation you’re creating a “mixture”, progressively moving your color to some kind of grey.&lt;/p&gt;


&lt;h4&gt;Lightness&lt;/h4&gt;


&lt;p&gt;The distance along the vertical axis corresponds to the “lightness” (also said “value” or “brightness”). To put it simple, the lightness is there to move your color to white or to black. When you’re making a pure color (like red, blue, orange, etc.), you’ll have lightness to 50%. If you want to darken or lighten your color without turning it into an ugly grey, then you’ll change the lightness value.&lt;/p&gt;


&lt;h3&gt;How do we define HSL colors?&lt;/h3&gt;


&lt;p&gt;To describe a color using the HSL representation, you have to define parameters for hue, saturation and lightness. If you don’t know how to start, this is what I recommand:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Hue&lt;/strong&gt;: choose your color on the chromatic wheel. If it’s red, then the value is 0. If it’s purple, the value would be about 300, and so on.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Saturation&lt;/strong&gt;: if you want a pure color, then the saturation value will be 100%. If you want some kind of grey, try a value lower than 100%.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lightness&lt;/strong&gt;: if you want a pure color, then the lightness value will be 50%. If you want a light color, try something between 50% and 100%. If you want something dark, try below 50%.&lt;/li&gt;
&lt;/ul&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.white&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m white! */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hsl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.black&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m black! */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hsl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* I’m red! */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hsl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p class=&quot;note&quot;&gt;Note: when you want black or white, whatever the hue value you set since it’s not on the wheel. It means &lt;code&gt;hsl(0, 0%, 100%)&lt;/code&gt;, &lt;code&gt;hsl(120, 0%, 100%)&lt;/code&gt; and &lt;code&gt;hsl(240, 0%, 100%)&lt;/code&gt; are all 3 white.&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: the hue value is expressed in degrees but you don’t have to set the unit. Actually you must not set the unit; the parser won’t understand it.&lt;/p&gt;


&lt;h3&gt;What about the alpha-channel?&lt;/h3&gt;


&lt;p&gt;As for RGBa, you can set a value for the alpha-channel on a HSL color. It works exactly the same way RGBa does: it accepts a float value between 0 and 1 such as 0.56.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.parent&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(‘my-picture.jpg’)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.child&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hsla&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;75&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hsl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;system-colors&quot;&gt;&lt;/p&gt;

&lt;h2&gt;System colors &lt;a href=&quot;#system-colors&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;You may or may not have heard about System colors. At first, I didn’t want to talk about them because they are deprecated in the CSS3 specification but I thought it could be interesting to drop a few lines just in a matter of curiosity.&lt;/p&gt;


&lt;p&gt;System colors are a little bit special since they are not matched to a RGB equivalent, at least not directly. They are keywords associated to a color related to the user’s operating system (Windows XP, Mac OS X, Linux Ubuntu, etc.) like &lt;code&gt;buttonFace&lt;/code&gt; or &lt;code&gt;activeBorder&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Since the goal of CSS specifications is to standardize things, you understand why they announced System colors as deprecated. Plus, not all operating systems support all the System color keywords; basically it’s a mess.&lt;/p&gt;


&lt;p&gt;If you want a complete list of system color keywords, please refer to &lt;a href=&quot;https://developer.mozilla.org/fr/docs/CSS/color_value&quot;&gt;this documentation on Mozilla Developer Network&lt;/a&gt;.&lt;/p&gt;


&lt;h2&gt;What to use when?&lt;/h2&gt;


&lt;p&gt;Honestly, this is really up to you. In the end, a RGB triplet is generated, parsed and applied no matter the way you displayed it. The browser parser doesn’t care if you prefer &lt;code&gt;hsl(0, 100%, 50%)&lt;/code&gt; over &lt;code&gt;rgba(255, 0, 0, 1)&lt;/code&gt;.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;c&quot;&gt;/* This will be red, whatever you pick */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#f00&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#ff0000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;rgb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;255&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hsl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;hsla&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%,&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Now if you want my way of doing with colors, here is what I do in most cases:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;RGB&lt;/strong&gt;: by itself, I don’t use RGB since I usually use a color picker giving me hex triplet. But when I need to edit the alpha-channel, I use RGBa of course.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hexadecimal&lt;/strong&gt;: this is what I use the most in real projects. As said above, any web color picker on the internet will give you at least a hex code. It’s kind of the standard.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Keywords&lt;/strong&gt;: I use them either for demos when I don’t care much about the color I pick, or for greyscale like white, black and silver.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HSL&lt;/strong&gt;: I never use HSL because I’m not used to it. It’s a really really good representation of the RGB model but it doesn’t look very intuitive to me so I stick with RGB.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;What I think is really cool with HSL however is the fact you can get a shade instead of another color by tweaking the lightness. This is a thing you can’t do with other syntaxes.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;preprocessors&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Colors ands CSS preprocessors &lt;a href=&quot;#preprocessors&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;CSS preprocessors (at least some of them) provide built-in functions to play with colors. Things like saturate, darken, hue rotation and such. Let me introduce some of them.&lt;/p&gt;


&lt;h3&gt;LESS (&lt;a href=&quot;http://lesscss.org/#-color-functions&quot;&gt;doc&lt;/a&gt;)&lt;/h3&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;lighten&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;               &lt;span class=&quot;c&quot;&gt;/* Makes lighter */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;darken&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;                &lt;span class=&quot;c&quot;&gt;/* Makes darker */&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;saturate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;              &lt;span class=&quot;c&quot;&gt;/* Makes more saturated*/&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;desaturate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;            &lt;span class=&quot;c&quot;&gt;/* Makes less saturated*/&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;fadein&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;                &lt;span class=&quot;c&quot;&gt;/* Makes more opaque */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;fadeout&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;               &lt;span class=&quot;c&quot;&gt;/* Makes more transparent */&lt;/span&gt; 
&lt;span class=&quot;nt&quot;&gt;fade&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;                  &lt;span class=&quot;c&quot;&gt;/* Gives the color 50% opacity */&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;spin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@degrees&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;                     &lt;span class=&quot;c&quot;&gt;/* Rotates the hue wheel 10° */&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;mix&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@color1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@color2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;         &lt;span class=&quot;c&quot;&gt;/* Mixes 2 colors with a default weight of 50% */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;contrast&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@color1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@darkcolor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@lightcolor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Returns @darkcolor if the color is &amp;gt;50% luma (i.e. is a light color) otherwise return @lightcolor */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;h3&gt;Sass (&lt;a href=&quot;http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html&quot;&gt;doc&lt;/a&gt;)&lt;/h3&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;rgba&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;alpha&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;               &lt;span class=&quot;c&quot;&gt;/* Convert a hex color into a RGBa one */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                        &lt;span class=&quot;c&quot;&gt;/* Gets the red component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                      &lt;span class=&quot;c&quot;&gt;/* Gets the green component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                       &lt;span class=&quot;c&quot;&gt;/* Gets the blue component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;mix&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color-1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color-2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;weight&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;])&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Mixes 2 colors together with a default weight of 50% */&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;hue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                         &lt;span class=&quot;c&quot;&gt;/* Gets the hue component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;saturation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                  &lt;span class=&quot;c&quot;&gt;/* Gets the saturation component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;lightness&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                   &lt;span class=&quot;c&quot;&gt;/* Gets the lightness component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;adjust-hue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;degrees&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;/* Rotates the hue wheel */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;lighten&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;/* Makes lighter */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;darken&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;         &lt;span class=&quot;c&quot;&gt;/* Makes darker */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;saturate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;       &lt;span class=&quot;c&quot;&gt;/* Makes more saturated */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;desaturate&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;     &lt;span class=&quot;c&quot;&gt;/* Makes less saturated */&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;grayscale&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                   &lt;span class=&quot;c&quot;&gt;/* Converts to grayscale */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;complement&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                  &lt;span class=&quot;c&quot;&gt;/* Returns the complement */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;invert&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                      &lt;span class=&quot;c&quot;&gt;/* Returns the inverse */&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;alpha&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                       &lt;span class=&quot;c&quot;&gt;/* Gets the alpha component (opacity) */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;opacity&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;                     &lt;span class=&quot;c&quot;&gt;/* Gets the alpha component (opacity) */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;opacify&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;/* Makes more opaque */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;fade-in&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;/* Makes more opaque */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;transparentize&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Makes more transparent */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;fade-out&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;percentage&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;       &lt;span class=&quot;c&quot;&gt;/* Makes more transparent */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;h3&gt;CSS Crush (&lt;a href=&quot;http://the-echoplex.net/csscrush/&quot;&gt;doc&lt;/a&gt;)&lt;/h3&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;h-adjust&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;             &lt;span class=&quot;c&quot;&gt;/* Rotates the hue wheel */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;s-adjust&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;             &lt;span class=&quot;c&quot;&gt;/* Changes the saturation */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;l-adjust&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;             &lt;span class=&quot;c&quot;&gt;/* Changes the lightness */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;a-adjust&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;             &lt;span class=&quot;c&quot;&gt;/* Changes the alpha-channel */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;h3&gt;Stylus (&lt;a href=&quot;http://learnboost.github.com/stylus/docs/bifs.html&quot;&gt;doc&lt;/a&gt;)&lt;/h3&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;          &lt;span class=&quot;c&quot;&gt;/* Gets the red component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;/* Gets the green component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;blue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;         &lt;span class=&quot;c&quot;&gt;/* Gets the blue component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;alpha&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;/* Gets the alpha component */&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;dark&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;         &lt;span class=&quot;c&quot;&gt;/* Makes lighter */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;light&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;        &lt;span class=&quot;c&quot;&gt;/* Makes darker */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;hue&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;          &lt;span class=&quot;c&quot;&gt;/* Gets the hue component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;saturation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;c&quot;&gt;/* Gets the saturation component */&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;lightness&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;    &lt;span class=&quot;c&quot;&gt;/* Gets the lightness component */&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;final-words&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Final words &lt;a href=&quot;#final-words&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;As I was documenting myself to write this article, I understood color stuff is very complicated either in optical, in paint or in digital. Those notions of “hex triplet”, “chromatic wheel”, “base 16”, “alpha” are so abstract we can face some difficulties to understand what they mean, what they represent.&lt;/p&gt;


&lt;p&gt;Thankfully in CSS we don’t have to use a base 16 converter everytime we want to describe a color. Tools do it for us. But this is a really interesting topic, so I’d recommand you read about it. You’d be surprise how huge it can be!&lt;/p&gt;


&lt;p&gt;Anyway, back to CSS, let me (re)introduce you a few awesome tools and resources to help you deal with colors:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://fr.slideshare.net/maxdesign/css3-colors&quot;&gt;CSS3 Colors slides&lt;/a&gt; by Russ Weakley&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://css.coloratum.com/&quot;&gt;CSS Coloratum&lt;/a&gt;, a color converter by Lea Verou&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://tympanus.net/codrops/2012/09/17/build-a-color-scheme-the-fundamentals/&quot;&gt;Build a color scheme: the fundamentals&lt;/a&gt; by Patrick Cox&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://tympanus.net/codrops/2012/11/26/using-transparency-in-web-design-dos-and-donts/&quot;&gt;Using transparency in webdesign: dos and don'ts&lt;/a&gt; by Carrie Cousins&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://tympanus.net/codrops/2012/02/28/principles-of-color-and-the-color-wheel/&quot; title=&quot;Principles of Color and the Color Wheel&quot;&gt;Principles or Color and the Color Wheel&lt;/a&gt; by Carrie Cousins&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://kuler.adobe.com/&quot;&gt;Kuler&lt;/a&gt; by Adobe&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://colorschemedesigner.com/&quot;&gt;Color Scheme Designer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://0to255.com/&quot;&gt;0to255&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://meyerweb.com/eric/css/colors/&quot;&gt;Color Equivalents Table&lt;/a&gt; by Eric Meyer&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.xanthir.com/blog/b4JC0&quot;&gt;CSS Color Keyword Distribution&lt;/a&gt; by Tab Atkins Jr. (&lt;a href=&quot;http://meyerweb.com/eric/css/colors/hsl-147.html&quot;&gt;original work&lt;/a&gt; by Eric Meyer)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.jessechapo.com/posts/Developers-Guide-to-Images.html&quot;&gt;Developers guide to images&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://colour.charlottedann.com/&quot;&gt;Official Brand Colors&lt;/a&gt; by Charlotte Dann&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Thanks a lot for reading this article. If you have any question or feedback, please be sure to share. Also, if you find any mistake, I'd be glad to correct it. ;)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 27 Nov 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/11/27/css-colors/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/11/27/css-colors/</guid>
			</item>
			
		
			
			<item>
				<title>A CSS challenge</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;Yesterday night, I've seen something in my Twitter timeline which excited my curiosity: a CSS challenge. It was proposed by &lt;a href=&quot;https://twitter.com/goetter&quot;&gt;Raphael Goetter&lt;/a&gt;, a famous French front-end developer on &lt;a href=&quot;http://blog.goetter.fr/post/36084887039/tes-pas-cap-premiere-edition&quot; title=&quot;CSS challenge on Raphael Goetter's blog&quot;&gt;his blog&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Since I'm sure you'll be interested in a little CSS riddle (you will, will you?), let me tell you what this is about.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://i.imgur.com/fZkkw.jpg&quot; alt=&quot;CSS challenge&quot;&gt;&lt;/p&gt;

&lt;p&gt;Will you be able to do this (I'm talking about the small line behind the text) following the restrictions below?&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Only one single element (&lt;code&gt;h1&lt;/code&gt;) in the body element&lt;/li&gt;
&lt;li&gt;Element horizontally centered in its parent&lt;/li&gt;
&lt;li&gt;The line is vertically centered on the text&lt;/li&gt;
&lt;li&gt;Both the font size and the text have to be editable without having to edit the line&lt;/li&gt;
&lt;li&gt;Body and/or the element can have a background (image) without changing anything else&lt;/li&gt;
&lt;li&gt;No HTTP request, no image, no JavaScript&lt;/li&gt;
&lt;li&gt;The best browser support the better of course&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I can't wait to see the way you'll figure this out guys. I personally found something with a few downsides sadly. I'm sure some of you will be able to find a kick-ass solution. ;)&lt;/p&gt;


&lt;p&gt;Good luck!&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;solutions&quot;&gt;&lt;/p&gt;

&lt;h2&gt;[Edit] Solutions (November 24th, 2012) &lt;a href=&quot;#solutions&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Thanks for participating! There have been a couple of answers for this trick. Druid of Lûhn proposed &lt;a href=&quot;http://codepen.io/Druid-of-Luhn/details/sclvk&quot;&gt;something&lt;/a&gt; which works but sadly it's pretty awful for SEO since it involves an empty &lt;code&gt;h1&lt;/code&gt; tag.&lt;/p&gt;


&lt;p&gt;Joshua Hibbert &lt;a href=&quot;http://jsfiddle.net/joshnh/3PG8j/&quot;&gt;used linear gradients&lt;/a&gt; to do it (so &lt;a href=&quot;http://codepen.io/raphaelgoetter/pen/dGxvL&quot;&gt;did&lt;/a&gt; Raphael Goetter). This is a clever technique I thought about but didn't give a try. My experience with gradients is not that good.&lt;/p&gt;


&lt;p&gt;Here is the way I &lt;a href=&quot;http://jsfiddle.net/HugoGiraudel/cyeGM/1/&quot;&gt;did it&lt;/a&gt;:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nt&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;hidden&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#ffa&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;h1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;moz&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;box&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;inline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;zoom&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:after&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:before&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1000px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;black&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nt&quot;&gt;h1&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:after&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;So basically, I used both pseudo-elements to create the line. To place them, I set the title to inline-block, and the parent (&lt;code&gt;body&lt;/code&gt;) text-align to center.&lt;/p&gt;


&lt;p&gt;Sadly, a few things suck with this technique, even if it works pretty well:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Parent needs to have &lt;code&gt;text-align: center&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Parent needs to have &lt;code&gt;overflow: auto&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;It requires 2 pseudo-elements&lt;/li&gt;
&lt;li&gt;Pseudo-elements need to have a large width to reach the edge of the screen (~1000px to cover about all screen sizes)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Hopefully the browser support is pretty good, at least way better than the gradient version:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;IE8+&lt;/li&gt;
&lt;li&gt;Firefox 2+&lt;/li&gt;
&lt;li&gt;Chrome&lt;/li&gt;
&lt;li&gt;Safari 3+&lt;/li&gt;
&lt;li&gt;Opera 9+&lt;/li&gt;
&lt;li&gt;iOS Safari 3+&lt;/li&gt;
&lt;li&gt;Opera Mini 5+&lt;/li&gt;
&lt;li&gt;Android Browser 2+&lt;/li&gt;
&lt;li&gt;Blackberry browser 7+&lt;/li&gt;
&lt;li&gt;Opera Mobile 10+&lt;/li&gt;
&lt;li&gt;Chrome for Android&lt;/li&gt;
&lt;li&gt;Firefox for Android&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;But since it's only a tiny design improvement, I'll definitely go with the gradient version on a live project. Thanks for participating. I'll try to drop another challenge soon. :)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 20 Nov 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/11/20/css-challenge/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/11/20/css-challenge/</guid>
			</item>
			
		
			
			<item>
				<title>Learning principles for improving your CSS</title>
				<description>
</description>
				<pubDate>Tue, 20 Nov 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/11/20/codrops-improve-css/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/11/20/codrops-improve-css/</guid>
			</item>
			
		
			
			<item>
				<title>A round-up on CSS playgrounds</title>
				<description>&lt;p&gt;&lt;section id=&quot;playground&quot;&gt;&lt;/p&gt;

&lt;h2&gt;What is a code playground? &lt;a href=&quot;#playground&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;A code playground is an online tool allowing you to do some code, then save and share it. It's often used for quick demos and reduced testcases. It's a good alternative to the old .html file with its embedded &lt;code&gt;&amp;lt;style&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;


&lt;p&gt;Playgrounds are becoming more and more popular and there are a bunch of options when you want to use one. Let me introduce you the most popular ones:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://codepen.io&quot; title=&quot;CodePen&quot;&gt;CodePen&lt;/a&gt; from Chris Coyier, Tim Sabat and Alex Vasquez&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://dabblet.com&quot; title=&quot;Dabblet&quot;&gt;Dabblet&lt;/a&gt; from Lea Verou&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://cssdeck.com&quot; title=&quot;CSSDeck&quot;&gt;CSSDeck&lt;/a&gt; from Rishabh&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://jsfiddle.net&quot; title=&quot;JSFiddle&quot;&gt;JSFiddle&lt;/a&gt; from Oskar Krawczyk&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Basically, they all do more or less the same stuff but each one has its own strengths and weaknesses. So in the end the choice is up to the user. I'd like to give you my opinion on this stuff but first, let's make a little round-up.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;dabblet&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Dabblet &lt;a href=&quot;#dabblet&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Dabblet is an amazing playground&lt;span style=&quot;text-decoration: line-through;&quot;&gt;, however it doesn't support JavaScript. That being said, its author presented Dabblet as a pure CSS playground, so it's not very surprising JavaScript isn't supported&lt;/span&gt;.&lt;/p&gt;


&lt;p&gt;What is a little bit more surprising however is that Dabblet doesn't provide any support for preprocessors, especially CSS ones. Nowadays, it's a pretty big deal when a playground doesn't allow users to code with preprocessors.&lt;/p&gt;


&lt;p&gt;Plus, it seems to be very buggy sometimes. Shortcuts don't work as expected, cursor is boucing to the top of your document, etc. It's too bad because it has a minimalist and cute interface.&lt;/p&gt;


&lt;h3&gt;Pros&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;Live reload&lt;/li&gt;
&lt;li&gt;Prefixfree by default (removable)&lt;/li&gt;
&lt;li&gt;Modulable interface&lt;/li&gt;
&lt;li&gt;User accounts via GitHub: gallery&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Cons&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;text-decoration: line-through&quot;&gt;No JS support&lt;/span&gt; JS tab now in alpha stage&lt;/li&gt;
&lt;li&gt;No preprocessors support&lt;/li&gt;
&lt;li&gt;Cloned GitHub user accounts (followers/following GitHub users)&lt;/li&gt;
&lt;li&gt;Sometimes very buggy&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Resources&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://dabblet.com&quot; title=&quot;Dabblet&quot;&gt;Dabblet&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.dabblet.com/&quot; title=&quot;Blog Dabblet&quot;&gt;Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://twitter.com/dabblet&quot; title=&quot;Dabblet on Twitter&quot;&gt;Dabblet&lt;/a&gt; on Twitter&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;jsfiddle&quot;&gt;&lt;/p&gt;

&lt;h2&gt;JSFiddle &lt;a href=&quot;#jsfiddle&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;JSFiddle is a wonderful playground when it comes to JavaScript development since it provides a wide range of JavaScript libraries, probably more than you'll ever need. Problem is it doesn't use a live reload system meaning you have to hit &quot;Run&quot; everytime you make a change. It's kind of annoying, but for JavaScript prototyping, it's amazing.&lt;/p&gt;


&lt;h3&gt;Pros&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;22 JavaScript libraries available + multiple versions: Mootools, jQuery, Prototype, YUI, Glow, Dojo, Processing.js, ExtJS, Raphael, RightJS, Three.js, Zepto, Eny, Shipyard, Knockout, The X Toolkit, AngularJS, Ember, Underscore, Bonsai, KineticJS, FabricJS&lt;/li&gt;
&lt;li&gt;Highly customizable for JS development&lt;/li&gt;
&lt;li&gt;Built-in options for Normalize.css&lt;/li&gt;
&lt;li&gt;Preprocessors: SCSS (CSS), CoffeeScript (JS), JavaScript 1.7 (JS)&lt;/li&gt;
&lt;li&gt;Easy embedding of external stylesheets / JS scripts&lt;/li&gt;
&lt;li&gt;Doctype accessible&lt;/li&gt;
&lt;li&gt;Numbers versions of your work&lt;/li&gt;
&lt;li&gt;User accounts: gallery&lt;/li&gt;
&lt;li&gt;Mobile debugger&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Cons&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;No live reload&lt;/li&gt;
&lt;li&gt;No HTML preprocessors support&lt;/li&gt;
&lt;li&gt;No built-in option for Prefixfree and Modernizr&lt;/li&gt;
&lt;li&gt;Interface somewhat a bit fixed&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Resources&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://jsfiddle.net&quot; title=&quot;JSFiddle&quot;&gt;JSFiddle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://twitter.com/jsfiddle&quot; title=&quot;JSFiddle on Twitter&quot;&gt;JSFiddle&lt;/a&gt; and &lt;a href=&quot;https://twitter.com/jsfiddlesupport&quot; title=&quot;JSFiddleSupport on Twitter&quot;&gt;JSFiddleSupport&lt;/a&gt; on Twitter&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;cssdeck&quot;&gt;&lt;/p&gt;

&lt;h2&gt;CSSDeck &lt;a href=&quot;#cssdeck&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;CSSDeck is fairly new in the playground scene but it's the only one providing the ability to record your code while you type it in order to have some kind of video. Basically, you can make video tutorial with CSSDeck, which you can't do with other playgrounds.&lt;/P&gt;


&lt;h3&gt;Pros&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;Live reload&lt;/li&gt;
&lt;li&gt;Codecast feature (video coding)&lt;/li&gt;
&lt;li&gt;11 JavaScript libraries available: MooTools, jQuery, jQuery Mobile, Prototype, YUI, Underscore, Backbone, Modernizr, Sencha Touch, Dojo, Bootstrap&lt;/li&gt;
&lt;li&gt;Preprocessors: ZenCoding (HTML), Markdown (HTML), Slim (HTML), Jade (HTML), HAML (HTML), LESS (CSS), Stylus (CSS), SCSS (CSS), Sass (CSS), Compass (CSS), CoffeeScript (JS)&lt;/li&gt;
&lt;li&gt;Built-in options for Prefixfree and Normalize.css&lt;/li&gt;
&lt;li&gt;User accounts via Twitter or GitHub: gallery, likes &amp; follow&lt;/li&gt;
&lt;li&gt;Possibility to make private stuff&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Cons&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;Small community&lt;/li&gt;
&lt;li&gt;Interface sometimes a bit messy&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Resources&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://cssdeck.com&quot; title=&quot;CSSDeck&quot;&gt;CSSDeck&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://twitter.com/cssdeck&quot; title=&quot;CSSDeck on Twitter&quot;&gt;CSSDeck&lt;/a&gt; on Twitter&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;codepen&quot;&gt;&lt;/p&gt;

&lt;h2&gt;CodePen &lt;a href=&quot;#codepen&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;CodePen is one hell of a playground. It provides very strong tools for each of the 3 supported languages and provides awesome features for registered users like personal gallery, tags, forks, likes and follows, various themes, etc.&lt;/p&gt;


&lt;p&gt;Plus, authors pick best pens on the site and feature them on the front page. This way you can have a look at best front-end works outhere without having to search in thousands of pages.&lt;/p&gt;


&lt;h3&gt;Pros&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;Live reload&lt;/li&gt;
&lt;li&gt;8 JavaScript libraries available: jQuery, jQuery UI, Zepto, MooTools, Prototype, YUI, ExtJS, Dojo&lt;/li&gt;
&lt;li&gt;Preprocessors: ZenCoding (HTML), Markdown (HTML), Slim (HTML), HAML (HTML), LESS (CSS), SCSS (CSS), Sass (CSS), CoffeeScript (JS)&lt;/li&gt;
&lt;li&gt;Built-in options for Prefixfree, Normalize.css, Reset.css and Modernizr&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; accessible&lt;/li&gt;
&lt;li&gt;Easy embedding of external stylesheets / JS scripts&lt;/li&gt;
&lt;li&gt;User accounts via GitHub: gallery, likes &amp; follow&lt;/li&gt;
&lt;li&gt;Various themes available&lt;/li&gt;
&lt;li&gt;Tags&lt;/li&gt;
&lt;li&gt;Possibility to fork&lt;/li&gt;
&lt;li&gt;Homepage featuring coolest pens&lt;/li&gt;
&lt;li&gt;A PRO version with special features (teach mode, pair programming and much more)&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Cons&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;Interface somewhat a bit fixed (preview with small height)&lt;/li&gt;
&lt;li&gt;Everything is public without PRO version&lt;/li&gt;
&lt;li&gt;Not registered pens are quickly deleted&lt;/li&gt;
&lt;li&gt;Sometimes buggy with for loops&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;Resources&lt;/h3&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://codepen.io&quot; title=&quot;CodePen&quot;&gt;CodePen&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.codepen.io/&quot; title=&quot;CodePen blog&quot;&gt;Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://twitter.com/codepen&quot; title=&quot;CodePen on Twitter&quot;&gt;CodePen&lt;/a&gt; on Twitter&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;opinion&quot;&gt;&lt;/p&gt;

&lt;h2&gt;What's my opinion &lt;a href=&quot;#opinion&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Honestly, I think &lt;strong&gt;CodePen is far ahead of any other playground outhere&lt;/strong&gt;. All in all, it provides more options than others, it's more stable, less buggy, and far more popular even if it's only 6 months old.&lt;/p&gt;


&lt;p&gt;I used to work a lot in Dabblet but I've always found those tiny little bugs very annoying. Then I switched to JSFiddle but the lack of a live reload was bothering me. Then came CodePen and it was kind of a revelation.&lt;/p&gt;


&lt;p&gt;Shortly after the launch, I spent a huge amount of time on CodePen to play with CSS. Back in the days, I did between 1 and 5 pens a day (inspired from Dribbble), most of them hitting the front page. It was very amusing. Now, I'm not doing much anymore because I use my free time for Codrops as part of articles.&lt;/p&gt;


&lt;p&gt;Anyway, if you'd like to have a glance behind the scenes of CodePen, &lt;a href=&quot;http://davidwalsh.name/codepen-interview&quot; title=&quot;CodePen interview&quot;&gt;David Walsh recently interviewed Chris Coyier about it&lt;/a&gt;. They talk about challenges to get there, technical details and of course what's planned for the future.&lt;/p&gt;


&lt;p&gt;I've made a comparison of these 4 playgrounds as a table for more clarity. Here is &lt;a href=&quot;http://jsfiddle.net/FDDed/13/embedded/result/&quot; title=&quot;Comparison CSS playgrounds&quot;&gt;the JSFiddle&lt;/a&gt;. Yeah, I made a &lt;strong&gt;JSFiddle&lt;/strong&gt;, because on CodePen everything is public, and I don't want to drop those kind of things there. It's probably one of the only bad sides of CodePen, which will be soon gone.&lt;/p&gt;


&lt;iframe style=&quot;width: 100%; height: 500px; margin: 20px 0;&quot; src=&quot;http://jsfiddle.net/FDDed/13/embedded/result/&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;


&lt;p&gt;What about you? What's your favorite CSS playground?&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Mon, 19 Nov 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/11/19/css-playgrounds/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/11/19/css-playgrounds/</guid>
			</item>
			
		
			
			<item>
				<title>One week, first changes</title>
				<description>&lt;p&gt;&lt;section id=&quot;design&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Design &lt;a href=&quot;#design&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;After the launch, it occured to me the design was a bit gloomy so I wanted to add a color to cheer things up. After a dark blue and a creepy green, I ended with the hot pink and a quick survey on Twitter encouraged me to keep it. So pink it is! Hope you like it.&lt;/p&gt;


&lt;p&gt;Speaking of survey, another quick one about text align told me to switch to left. It looks like people dislike when text is justified on blogs. I liked it but I'm not the main reader of this blog. :D&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;development&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Development &lt;a href=&quot;#development&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I was playing with &lt;a href=&quot;http://sass-lang.com/&quot; title=&quot;Sass&quot;&gt;Sass&lt;/a&gt; during the last couple of days and decided it could be cool to build the blog on it, so now it is. Since the site is pretty small, it's no big deal. Actually I used only very few of the potential of Sass (or whatever other CSS preprocessor):&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Nested styles&lt;/li&gt;
&lt;li&gt;A few mixins&lt;/li&gt;
&lt;li&gt;Concatenation and minification of the stylesheets&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Anyway, it's cool.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;features&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Features &lt;a href=&quot;#features&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;h3&gt;Prism.js as a syntax highlighter&lt;/h3&gt;


&lt;p&gt;You may have also noticed I've included &lt;a href=&quot;http://prismjs.com/&quot; title=&quot;Prism&quot;&gt;Prism.js&lt;/a&gt; from Lea Verou on the blog as a syntax highlighter for code snippets. I'm pretty happy with it, I think it makes the code easier to read.&lt;/p&gt;


&lt;p&gt;Only issue I see right now with Prism.js is it has some issues with processed CSS syntax such as LESS and Sass, but it's no big deal.&lt;/p&gt;


&lt;h3&gt;Disqus as a comment system&lt;/h3&gt;


&lt;p&gt;To satisfy a few requests, I agreed on setting up a comment system to allow you to say stuff. Since I decided I won't do any PHP on the site, I had only a few if not one option. Hopefully &lt;a href=&quot;http://disqus.com/&quot; title=&quot;Disqus&quot;&gt;Disqus&lt;/a&gt; is widely spread all around the world now and honestly I would have never done such a wonder so I'm pretty excited about it.&lt;/p&gt;


&lt;p&gt;Depending on how things go I'll have a closer look into options but for now it's far better than anything I would have ever hope for so I'm very happy with it. Then please drop a comment if you have anything to tell. ;)&lt;/p&gt;


&lt;h3&gt;Codrops articles notifications&lt;/h3&gt;


&lt;p&gt;You may or may not have noticed yet but from now on, my articles on Codrops will be featured on the &lt;a href=&quot;index.html&quot; title=&quot;Index blog&quot;&gt;index of the blog&lt;/a&gt;. To distinguish them from other articles, they are annotated with &lt;i class=&quot;icon-tint&quot;&gt;&lt;/i&gt;&lt;span class=&quot;codrops&quot;&gt;[Codrops]&lt;/span&gt;. What do you think? Good idea? Bad idea?&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;to-do&quot;&gt;&lt;/p&gt;

&lt;h2&gt;To do &lt;a href=&quot;#to-do&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I've already made a bunch of tiny bug fixes like broken links, inadequate margins, little issues on mobile but some bugs may persist so if you still find one, please tell me: I'll fix it as soon as possible.&lt;/p&gt;


&lt;p&gt;If you have any suggestion to how we could make this place better, please feel free to speak. By the way I'd like to thanks all of you giving feedbacks and helping me improve this place. It means a lot, keep up! :)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Thu, 15 Nov 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/11/15/one-week-first-changes/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/11/15/one-week-first-changes/</guid>
			</item>
			
		
			
			<item>
				<title>Creative CSS loading animations</title>
				<description>
</description>
				<pubDate>Wed, 14 Nov 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/11/14/codrops-css-animations/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/11/14/codrops-css-animations/</guid>
			</item>
			
		
			
			<item>
				<title>Why I switched from LESS to Sass</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;Yaaay, another blog post on the web about CSS preprocessors, as if there wasn’t enough. Don’t worry: I won’t try to convince you to use a CSS preprocessor, neither about the one you should pick. These decisions are really up to you.&lt;/p&gt;


&lt;p&gt;So this post will be about my own experience with CSS preprocessors. For the concern, I recently wrote an article for Codrops untitled “10 things I learnt about CSS” and I talked a lot about preprocessors, so I’ve read (and tried) a bunch of things on the topic lately.&lt;/p&gt;


&lt;p&gt;Anyway and before anything, please note I’m not a hardcore CSS preprocessor user. I’m more like a novice with these tools, but I’ve already worked a little bit on 2 of them: firstly LESS then Sass. I recently moved from LESS to Sass and don’t plan on going back.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;why-less-as-a-first-try&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Why LESS as a first try &lt;a href=&quot;#why-less-as-a-first-try&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;A few weeks ago, I wanted to have a real shot with CSS preprocessors after hours of playing on &lt;a href=&quot;http://codepen.io&quot;&gt;CodePen&lt;/a&gt; so I read a few things to make a choice. To put it simple, there are currently 4 major CSS preprocessors:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://sass-lang.com/&quot; title=&quot;Sass&quot;&gt;Sass&lt;/a&gt; built on Ruby&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://lesscss.org/&quot; title=&quot;LESS&quot;&gt;LESS&lt;/a&gt; built on JavaScript&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://learnboost.github.com/stylus/&quot; title=&quot;Stylus&quot;&gt;Stylus&lt;/a&gt; built on JavaScript&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://the-echoplex.net/csscrush/&quot; title=&quot;CSS Crush&quot;&gt;CSS Crush&lt;/a&gt; built on PHP&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I’ve never heard much about Stylus so it was not an option to me. I wanted to have a quick access to complete documentation since I was a little bit scared to take the plunge. And even if CSS Crush sounded really cool because I’m familiar with PHP, I’ve read too few on it to consider this as real choice.&lt;/p&gt;


&lt;p&gt;So I had to choose between LESS and Sass like almost everyone else. One thing made the difference in favor of LESS: it could run locally. You see I’m more like a client-side kind of guy. I’m really uncomfortable when it comes to server and command lines, so the fact LESS could be compiled with JavaScript on the fly sounded awesome to me. On the other hand, Sass required to install Ruby and run some command lines and it scared me. So LESS it was.&lt;/p&gt;


&lt;p&gt;I’ve played with LESS a few days, tried a few things and even built my own framework on it. It was really cool to see CSS pushed to an upper level and I was starting to think I could do all my future projects with LESS. Until I realized LESS client-side compilation is awful performance speaking.&lt;/p&gt;


&lt;p&gt;Anyway, that wasn’t the worst thing. I still could learn how to run the server-side part of LESS to compile, or switch to LESSPHP with the help of my brother who uses it at work. No, the worst thing occurred to me when I tried to dig deep down into the entrails of LESS.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;when-i-started-realizing-less-wasnt-the-eldorado&quot;&gt;&lt;/p&gt;

&lt;h2&gt;When I started realizing LESS wasn’t the Eldorado &lt;a href=&quot;#when-i-started-realizing-less-wasnt-the-eldorado&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;One of the first “complicated” thing I tried to create was a mixin handling CSS arrows the same way &lt;a href=&quot;http://cssarrowplease.com/&quot; title=&quot;CSSArrowPlease&quot;&gt;CSSArrowPlease&lt;/a&gt; does. It took me a couple of hours but I finally succeeded and &lt;a href=&quot;https://github.com/HugoGiraudel/LESS-Mixin-for-CSS-arrows&quot; title=&quot;LESS Mixin for CSS arrows&quot;&gt;hosted it on GitHub&lt;/a&gt;. However I noticed something counter-intuitive: conditional statements.&lt;/p&gt;


&lt;h3&gt;LESS and conditional statements&lt;/h3&gt;


&lt;p&gt;The way I wanted to handle my mixin was something which would look like this:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;/* Basic stuff here */&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;    &lt;span class=&quot;err&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Conditional stuff here */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Conditional stuff here */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;   &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Conditional stuff here */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Conditional stuff here */&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;The fact is &lt;strong&gt;LESS doesn’t handle if / else statements&lt;/strong&gt;. Instead, it provides guarded mixins (mixin when a parameter exists or equals / is inferior / is superior to something). So basically, I had to do something like this:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;nc&quot;&gt;.mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;/*Basic stuff here */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;/* Conditional stuff here */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;/* Conditional stuff here */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;/* Conditional stuff here */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;direction&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;/* Conditional stuff here */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;It may look similar at the first glance but it involves a few things:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;it multiplies the number of mixin declarations. It’s not one mixin with conditions, it’s multiple mixins varying according to their parameters,&lt;/li&gt;
&lt;li&gt;it becomes hard to understand when multiple conditions are gathered at once,&lt;/li&gt;
&lt;li&gt;it looks counter-intuitive to me since I would like to do as mentioned earlier.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Anyway, I was just a little frustrated not to be able to use what seems intuitive to me: real if/else conditional statements but all in all I succeeded in doing my mixin so it was not so bad. Things started getting bad when I wanted to do moar.&lt;/p&gt;


&lt;p&gt;For a recent &lt;a href=&quot;http://tympanus.net/codrops/2012/11/14/creative-css-loading-animations/&quot; title=&quot;Creative CSS loading animations&quot;&gt;Codrops article on pure CSS loading animations&lt;/a&gt;, I wanted to include a few things about CSS preprocessors and how they are supposed to be easy to use. Actually, it could have been very very simple if I wasn’t using LESS. One of these things was a loop.&lt;/p&gt;


&lt;h3&gt;LESS and loops&lt;/h3&gt;


&lt;p&gt;Loops are cool: they can handle a huge amount of operations in only a few lines and even if you don’t need them everyday in CSS, it’s cool to have the option to use them. I wanted a loop to set the appropriate animation name on a dozen of elements. This is more or less what I was expecting:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@nbElements&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;lt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@nbElements&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;.my-element&lt;/span&gt;&lt;span class=&quot;nd&quot;&gt;:nth-child&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;animation-name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;loading-&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Well, this is absolutely not how LESS is handling loops. Actually &lt;strong&gt;LESS doesn't handle loops&lt;/strong&gt;; you have to use a recursive function (a function calling itself) in order to reproduce the desired behaviour. This is what I ended up with:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;c&quot;&gt;/* Define loop */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.loop&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@index&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@index&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;gt&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;(~&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;.my-element:nth-child(@{index})&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;loading-@{index}&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;c&quot;&gt;/* Call itself */&lt;/span&gt;
    &lt;span class=&quot;nc&quot;&gt;.loop&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@index&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;/* Stop loop */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.loop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;/* Use loop */&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@nbElements&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.loop&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@nbElements&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;In what universe is this more user-friendly and intuitive than a classic for loop? Is there anyone here who would have thought about this at first? I started thinking LESS was not as perfect as I first thought but sadly, that was still not the worst part.&lt;/p&gt;


&lt;p&gt;Things went very ugly when I wanted to manage @keyframes inside this for loop. Yeah, I know: I like challenge.&lt;/p&gt;


&lt;h3&gt;LESS and concatenation&lt;/h3&gt;


&lt;p&gt;I know concatenation can be somewhat annoying to handle depending on the language, but I was far from thinking LESS was so bad on this topic. First thing I discovered: &lt;strong&gt;you can't use/concatenate a variable as a selector&lt;/strong&gt; without a work-around and &lt;strong&gt;you absolutely can't use a variable as a property name&lt;/strong&gt; in LESS (at least as far as I can tell). Only as a value.&lt;/p&gt;


&lt;p&gt;&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;c&quot;&gt;/* This works */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.my-element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;/* This doesn&amp;#39;t work */&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;@my-element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@my-value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;/* This doesn&amp;#39;t work either */&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;element&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;/* But this works */&lt;/span&gt;
&lt;span class=&quot;o&quot;&gt;(~&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;@{my-element}&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c&quot;&gt;/* And this can&amp;#39;t work */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.my-element&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@my-value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;(~&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;@{my-property}&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;):&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@my-value&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Two very annoying things there: we definitely can't use variables as property names and the concatenation syntax is ugly as hell. &lt;code&gt;(~&quot;@{variable}&quot;)&lt;/code&gt;, really? But actually if you want my opinion, &lt;strong&gt;the biggest mistake they made is to name variables with the at sign @&lt;/strong&gt;.&lt;/p&gt;


&lt;p&gt;It is somewhat well thought out since CSS is using this sign for “alternative stuff” like media queries (@media), animation keyframes (@keyframes) and probably other things in the future (@page for example). I got the reasoning and I admire the will of sticking to the regular CSS syntax.&lt;/p&gt;


&lt;p&gt;But come on... How come they didn’t think about variable concatenations and @keyframes/@page uses inside mixins?&lt;/p&gt;


&lt;p&gt;Basically, LESS fails to understand @page and @keyframes inside mixins because it throws an exception according to &lt;a href=&quot;https://github.com/cloudhead/less.js/blob/b235734a11f646252db8f0947fee406ce67cf904/lib/less/parser.js#L1158&quot; title=&quot;Source LESS&quot;&gt;its source code&lt;/a&gt;. So you'll need two nested mixins: one handling your animation, the second one to handle the keyframes. Sounds heavy and complicated, well it is. So let’s say you want to create a custom mixin using @keyframes and vendor prefixes (not much, right?) this is what you have to do:&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@newline&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;\n&amp;quot;&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;/* Newline */&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.my-mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@selector&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@other-parameters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;/* @selector is the element using your animation &lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;     * @name is the name of your animation&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;     * @other-parameters are the parameters of your animation&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;     */&lt;/span&gt; 

    &lt;span class=&quot;nc&quot;&gt;.keyframe-mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@pre&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@post&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;@vendor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;/* @pre is the newline hack (empty on the first declaration)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;         * @post is a variable fix to detect the last declaration (1 on the last one)&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;         * @vendor is the vendor prefix you want  &lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;         */&lt;/span&gt;

        &lt;span class=&quot;o&quot;&gt;(~&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;@{pre}@@{vendor}keyframes @{name} {@{newline} 0%&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;c&quot;&gt;/* 0% stuff here */&lt;/span&gt; 
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 

        &lt;span class=&quot;nt&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
            &lt;span class=&quot;c&quot;&gt;/* 100% stuff here */&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 

        &lt;span class=&quot;nc&quot;&gt;.Local&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{}&lt;/span&gt;
        &lt;span class=&quot;nc&quot;&gt;.Local&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;when&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;@post&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
            &lt;span class=&quot;o&quot;&gt;(~&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;}@{newline}@{selector}&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
                &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;webkit&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;moz&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;    &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ms&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;     &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;      &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
                &lt;span class=&quot;n&quot;&gt;animation&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;         &lt;span class=&quot;o&quot;&gt;@&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;    
    &lt;span class=&quot;nc&quot;&gt;.Local&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.keyframe-mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;            &lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&amp;quot;-webkit-&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.keyframe-mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(~&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;}@{newline}&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;    &lt;span class=&quot;s2&quot;&gt;&amp;quot;-moz-&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.keyframe-mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(~&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;}@{newline}&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;     &lt;span class=&quot;s2&quot;&gt;&amp;quot;-ms-&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.keyframe-mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(~&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;}@{newline}&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;      &lt;span class=&quot;s2&quot;&gt;&amp;quot;-o-&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nc&quot;&gt;.keyframe-mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(~&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;}@{newline}&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt;         &lt;span class=&quot;s2&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
&lt;span class=&quot;nc&quot;&gt;.my-mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;#whatever&amp;quot;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;other-parameters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Yeah, this is a complete nightmare. I'm not the one who wrote this; I've been searching for hours how to do this before finding &lt;a href=&quot;http://stackoverflow.com/questions/13160991/chaining-keyframe-attributes-with-less&quot; title=&quot;Chaining keyframe attributes with LESS&quot;&gt;a very complete answer&lt;/a&gt; on StackOverflow leading to two others related topic with wonderful answers (&lt;a href=&quot;http://stackoverflow.com/questions/11551313/less-css-pass-mixin-as-a-parameter-to-another-mixin/11589227#11589227&quot; title=&quot;Mixin as a parameter to another mixin&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://stackoverflow.com/questions/9166152/sign-and-variables-in-css-keyframes-using-less-css&quot; title=&quot;Sign and variables in CSS keyframes using LESS CSS&quot;&gt;there&lt;/a&gt;).&lt;/p&gt;


&lt;p class=&quot;note&quot;&gt;Note: the &lt;code&gt;.Local()&lt;/code&gt; thing seems to be a keyword for &quot;this&quot; but I couldn't find any confirmation on this. If you have, please catch me on Twitter.&lt;/p&gt;


&lt;p&gt;So basically, here is what there is to say (&lt;a href=&quot;http://stackoverflow.com/questions/9166152/sign-and-variables-in-css-keyframes-using-less-css/11028622#11028622&quot; title=&quot;Sign and variables in CSS keyframes using LESS CSS&quot;&gt;still not from me&lt;/a&gt;):&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;The initial selector &lt;code&gt;(~&quot;@keyframes @{name}{&quot;) { ... }&lt;/code&gt; renders as &lt;code&gt;@keyframes name { { ... }&lt;/code&gt;&lt;/li&gt;   
&lt;li&gt;To avoid &lt;code&gt;{ {&lt;/code&gt;, it requires a newline which cannot be escaped directly so through the variable &lt;code&gt;@newline: `&quot;\n&quot;`;&lt;/code&gt;. LESS parses anything between backticks as JavaScript, so the resulting value is a newline character.&lt;/li&gt;
&lt;li&gt;Since &lt;code&gt;{ ... }&lt;/code&gt; requires a selector to be valid, we use the first step of the animation (0%).&lt;/li&gt;
&lt;li&gt;But the curly braces do not match. To fix this, we can add a dummy selector in the end, which starts with &lt;code&gt;(~&quot;} dummy&quot;) { .. }&lt;/code&gt;. How ugly is that?&lt;/li&gt;
&lt;li&gt;But wait, we already know that vendor prefixes are going to be added in sequel. So, let the final first selector be &lt;code&gt;(~&quot;@{pre} @@{vendor}keyframes @{name} {@{newline}0%&quot;)&lt;/code&gt;. What a nightmare...&lt;/li&gt;
&lt;li&gt;&lt;code&gt;@{pre}&lt;/code&gt; has to be &lt;code&gt;&quot;}@{newline}&quot;&lt;/code&gt; for every keyframes block after the first one.&lt;/li&gt;
&lt;li&gt;Instead of a dummy selector for the last curly brace, we define the keyframe mixins. We're using a guarded mixin to implement this.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Anyway, this was waaaaay too much for me. &lt;strong&gt;The point of CSS preprocessors is to easy the CSS development, not to make it harder&lt;/strong&gt;. So this is the moment I realized LESS wasn't &lt;em&gt;that&lt;/em&gt; good.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;why-i-think-sass-is-better&quot;&gt;&lt;/p&gt;

&lt;h2&gt;Why I think Sass is better &lt;a href=&quot;#why-i-think-sass-is-better&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I won't make a complete and detailed comparison between Sass and LESS because some guys did it very well already (&lt;a href=&quot;http://css-tricks.com/sass-vs-less/&quot; title=&quot;Sass vs LESS&quot;&gt;Chris Coyier&lt;/a&gt;, &lt;a href=&quot;http://fr.slideshare.net/utbkevin/less-vs-sass-css-precompiler-showdown-14068991&quot; title=&quot;LESS vs SASS CSS precompiler showdown&quot;&gt;Kewin Powell&lt;/a&gt;, etc.). I'll only cover the few points I talked about earlier.&lt;/p&gt;


&lt;h3&gt;Sass and conditional statements&lt;/h3&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@mixin&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;my-mixin&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;parameters&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;c&quot;&gt;/* Basic stuff here */&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;@if&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;my-parameter&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;value&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
        &lt;span class=&quot;c&quot;&gt;/* Conditional stuff here */&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;This is the Sass syntax for conditional statements in a mixin. Okay, it may lack of some brackets but it's way easier than the LESS syntax in my opinion.&lt;/p&gt;


&lt;h3&gt;Sass and loops&lt;/h3&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;k&quot;&gt;@for&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;through&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;10&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;/* My stuff here */&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;p&gt;Once again, it may lack of a few brackets but we still understand very well how it works. It's almost plain language: &lt;em&gt;&quot;for variable i from 1 through 10, do this&quot;&lt;/em&gt;. It looks very intuitive to me.&lt;/p&gt;


&lt;h3&gt;Sass and concatenation&lt;/h3&gt;


&lt;p&gt;Sass has absolutely no problem with concatenation neither in selectors nor in property names. You only have to do this &lt;code&gt;#{$my-variable}&lt;/code&gt; to make things work.&lt;/p&gt;




&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;css&quot;&gt;&lt;span class=&quot;err&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;selector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;err&quot;&gt;#{$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;my&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;my-value&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;




&lt;h3&gt;Other things&lt;/h3&gt;


&lt;p&gt;Very quickly, here are the few things making me tell Sass is better than LESS. Those are well explained in the above links.&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;Sass has &lt;a href=&quot;http://compass-style.org/&quot; title=&quot;Compass&quot;&gt;Compass&lt;/a&gt; which keeps CSS3 support up to date&lt;/li&gt;
&lt;li&gt;Sass provides the &lt;code&gt;@extend&lt;/code&gt; feature allowing you to extend a class from another one&lt;/li&gt;
&lt;li&gt;Sass handles media queries in a better and more advanced ways than others&lt;/li&gt;
&lt;li&gt;Sass throws errors instead of miscalculations when doing operations with units&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;text-decoration: line-through;&quot;&gt;Sass provides a minifying function to compress your CSS files&lt;/span&gt; (so does LESS server-side)&lt;/li&gt;
&lt;li&gt;Sass is slightly more active, development speaking&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;less-is-not-so-bad&quot;&gt;&lt;/p&gt;

&lt;h2&gt;LESS is not so bad &lt;a href=&quot;#less-is-not-so-bad&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Well, I've been moaning about LESS the whole article, but honestly this is not so bad. At least, it's no so bad if you don't plan on complicated and advanced things. Actually there are things LESS are better at, let me tell you my opinion about it:&lt;/p&gt;


&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;text-decoration: line-through;&quot;&gt;LESS provides some really cool color functions (darken, lighten, spin, de/saturate, fade, fadein, fadeout, mix, contrast)&lt;/span&gt; (so does Sass)&lt;/li&gt;
&lt;li&gt;LESS has a nicer and more accessible documentation on &lt;a href=&quot;http://lesscss.org/&quot; title=&quot;LESS&quot;&gt;lesscss.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;LESS is not dependent to either command line skills or a third program&lt;/li&gt;
&lt;li&gt;LESS can be used locally without any install required (simple JS script)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://twitter.github.com/bootstrap/&quot; title=&quot;Twitter Bootstrap&quot;&gt;Twitter Bootstrap&lt;/a&gt; which is probably the biggest framework outhere running thousands of websites is built on LESS; it sounds like a nice proof that LESS is a good CSS preprocessor to me&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Whatsoever, the choice is really up to you. All of this was only my opinion based on my experience. &lt;strong&gt;LESS is still a good CSS preprocessor, but in the end I think Sass is simply better&lt;/strong&gt;.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Tue, 13 Nov 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/11/13/less-to-sass/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/11/13/less-to-sass/</guid>
			</item>
			
		
			
			<item>
				<title>Hugogiraudel.com redesigned + new blog</title>
				<description>&lt;p&gt;&lt;section&gt;&lt;/p&gt;

&lt;p&gt;Hi guys! As you can see, I have big news. I've changed a few things on hugogiraudel.com in order to make it look like a little bit more aesthetic and/or professionnal. What do you say?&lt;/p&gt;


&lt;p&gt;Actually, this is the very recent redesign of &lt;a href=&quot;http://daverupert.com&quot; title=&quot;Dave Rupert&quot; target=&quot;blank&quot;&gt;http://daverupert.com&lt;/a&gt; (nice job by the way) who led me to do such a task. You see, for months (almost years!) and I don't really know why, I thought I had to manage a CMS like WordPress or whatever to handle a blog. But why bother? Simple HTML/CSS pushing on a server and this is done, right?&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;what-for&quot;&gt;&lt;/p&gt;

&lt;h2&gt;A blog, what for? &lt;a href=&quot;#what-for&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;This is a good question since I'm not planning on heavy blogging. You may know I'm a writer for &lt;a href=&quot;http://tympanus.net/codrops/&quot; title=&quot;Codrops&quot;&gt;Codrops&lt;/a&gt; and hell I'm proud of it. Anyway, it takes me a good amount of time, so I won't be able to post things everyday here.&lt;/p&gt;


&lt;p&gt;However, I really wanted a place on the internet to talk about some things I can't write about at Codrops. I'm still talking about web, don't worry. Things like tools, personal experiences, stuff about my work, my side projects, or whatever.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;functioning&quot;&gt;&lt;/p&gt;

&lt;h2&gt;How does this work? &lt;a href=&quot;#functioning&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Actually this is very simple for now, but I'm planning on a few things to improve my workflow in a not so far future. As of today, I'm writing my stuff on Sublime Text in a template file, and then I push them to the server with a FTP client.&lt;/p&gt;


&lt;p&gt;There is no JavaScript (nor jQuery), no plugin, no PHP and no database. Only a tiny little stylesheet. Which means the site is fast, and it matters a lot to me, especially when it comes to mobile browsing.&lt;/p&gt;


&lt;p&gt;Anyway, I'd like to be able to manage things a little better. For example, I'd like to write my articles in &lt;a href=&quot;http://daringfireball.net/projects/markdown/syntax&quot; title=&quot;Markdown&quot;&gt;Markdown&lt;/a&gt; instead of regular HTML. Also, depending on either I post a lot of code snippets or not I may want to add &lt;a href=&quot;http://prismjs.com/&quot; title=&quot;Prism&quot;&gt;Prism.js&lt;/a&gt; for the syntax highlighting.&lt;/p&gt;


&lt;p&gt;I'm currently documenting myself on &lt;a href=&quot;https://github.com/mojombo/jekyll/wiki&quot; title=&quot;Jekyll&quot;&gt;Jekyll&lt;/a&gt; to be able to get rid of the FTP client and manage everything on an upper level, but it will take some time before I make the switch.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;design&quot;&gt;&lt;/p&gt;

&lt;h2&gt;About the design &lt;a href=&quot;#design&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;I know this may look a little flat but I wanted it to be. It's minimalist to focus on the content and nothing else. No fancy buttons, no complex multi-columns layout, no heavy CSS transitions, etc. It's a blog made with the content, for the content. This is why the font-size is huge, the line-height is important, there is a lot of space, and so on.&lt;/p&gt;


&lt;p&gt;But I may improve the design over the time of course. :)&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;
&lt;section id=&quot;to-do&quot;&gt;&lt;/p&gt;

&lt;h2&gt;What's next? &lt;a href=&quot;#to-do&quot; class=&quot;section-anchor&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;


&lt;p&gt;Honestly I don't know. Blogging when I have time and things to say. Maybe a contact page or something.&lt;/p&gt;


&lt;p&gt;For now, I'm not planning on adding a comments system because I don't think there is much need for it. Most people won't take the time to comment anyway, and those who would do can still catch me on &lt;a href=&quot;http://twitter.com/hugoGiraudel&quot; title=&quot;Twitter&quot;&gt;Twitter&lt;/a&gt;. But if one day I feel like I should allow users to comment, I may think about &lt;a href=&quot;http://disqus.com/&quot; title=&quot;Disqus&quot;&gt;Disqus&lt;/a&gt;. Mainly because I don't want to spend hours doing PHP stuff on this.&lt;/p&gt;


&lt;p&gt;Anyway, if you find any bug or have any suggestion, please catch me on GTalk or Twitter.&lt;/p&gt;


&lt;p&gt;&lt;/section&gt;&lt;/p&gt;
</description>
				<pubDate>Fri, 09 Nov 2012 00:00:00 -0800</pubDate>
				<link>http://hugogiraudel.com/2012/11/09/redesign-blog/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/11/09/redesign-blog/</guid>
			</item>
			
		
			
			<item>
				<title>Heading set styling with CSS</title>
				<description>
</description>
				<pubDate>Fri, 02 Nov 2012 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2012/11/02/codrops-headings/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/11/02/codrops-headings/</guid>
			</item>
			
		
			
			<item>
				<title>Kick-start your project: a collection of handy CSS snippets</title>
				<description>
</description>
				<pubDate>Thu, 25 Oct 2012 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2012/10/25/codrops-css-snippets/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/10/25/codrops-css-snippets/</guid>
			</item>
			
		
			
			<item>
				<title>Basic ready-to-use CSS styles</title>
				<description>
</description>
				<pubDate>Tue, 23 Oct 2012 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2012/10/23/codrops-basic-css/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/10/23/codrops-basic-css/</guid>
			</item>
			
		
			
			<item>
				<title>Custom login form styling</title>
				<description>
</description>
				<pubDate>Tue, 16 Oct 2012 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2012/10/16/codrops-login-forms/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/10/16/codrops-login-forms/</guid>
			</item>
			
		
			
			<item>
				<title>CSS Pie Timer</title>
				<description>
</description>
				<pubDate>Fri, 05 Oct 2012 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2012/10/05/css-pie-timer/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/10/05/css-pie-timer/</guid>
			</item>
			
		
			
			<item>
				<title>Custom drop-down list styling</title>
				<description>
</description>
				<pubDate>Thu, 04 Oct 2012 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2012/10/04/codrops-drop-down/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/10/04/codrops-drop-down/</guid>
			</item>
			
		
			
			<item>
				<title>Button switches with checkboxes and CSS3 fanciness</title>
				<description>
</description>
				<pubDate>Thu, 13 Sep 2012 00:00:00 -0700</pubDate>
				<link>http://hugogiraudel.com/2012/09/13/codrops-buttons/</link>
				<guid isPermaLink="true">http://hugogiraudel.com/2012/09/13/codrops-buttons/</guid>
			</item>
			
		
	</channel>
</rss>