Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K

    Harry Roberts

    csswizardry.com · Personal blog · on HN since 2008

    Harry Roberts is a front-end consultant who writes about CSS, BEM naming, and web performance.

    Visit blogRSSHN submissions
    Web DevelopmentSystems & Performance
    What HN says

    Commenters cite his CSS and network performance post when discussing render-blocking CSS, and mention his BEM article as having solid principles.

    Stats for nerds
    140HN people shared it
    124linked in comments
    2.2Kstory points
    Jul 2025last shared
    2009people per year2025

    Top posts on HN

    1. 1
      Little Things I Like to Do with Git
      2 people · 691 points · first shared 2017 · 103 comments on HN
    2. 2
      Shame.css
      5 people · 264 points · first shared 2013 · 55 comments on HN
    3. 3
      The Fastest Google Fonts
      1 person · 225 points · first shared 2020 · 149 comments on HN
    4. 4
      Self-host your static assets (2019)
      4 people · 118 points · first shared 2019 · 56 comments on HN
    5. 5
      Critical CSS? Not So Fast
      2 people · 98 points · first shared 2022 · 87 comments on HN
    6. 6
      Front-end performance for web designers and front-end developers
      4 people · 88 points · first shared 2013 · 14 comments on HN
    7. 7
      Writing efficient CSS selectors
      3 people · 88 points · first shared 2013 · 40 comments on HN
    8. 8
      The real HTML5 boilerplate
      4 people · 84 points · first shared 2011 · 30 comments on HN
    9. 9
      Making Cloud.typography Faster
      2 people · 80 points · first shared 2019 · 21 comments on HN
    10. 10
      Inuit.css - Another CSS framework
      2 people · 72 points · first shared 2011 · 26 comments on HN

    What HN people wrote when they linked it

    • AltruisticGapHNJan 2022

      This is not a goods approach imho.

      When I'm the html/css guy on a team, it makes my work super frustrating to have to deal with devs who preemptively try to break down everything into smaller bits. It gets in the way of iteratively improving my templates and css throughout a project.

      The solution is simple.

      First, you should use the "bottom margins only" approach wherever possible, cf. CSS best practice "use single directions margins only".

      https://csswizardry.com/2012/06/single-direction-margin-declarations/

      If the Vue/React devs I worked this even understood just this, and put single direction margins in their components, there would be less issues already with collapsed margins and/or unintended vertical spacings.

      Even better, just get rid of the spacing margins in the component altogether as the article suggest. But instead of creating more abstraction with "spacer" components, you simply add tailwind-style classes on your components such as list items, in the PARENT component's template.

      Then the html/css guy till has full control over the templating, it's fluid and simple to edit, and there is no headaches with abstract "spacer" components that also add unnecessary complexity and indentation in the templates.

      The main issue with "spacer" components is that in the end, the design is never this regular, There are always exceptions to the rule, and they are much more easily handled as I said by using atomic css classes like tailwind's `mb-*` in the PARENT template…

    • paulojreisOct 2015

      I can tell we're aligned regarding CSS architecture - and also regarding Angular. :)

      The style guide you linked is very clear and concise in explaining why BEM is great without being a panacea - it's ugly, but it's simple, predictable and solves many of the issues which arise with CSS nature (e.g. everything in CSS is global). I also liked the emphasis on having BEM as a naming convention, no more.

      Regarding how you introduce BEM, I would only:

      * Reinforce the idea that a BEM compliant worflow would typically allow developers to change mark-up without having to look up stylesheets and vice-versa;

      * Reinforce how much it would typically reduce side-effects!

      I'd also give a few words on the topic of using the preprocessor (mixins, extends and, obviously, variables) to achieve DRYness.

      * My argument to my team was to have readable semantic and obvious classnames (without style references in the name, e.g. no .blue-widget) which are "composed" via SASS (and SASS constructs might have style references in the name e.g. my-button @extends %blue-button);

      * The other argument, and the one I actually believe `philosophically is that this allows you transfer the object-composition duty from the browser to the build process. It just makes sense to me: why have thousands of clients composing styles (e.g. button class="btn btn-lg btn-primary") when this is predictable ahead-of-time (button class="my-btn", where .my-btn = @make-btn(lg, primary)). This gives you performance and, as I…

    • akkartikFeb 2016

      Seriously. To my sibling comments: show me an article about how great lisp or vim is that takes 2.5k words to get to its position statement. That's an introduction that's 50% of the length of the article! I don't mind long articles, but ill-proportioned intros seem like a bad idea.

      Incidentally, that position statement is ridiculously vague and anodyne:

      Principles of the New Web Typography

      1. We must prioritise the text over the font, or semantics over style.

      2. We ought to use and/or make tools that reveal the consequences of typographic decisions.

      3. We should acknowledge that web typography is only as strong as its weakest point.

      Who's going to disagree with these? As best I can tell, these translate to:

      1. Don't be afraid to show sub-optimal typography until your nicer font loads. Physical books never had to worry about load times.

      2. Write better tools and share them. For now use Tachyons or Basscss, as a modern equivalent of a https://en.wikipedia.org/wiki/Type_case.

      3. Try to keep your CSS selectors about the same length[1]. Read and internalize http://csswizardry.com/2014/10/the-specificity-graph.

      Like parent, I say all this with love. If it got me to read it all (albeit over the course of a day), it's doing something right.

      [1] I'm not sure about this, since http://cssguidelin.es/#specificity seems to suggest that specificity is the number of tags in your html that are selected by a selector. But that doesn't seem to be quite what OP means, unless I…

    • LoonyPandoraMar 2012

      The issue I took was that in the HN submission you position them as best practices, but when questioned on them you said they are just guidelines that don't have to be followed all the time. This disagrees with your own views on what best practices are [1].

      Perhaps it was just a badly phrased submission title, but it set the tone and direction of the discussion. The title effectively told people they are doing CSS wrong. People don't like to be wrong, and will go to great lengths to prove themselves right [2]. It's nothing personal and I bet if the title was less preachy, it would have gathered more productive comments and had a friendly tone.

      In general your articles are high quality and the advice sound. I think this issue was caused solely by a bad title. Though I still don't understand why you hate IDs so much!

      [1] http://csswizardry.com/2011/12/on-html-and-css-best-practices/

      [2] http://xkcd.com/386/

    • bybjornDec 2013

      Seems like what you're describing here is BEM (Block/Element/Modifier) - those interested can read more about it here:

      http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/

      Basically it's anti-nesting and proposes being very specific with regards to class naming:

      .block{}
      .block__element{}
      .block--modifier{}

      I've experimented a bit with this lately but haven't come to a conclusion yet myself. Yes, it does decrease the chances of accidently styling the wrong elements, but it also makes the html more verbose and can in some cases make it more difficult to implement the website w/jQuery (because of the different classes in use, ie. instead of a .selected class you might have .selected__orange, .selected__apple so to switch the selected item you can't just do an .removeClass('selected')/.addClass('selected)

    • thirdsunSep 2017

      I like the Learn Enough tutorials and recommend them particularly for newcomers that like to find an introduction and overview to a topic. In this case the HTML and CSS / layout courses should be relevant:

      - HTML: https://www.learnenough.com/html-tutorial

      - CSS & Layout: https://www.learnenough.com/css-and-layout-tutorial

      However the CSS tutorial doesn't include CSS Grid yet, which is pretty much essential these days and therefor requires further reading elsewhere. CSS Grid is a major milestone for layout on the web. Don't miss it.

      Additionally another important aspect that is often overlooked: Naming things in CSS. Since you're working with a global namespace it's important to find a sane naming system. I recommend BEM, which is easy to grasp: https://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/

    Related

    Philip Waltonphilipwalton.com105 people

    Solved by Flexbox

    Philip Walton
    Personal · last shared 2026
    Ben Frainbenfrain.com28 people

    Enduring CSS: writing style sheets for rapidly changing, long-lived projects

    Ben Frain
    Personal · last shared 2026
    Bram.usbram.us47 people

    YAML: The Norway Problem (2022)

    Bram.us
    Personal · last shared 2026
    Forrest Smithforrestthewoods.com57 people

    Simpson’s Paradox (2016)

    Forrest Smith
    Personal · last shared 2026
    Performance Calendarcalendar.perfplanet.com123 people

    HTML and CSS techniques to reduce your JavaScript

    Performance Calendar
    Publication · last shared 2026
    Peter Bengtssonpeterbe.com38 people

    How much faster is Redis at storing a blob of JSON compared to Postgres?

    Peter Bengtsson
    Personal · last shared 2026
    Warpspirewarpspire.com49 people

    Pixels don’t care

    Warpspire
    Personal · last shared 2026
    Alistair Cockburnalistair.cockburn.us50 people

    Characterizing people as non-linear 1st order components in software development

    Alistair Cockburn
    Personal · last shared 2026