<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for CSS Wizardry</title>
	<atom:link href="http://csswizardry.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://csswizardry.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 17 May 2012 22:13:08 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Keep your CSS selectors short by Christian Krammer</title>
		<link>http://csswizardry.com/2012/05/keep-your-css-selectors-short/#comment-171310</link>
		<dc:creator>Christian Krammer</dc:creator>
		<pubDate>Thu, 17 May 2012 22:13:08 +0000</pubDate>
		<guid isPermaLink="false">http://csswizardry.com/?p=3649#comment-171310</guid>
		<description>I really like, that these &quot;concepts&quot; (although they aren&#039;t actually new) keep popping up everywhere now. SMACSS (http://smacss.com) pretty much goes the same way. However there is one thing I don&#039;t like about adding additional classes to the HTML markup: CSS files get cached after you first load them, HTML files not. But it surely is a good thing to keep selectors short instead of limiting it to certain parent selectors.</description>
		<content:encoded><![CDATA[<p>I really like, that these &#8220;concepts&#8221; (although they aren&#8217;t actually new) keep popping up everywhere now. SMACSS (<a href="http://smacss.com" rel="nofollow">http://smacss.com</a>) pretty much goes the same way. However there is one thing I don&#8217;t like about adding additional classes to the HTML markup: CSS files get cached after you first load them, HTML files not. But it surely is a good thing to keep selectors short instead of limiting it to certain parent selectors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Create a centred horizontal navigation by Andrea</title>
		<link>http://csswizardry.com/2011/01/create-a-centred-horizontal-navigation/#comment-171064</link>
		<dc:creator>Andrea</dc:creator>
		<pubDate>Thu, 17 May 2012 07:50:39 +0000</pubDate>
		<guid isPermaLink="false">http://csswizardry.com/?p=2329#comment-171064</guid>
		<description>Is there a way to make it fixed to the place? (without loosing the center) like the left sidebar in here. Thanks for the post, it&#039;s very very nice.</description>
		<content:encoded><![CDATA[<p>Is there a way to make it fixed to the place? (without loosing the center) like the left sidebar in here. Thanks for the post, it&#8217;s very very nice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Keep your CSS selectors short by Larry Botha</title>
		<link>http://csswizardry.com/2012/05/keep-your-css-selectors-short/#comment-170655</link>
		<dc:creator>Larry Botha</dc:creator>
		<pubDate>Wed, 16 May 2012 08:06:44 +0000</pubDate>
		<guid isPermaLink="false">http://csswizardry.com/?p=3649#comment-170655</guid>
		<description>&lt;a href=&quot;http://csswizardry.com/2012/05/keep-your-css-selectors-short/#comment-170524&quot; rel=&quot;nofollow&quot;&gt;@Brando&lt;/a&gt;: Right to left is far more efficient as the number of iterations of a search for a matching element is greaty reduced.

Imagine you have 1000 divs on a page, and only 1 of them has a child of .my-class. Using a selector such as

&lt;code&gt;div &gt; .my-class { ...styles }&lt;/code&gt;

with left-to-right reading would result in the parser first finding those 1000 divs, and then checking each and every one of those divs to see if they have an immediate child of .my-class.

Right-to-left is far more efficient as the parser simply needs to find that 1 instance of .my-class, and then check whether its immediate parent is a div.

What I&#039;ve started doing for special case margin removal is creating reusable classes like so:

&lt;code&gt;.marginb-none { margin-bottom: 0;}&lt;/code&gt;

If you need different values of margin (which hopefully you won&#039;t), just append a different name:

&lt;code&gt;marginb-alpha { margin-bottom: 2em;}&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><a href="http://csswizardry.com/2012/05/keep-your-css-selectors-short/#comment-170524" rel="nofollow">@Brando</a>: Right to left is far more efficient as the number of iterations of a search for a matching element is greaty reduced.</p>
<p>Imagine you have 1000 divs on a page, and only 1 of them has a child of .my-class. Using a selector such as</p>
<p><code>div &gt; .my-class { ...styles }</code></p>
<p>with left-to-right reading would result in the parser first finding those 1000 divs, and then checking each and every one of those divs to see if they have an immediate child of .my-class.</p>
<p>Right-to-left is far more efficient as the parser simply needs to find that 1 instance of .my-class, and then check whether its immediate parent is a div.</p>
<p>What I&#8217;ve started doing for special case margin removal is creating reusable classes like so:</p>
<p><code>.marginb-none { margin-bottom: 0;}</code></p>
<p>If you need different values of margin (which hopefully you won&#8217;t), just append a different name:</p>
<p><code>marginb-alpha { margin-bottom: 2em;}</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Keep your CSS selectors short by Brando</title>
		<link>http://csswizardry.com/2012/05/keep-your-css-selectors-short/#comment-170524</link>
		<dc:creator>Brando</dc:creator>
		<pubDate>Wed, 16 May 2012 02:39:01 +0000</pubDate>
		<guid isPermaLink="false">http://csswizardry.com/?p=3649#comment-170524</guid>
		<description>Has anyone considered making CSS engines read left-to-right? I mean, surely they must have in the beginning. So, what are the technical reasons behind deciding to go right-to-left?

It seems odd that it might be for efficiency when it&#039;s the very thing that causes our CSS to render inefficiently as sites get complex and we potentially need added complexity. But then I know literally *zero* about the underlying technologies behind the rendering engines.

The reason I bring this up is because I often find myself wanting to write selectors like this:

&lt;code&gt;.sidebar &gt; *:first-child { margin-top: 0; }&lt;/code&gt;

In a sidebar I want the first element -- whichever type it happens to be -- to give up its top margin so that it sits flush inside the sidebar&#039;s element/border/background.

But I can&#039;t do that with a good conscience knowing that the universal selector is slow and that pseudo classes are too. Thus, I ended up with CSS like this:

&lt;code&gt;.sidebar h3, .sidebar p, .sidebar ul, .sidebar ol [...] { margin-top: 0; }&lt;/code&gt;

It may be more efficient to render but it sucks to read and write.

So, then I start wondering if I really need those elements to have top margins in the general sense. And that just strikes me as silly -- all I want is for elements in this &lt;em&gt;one spot&lt;/em&gt; not to have a top margin and now I&#039;m considering removing top margins from them across the entire site!

Surely there has to be a better way... Yes, I&#039;m aware that CSS3 has or will have a selector that would help me here, but I&#039;m more wondering why we have to put up with right-to-left selector matching when it might be nicer to use left-to-right.

Any insights? Thanks!</description>
		<content:encoded><![CDATA[<p>Has anyone considered making CSS engines read left-to-right? I mean, surely they must have in the beginning. So, what are the technical reasons behind deciding to go right-to-left?</p>
<p>It seems odd that it might be for efficiency when it&#8217;s the very thing that causes our CSS to render inefficiently as sites get complex and we potentially need added complexity. But then I know literally *zero* about the underlying technologies behind the rendering engines.</p>
<p>The reason I bring this up is because I often find myself wanting to write selectors like this:</p>
<p><code>.sidebar &gt; *:first-child { margin-top: 0; }</code></p>
<p>In a sidebar I want the first element &#8212; whichever type it happens to be &#8212; to give up its top margin so that it sits flush inside the sidebar&#8217;s element/border/background.</p>
<p>But I can&#8217;t do that with a good conscience knowing that the universal selector is slow and that pseudo classes are too. Thus, I ended up with CSS like this:</p>
<p><code>.sidebar h3, .sidebar p, .sidebar ul, .sidebar ol [...] { margin-top: 0; }</code></p>
<p>It may be more efficient to render but it sucks to read and write.</p>
<p>So, then I start wondering if I really need those elements to have top margins in the general sense. And that just strikes me as silly &#8212; all I want is for elements in this <em>one spot</em> not to have a top margin and now I&#8217;m considering removing top margins from them across the entire site!</p>
<p>Surely there has to be a better way&#8230; Yes, I&#8217;m aware that CSS3 has or will have a selector that would help me here, but I&#8217;m more wondering why we have to put up with right-to-left selector matching when it might be nicer to use left-to-right.</p>
<p>Any insights? Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Keep your CSS selectors short by Harry Roberts</title>
		<link>http://csswizardry.com/2012/05/keep-your-css-selectors-short/#comment-170416</link>
		<dc:creator>Harry Roberts</dc:creator>
		<pubDate>Tue, 15 May 2012 21:02:13 +0000</pubDate>
		<guid isPermaLink="false">http://csswizardry.com/?p=3649#comment-170416</guid>
		<description>&lt;a href=&quot;http://csswizardry.com/2012/05/keep-your-css-selectors-short/#comment-170409&quot; rel=&quot;nofollow&quot;&gt;@Matt&lt;/a&gt;: I&#039;m not sure I follow; I&#039;m saying neep nesting is bad and should be avoided, a class like &lt;code&gt;.nav&lt;/code&gt; &lt;em&gt;is&lt;/em&gt; modular and can be extended (see http://csswizardry.com/2011/09/the-nav-abstraction/ )

&lt;blockquote&gt;&lt;p&gt;&quot;I would argue specifying containers helps not only understand how the styles work, but how the application implements these styles.&quot;&lt;/p&gt;&lt;/blockquote&gt;

But they should work &lt;em&gt;without&lt;/em&gt; those containers; needing the containers in your CSS is a bad thing and should be avoided.

I am afraid I really don&#039;t think I follow your points.

Best, and apologies,
H</description>
		<content:encoded><![CDATA[<p><a href="http://csswizardry.com/2012/05/keep-your-css-selectors-short/#comment-170409" rel="nofollow">@Matt</a>: I&#8217;m not sure I follow; I&#8217;m saying neep nesting is bad and should be avoided, a class like <code>.nav</code> <em>is</em> modular and can be extended (see <a href="http://csswizardry.com/2011/09/the-nav-abstraction/" rel="nofollow">http://csswizardry.com/2011/09/the-nav-abstraction/</a> )</p>
<blockquote><p>&#8220;I would argue specifying containers helps not only understand how the styles work, but how the application implements these styles.&#8221;</p>
</blockquote>
<p>But they should work <em>without</em> those containers; needing the containers in your CSS is a bad thing and should be avoided.</p>
<p>I am afraid I really don&#8217;t think I follow your points.</p>
<p>Best, and apologies,<br />
H</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Keep your CSS selectors short by Matt Lo</title>
		<link>http://csswizardry.com/2012/05/keep-your-css-selectors-short/#comment-170409</link>
		<dc:creator>Matt Lo</dc:creator>
		<pubDate>Tue, 15 May 2012 20:29:32 +0000</pubDate>
		<guid isPermaLink="false">http://csswizardry.com/?p=3649#comment-170409</guid>
		<description>Hey Harry

One thing I&#039;d like to make a point is on the concept of deep level selector definitions in stylesheets. You made the example of using root level rule in replace of a specific four level deep selector. (`.nav{}` vs `html body .header .nav{}`)

The concern here is you cannot be modular. Take the simple example of a header and footer navigation In my opinion the class label for /both/ the header and footer container should be `nav`. If you&#039;re trying to reuse styles, wouldn&#039;t it be more rules and an increased level of obscurity if selectors are all of a sudden agents of ID selectors? 

Another concern with your statement is code readability, I would argue specifying containers helps not only understand how the styles work, but how the application implements these styles. The lower the learning curve, the easier the handoff is (unless you&#039;re a one man show)

I understand your point about browser efficiency (which makes a great point on mobile devices) and it makes a lot of sense to be aware of your application&#039;s footprint but that doesn&#039;t warrant a code style change (not saying we have to anyways!). Having augmented namespaces, improved stylesheet readability, and lightweight rule reusability  can be achieved without changing the style of coding. 

If your site is large enough where /this/ becomes an issue or if this is a large app on a mobile device, more likely a preprocessor that compresses and updates your styles and markup would be a very viable solution (look at Gmail as an example). `html body .header .nav{}` would become `.aA{}` and the output markup would changed. In addition to a build process for enterprise level applications, you can configure it to combine on all styles to `aA` without touching any of your code base.

Performance can be improved without compromising conceptual coding guidelines and best practices. Especially in the CSS realm. All in all, I would say `html body .header .nav{}` is less obscured than `.nav{}`, which is the primary point.

What are your thoughts?

-Matt</description>
		<content:encoded><![CDATA[<p>Hey Harry</p>
<p>One thing I&#8217;d like to make a point is on the concept of deep level selector definitions in stylesheets. You made the example of using root level rule in replace of a specific four level deep selector. (`.nav{}` vs `html body .header .nav{}`)</p>
<p>The concern here is you cannot be modular. Take the simple example of a header and footer navigation In my opinion the class label for /both/ the header and footer container should be `nav`. If you&#8217;re trying to reuse styles, wouldn&#8217;t it be more rules and an increased level of obscurity if selectors are all of a sudden agents of ID selectors? </p>
<p>Another concern with your statement is code readability, I would argue specifying containers helps not only understand how the styles work, but how the application implements these styles. The lower the learning curve, the easier the handoff is (unless you&#8217;re a one man show)</p>
<p>I understand your point about browser efficiency (which makes a great point on mobile devices) and it makes a lot of sense to be aware of your application&#8217;s footprint but that doesn&#8217;t warrant a code style change (not saying we have to anyways!). Having augmented namespaces, improved stylesheet readability, and lightweight rule reusability  can be achieved without changing the style of coding. </p>
<p>If your site is large enough where /this/ becomes an issue or if this is a large app on a mobile device, more likely a preprocessor that compresses and updates your styles and markup would be a very viable solution (look at Gmail as an example). `html body .header .nav{}` would become `.aA{}` and the output markup would changed. In addition to a build process for enterprise level applications, you can configure it to combine on all styles to `aA` without touching any of your code base.</p>
<p>Performance can be improved without compromising conceptual coding guidelines and best practices. Especially in the CSS realm. All in all, I would say `html body .header .nav{}` is less obscured than `.nav{}`, which is the primary point.</p>
<p>What are your thoughts?</p>
<p>-Matt</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Front-Trends 2012 by Michael Gunner</title>
		<link>http://csswizardry.com/2012/04/front-trends-2012/#comment-170282</link>
		<dc:creator>Michael Gunner</dc:creator>
		<pubDate>Tue, 15 May 2012 13:47:27 +0000</pubDate>
		<guid isPermaLink="false">http://csswizardry.com/?p=3626#comment-170282</guid>
		<description>Harry, any plans for anything UK based? I&#039;m aching to lose my web conference virginity. Feel I have a lot to learn, and give!</description>
		<content:encoded><![CDATA[<p>Harry, any plans for anything UK based? I&#8217;m aching to lose my web conference virginity. Feel I have a lot to learn, and give!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Creating a pure CSS dropdown menu by Jonas</title>
		<link>http://csswizardry.com/2011/02/creating-a-pure-css-dropdown-menu/#comment-169777</link>
		<dc:creator>Jonas</dc:creator>
		<pubDate>Mon, 14 May 2012 12:31:50 +0000</pubDate>
		<guid isPermaLink="false">http://csswizardry.com/?p=2547#comment-169777</guid>
		<description>Anyone know how to make a drop-UP menu? :)
Tried some differences.. but can&#039;t find any good sollution..</description>
		<content:encoded><![CDATA[<p>Anyone know how to make a drop-UP menu? :)<br />
Tried some differences.. but can&#8217;t find any good sollution..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The single responsibility principle applied to CSS by tomandyourmom</title>
		<link>http://csswizardry.com/2012/04/the-single-responsibility-principle-applied-to-css/#comment-169692</link>
		<dc:creator>tomandyourmom</dc:creator>
		<pubDate>Mon, 14 May 2012 08:55:12 +0000</pubDate>
		<guid isPermaLink="false">http://csswizardry.com/?p=3614#comment-169692</guid>
		<description>I&#039;d imagine it is your newness, to be honest.  With only two years under your belt, you likely haven&#039;t had to deal with any massive projects yet.  You haven&#039;t had to deal with projects where separation of concerns and page-load efficiency really matter, which is where a more &quot;correct&quot; approach to CSS starts to really pay off.

Like you said though, it&#039;s all about what works for you, and if you&#039;ve found a way of working that works for you (at least for now), go for it! :-)

t</description>
		<content:encoded><![CDATA[<p>I&#8217;d imagine it is your newness, to be honest.  With only two years under your belt, you likely haven&#8217;t had to deal with any massive projects yet.  You haven&#8217;t had to deal with projects where separation of concerns and page-load efficiency really matter, which is where a more &#8220;correct&#8221; approach to CSS starts to really pay off.</p>
<p>Like you said though, it&#8217;s all about what works for you, and if you&#8217;ve found a way of working that works for you (at least for now), go for it! :-)</p>
<p>t</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The single responsibility principle applied to CSS by esaborit</title>
		<link>http://csswizardry.com/2012/04/the-single-responsibility-principle-applied-to-css/#comment-169425</link>
		<dc:creator>esaborit</dc:creator>
		<pubDate>Sun, 13 May 2012 17:37:11 +0000</pubDate>
		<guid isPermaLink="false">http://csswizardry.com/?p=3614#comment-169425</guid>
		<description>Then, I must be the strangest of all web developers to you, or maybe I&#039;m too newbie (I&#039;ve been working on the webs only for two years).
At the begining, when I started to work with my first team, I thought that it was better to use the more specific CSS classes in my HTML code because it was hyper semantic.
But later, few months ago, when OOCSS came across to my geek readings, I realised that, as W3C ignores the semantics placed on the class attribute, it would be more effective to use just the semantics that count (appropiate HTML tags) and get a looser CSS in favour of reuse.

I respect Less and Sass, but they look a bit artificial to me. At the end, they just generate plain CSS code and, for me, writting all the CSS sheets it&#039;s not a big pain.

Maybe it&#039;s just about preferences. I think the aproach to OOCSS explained above and CSS processors, are both elegant and professional solutions. Unlogic wild CSS is not.

See you.</description>
		<content:encoded><![CDATA[<p>Then, I must be the strangest of all web developers to you, or maybe I&#8217;m too newbie (I&#8217;ve been working on the webs only for two years).<br />
At the begining, when I started to work with my first team, I thought that it was better to use the more specific CSS classes in my HTML code because it was hyper semantic.<br />
But later, few months ago, when OOCSS came across to my geek readings, I realised that, as W3C ignores the semantics placed on the class attribute, it would be more effective to use just the semantics that count (appropiate HTML tags) and get a looser CSS in favour of reuse.</p>
<p>I respect Less and Sass, but they look a bit artificial to me. At the end, they just generate plain CSS code and, for me, writting all the CSS sheets it&#8217;s not a big pain.</p>
<p>Maybe it&#8217;s just about preferences. I think the aproach to OOCSS explained above and CSS processors, are both elegant and professional solutions. Unlogic wild CSS is not.</p>
<p>See you.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

