<story><title>My favourite 3 lines of CSS</title><url>https://andy-bell.co.uk/my-favourite-3-lines-of-css/</url></story><parent_chain><item><author>zoul</author><text>I am increasingly worried about the “smart” CSS solutions. The spec is already huge, the selectors are hard to read and google, the interplay between various features is devilishly complex. And the CSS community seems to be very fond of these smart hacks where people in the know say “Oh, that’s just Foo’s variation on Bar’s flex owl hammer” and you are left to study the CSS lore for hours to decrypt the two or three letters. I just wish we would value simplicity over cleverness.</text></item></parent_chain><comment><author>thiht</author><text>CSS is one of the languages that everyone shits on because they never bothered to learn it properly. When you learned your programming language of choice you probably read a formal tutorial, or followed a full fledged course. Well once you spend some time &lt;i&gt;learning&lt;/i&gt; CSS, it becomes incredibly easy to do almost everything you want.&lt;p&gt;If you know your basic CSS selectors `.stack &amp;gt; * + *` is very easy to understand. I didn&amp;#x27;t know `* - *` was sometimes referred to as &amp;quot;lobotomized owl selector&amp;quot; but it doesn&amp;#x27;t matter, `&amp;gt;`, `*` and `+` are all basic selectors that everyone working with CSS should know from the top of their head. None of these are &amp;quot;clever&amp;quot;. If you can&amp;#x27;t read `.stack &amp;gt; * + *`, you don&amp;#x27;t know CSS selectors. I&amp;#x27;d even argue if you don&amp;#x27;t use mostly `&amp;gt;` instead of ` ` (space selector) your stylesheets are probably unmaintainable.&lt;p&gt;CSS hacks were a shit show 10 years ago because of browser compatibility, but the thing presented here is not a hack, it&amp;#x27;s just a useful rule.</text></comment>
<story><title>My favourite 3 lines of CSS</title><url>https://andy-bell.co.uk/my-favourite-3-lines-of-css/</url></story><parent_chain><item><author>zoul</author><text>I am increasingly worried about the “smart” CSS solutions. The spec is already huge, the selectors are hard to read and google, the interplay between various features is devilishly complex. And the CSS community seems to be very fond of these smart hacks where people in the know say “Oh, that’s just Foo’s variation on Bar’s flex owl hammer” and you are left to study the CSS lore for hours to decrypt the two or three letters. I just wish we would value simplicity over cleverness.</text></item></parent_chain><comment><author>alwillis</author><text>&amp;gt; I am increasingly worried about the “smart” CSS solutions.&lt;p&gt;I&amp;#x27;m not worried.&lt;p&gt;&amp;gt; The spec is already huge, the selectors are hard to read and google, the interplay between various features is devilishly complex.&lt;p&gt;Actually things are getting &lt;i&gt;less&lt;/i&gt; complex due the fact we don&amp;#x27;t need to use all of the hacks, work-arounds and polyfills that were once just what pretty much every web developer did not that long ago. And of course, the original sin of the misuse of HTML tables for layout.&lt;p&gt;Sure, it wasn&amp;#x27;t fun to deal with new specs coming out while trying to maintain existing code and attempting to understand when (or if) we can use the new stuff. Sometimes is was like trying to fly a plane while the plane is being retrofitted with new features.&lt;p&gt;The irony: many of the techniques described in the article is how we should have been doing things for along time. Hayden&amp;#x27;s article [1], which is the basis for this, was &lt;i&gt;published nearly 10 years ago&lt;/i&gt;—these concepts aren&amp;#x27;t new.&lt;p&gt;[1]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;alistapart.com&amp;#x2F;article&amp;#x2F;axiomatic-css-and-lobotomized-owls&amp;#x2F;&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;alistapart.com&amp;#x2F;article&amp;#x2F;axiomatic-css-and-lobotomized...&lt;/a&gt;</text></comment>