Small, native web tricks worth remembering

(htmlcat.net)

51 points | by marcomezzavilla 1 hour ago

4 comments

  • moontear 1 hour ago
    There are some good descriptions and hints, but what the site really needs is examples. Just looking at the code doesn't help me much. The descriptions are also mostly so short, that they could just as well be tooltips on the homepage. The whole premise of the page is a collection of "web tricks worth remembering" and I can't fathom what bash (e.g. `du -hd 1 . | sort -hr`) is doing there.
    • marcomezzavilla 1 hour ago
      You’re absolutely right, thanks for the feedback. I initially included live examples (mostly through CodePen), but they were taking too much time to maintain, so I stopped.

      The Bash entry was really just a half-finished personal note that I never properly edited. It’s probably out of scope too.

      • sam_lowry_ 49 minutes ago
        Please keep it, personal notes are worth it. Maybe less navigation or +/- voting, then ranking would help us navigate your site?

        Like in the good old commandlinefu.

      • ramon156 21 minutes ago
        Silly question, why not just render the html on the pages? e.g. the popover is something I wanted to see
  • apples_oranges 1 hour ago
    please don't hide scrollbars :)
    • chrismorgan 35 minutes ago
      Yeah, that was the first one my eyes went to. The only scenarios I can think of where it is acceptable to hide scrollbars are infinite canvases where you’ll draw your own non-linear ones (and even then be disappointed because they can’t look or behave natively), and things like maps where you remap scrolling to zoom and might want to use a backing invisible scroll area for that rather than consuming scroll events (which are somewhat more limited).

      In short: unless the native scroll bar will be wrong, do not under any circumstances hide it.

    • marcomezzavilla 49 minutes ago
      If you mean the "Hide scrollbars" note, I agree 100% (:

      There are a few specific situations where it can be useful, but I added the caveat precisely because it’s generally not a good practice.

      • IndySun 47 minutes ago
        >There are a few specific situations where it can be useful

        re scrollbars, Can you give an example?

        • archerx 7 minutes ago
          An online game for example.
  • OuterVale 1 hour ago
    They're not really 'tricks' as much of mentions of assorted features of HTML and CSS. You get to discover a similar assortment of things (with much more immediately available detail and many examples) just clicking around MDN.
    • happytoexplain 2 minutes ago
      Sure, they're not "tricks", but it's also definitely not the same as what you get randomly browsing formal documentation.
    • marcomezzavilla 1 hour ago
      That’s fair, "tricks" may be overselling it. The website is meant to be a small, opinionated collection of features I want to remember, not a replacement for an authoritative reference like MDN. I can probably make that positioning clearer.
  • hk__2 1 hour ago
    > Each post-it pairs one useful platform feature with a small example

    I can’t find a single example; each post-it just shows some code but not the result of it.