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
    B

    Bits of Code

    bitsofco.de · Personal blog · on HN since 2015

    Ire Aderinokun writes web development tutorials on CSS, JavaScript, HTML, and browser features such as grid layout and service workers.

    Visit blogHN submissions
    Web DevelopmentDesign & UX
    What HN says

    Commenters link it as a clear reference for CSS Grid, srcset and sizes, service workers, and HTML outlines.

    Stats for nerds
    40HN people shared it
    43linked in comments
    659story points
    Aug 2021last shared
    2017people per year2021

    Top posts on HN

    1. 1
      Linting HTML using CSS
      2 people · 327 points · first shared 2017 · 49 comments on HN
    2. 2
      What I wish I knew about React
      1 person · 236 points · first shared 2020 · 290 comments on HN
    3. 3
      I created 488 “live images” of CanIUse using puppeteer
      1 person · 15 points · first shared 2019 · Discussion on HN
    4. 4
      The :target Trick
      2 people · 9 points · first shared 2016 · Discussion on HN
    5. 5
      Asynchronous Functions 101
      2 people · 7 points · first shared 2017 · Discussion on HN
    6. 6
      A look at CSS Resets in 2018
      1 person · 6 points · first shared 2018 · Discussion on HN
    7. 7
      [JS] You might not need a loop
      2 people · 5 points · first shared 2018 · Discussion on HN
    8. 8
      What Is First Input Delay?
      2 people · 4 points · first shared 2018 · Discussion on HN
    9. 9
      What, exactly, is the DOM?
      1 person · 4 points · first shared 2018 · Discussion on HN
    10. 10
      3 New CSS Features to Learn in 2017
      1 person · 4 points · first shared 2017 · Discussion on HN

    What HN people wrote when they linked it

    • ggreerNov 2018

      It took me a while to figure out that links in the text were ALL CAPS instead of underlined and/or blue. The hover effect was so subtle that I didn't notice it at first. I ended up hovering over acronyms pretty often, as I was never sure if those were also links. That is not good design.

      There's also the issue that while the site may look pretty, it requires downloading 5 megabytes of CSS.

      At every job I've had, designers who talked about typography created more problems than they solved. They picked fonts that were less readable but more unique, "To emphasize our brand." They chose web fonts that hurt page load times and had kerning and hinting issues on platforms besides macOS. They chose thin font weights and gray text colors because those looked nice when viewed indoors on retina displays with young eyes.

      Almost every site could be improved by doing less with fonts, not more. For long form text, use a popular serif font. For user interfaces, use the system font stack.[1] Don't ship web fonts except for icons. Most importantly: Use high contrast and normal font weights. Thin gray fonts are extremely hard to read if you're outdoors or using an older/cheaper screen.

      1. https://bitsofco.de/the-new-system-font-stack/

    • CyberdogAug 2021

      This is some pretty powerful stuff. Here's a more information-dense and up-to-date rundown of srcset and sizes: https://bitsofco.de/the-srcset-and-sizes-attributes/

      Notably, it shows how it's possible to use different images based on a portrait or landscape layout of the viewport, which OP doesn't cover. That's not always useful but it's good to know it's there when you might want to use it.

      I was recently (well, several months ago) tasked with improving the Google PageSpeed scores on mobile for a site which has a lot of image-heavy pages. The end solution involved adapting all images to use a <picture> image with a WebP alternative for browsers that can show it (Google's tools like it when you use their near-proprietary image format; go figure), plus using srcset and sizes (which can be used on <source> tags inside of <picture> tags as well as <img> tags) plus a script which resizes and caches resized versions of large images based on URL parameters (basically an ersatz Glide [0]; I wish I had known it existed when I started). The end result severely reduced page weight for mobile visitors and was successful in raising our PageSpeed scores and appeasing my client.

      [0]: https://glide.thephpleague.com

    • RobertRobertsFeb 2018

      Yes, but grid/css is _designed_ for layout. Tables was a bastardization of markup designed for data display. (ie, a table of data, like in a spreadsheet)

      Unless you have truly dug into how awesome grid is, you can't really understand what it's done for the future of web design.

      I will look up a short tutorial I ran into that really showed me the power/value of grid. (fyi, I use CSS daily in my work)

      Edit: Here's one example. You could use tables, but this is incredibly flexible and with media queries you can completely manipulate the layout and position of the design based on the screen size. And the markup is incredibly light, it's fabulous for those of us who want more control and less work to do, _and_ less debugging of browser quirks.

      https://bitsofco.de/github-contribution-graph-css-grid/

    • mjgsApr 2021

      I was thinking that a service worker could be used:

      https://bitsofco.de/web-workers-vs-service-workers-vs-worklets/#service-workers

      If the url returns a 404, check the internet archive, if it’s there then return that otherwise return a 404.

      If CORS is an issue just proxy the requests via the server that is serving the website.

    • detaroApr 2017

      For a relatively standard problem (the "holy grail layout", 3 equal-height columns with header and footer), this article isn't bad: https://bitsofco.de/holy-grail-layout-css-grid/

      http://gridbyexample.com/ is another nice resource.

    • cornyFeb 2017

      It looks like that method is now deprecated in HTML 5.1.
      https://bitsofco.de/document-outlines-in-html-5-1/

    Related

    Jonathan Snooksnook.ca61 people

    Going Simple with JavaScript

    Jonathan Snook
    Personal · last shared 2026
    Dev.Operadev.opera.com159 people

    CSS: It was twenty years ago today

    Dev.Opera
    Company · last shared 2024
    A List Apartalistapart.com667 people

    The future of web software is HTML over WebSockets

    A List Apart
    Publication · last shared 2026
    Josh W. Comeaujoshwcomeau.com199 people

    CSS Gradients that avoid the “gray dead zone”

    Josh W. Comeau
    Personal · last shared 2026
    Jake Archibaldjakearchibald.com191 people

    I discovered a browser bug

    Jake Archibald
    Personal · last shared 2026
    2ality2ality.com267 people

    Temporal: Getting started with JavaScript's new date time API

    2ality
    Personal · last shared 2026
    Ilya Grigorikigvita.com177 people

    Chrome DevTools could do that?

    Ilya Grigorik
    Personal · last shared 2026
    Bram.usbram.us47 people

    YAML: The Norway Problem (2022)

    Bram.us
    Personal · last shared 2026