Small, native web tricks worth remembering

181 points49 comments7 hours ago
m-s-y

Love when I go into a car dealership and get to read all about the different cars. Specially when the cars aren’t actually there. In fact there’s not even a picture of a single car. Yep that’s my jam.

moontear

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.

show comments
zeroq

Maybe it's just me, but it seems like a huge waste of time (or to be on a more positive note - potential).

Just the first example "Device type in JS".

"A coarse pointer does not mean “mobile”, and a fine pointer does not guarantee “desktop”. Ask the browser about input capabilities instead of guessing the device from its user agent."

  const input = {
  finePointer: matchMedia('(any-pointer: fine)').matches,
  coarsePointer: matchMedia('(any-pointer: coarse)').matches,
  canHover: matchMedia('(any-hover: hover)').matches,
  }; 
So it doesn't tell me how to identify device type. It doesn't even run the code so I could quickly compare results between my mobile and desktop devices to establish a baseline.
show comments
apples_oranges

please don't hide scrollbars :)

show comments
herrherrmann

Neat! I like these opinionated lists, especially when it’s easy to browse and cherry-pick useful stuff. It’d be very good to mention how compatible the features are, though. Especially with newer CSS features, it’s easy to overestimate how ready they are for all browsers.

For that, there could just be links to the related MDN and/or caniuse.com pages.

show comments
mceachen

"... that matters" is the new emdash

show comments
tylerius

Best resource for proper HTML+CSS development is Jason Knight AKA deathshadow's CUTCODEDOWN (cutcodedown.com at Web archive) and his articles at Medium and CodePen (user Jason Knight).

show comments
OuterVale

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.

show comments
qqrun

Thank you for sharing, it's very helpful.

nater5000

I'm not sure where the design for this site came from, but I hate that it brings you to a new page to show you something that could have probably fit in the big ass buttons on the first page lol. It took my by surprise the the card didn't flip over to show you the details and instead just navigated to a new page. I'm not a design guy- more of a backend, do everything in a TUI kind of guy- so if I'm caught off guard by a cheap UI/UX decision, then that's a serious problem.

show comments
hk__2

> 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.

show comments
andai

What does native mean in this context?

show comments
mrbluecoat

I'm always googling how to center with CSS.. bookmarked.

zuzululu

what would be cool is an llms.txt that i can feed to use these as most try to use React when they could just use html

markuswagner

Super neat! Rare to see a genuinly actually useful opinionated list like this.

JodieBenitez

Nice tips there ! :)

vortegne

without demos this is mostly useless i think

ChrisArchitect

Not to be confused with https://http.cat/

show comments
robertoandred

And yet that site has horizontal scroll bars.