Live data from Hacker News

Small, native web tricks worth remembering

htmlcat.net

11–20 of 73 posts

Re: Small, native web tricks worth remembering

#11

please don't hide scrollbars :)

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.

>There are a few specific situations where it can be useful

re scrollbars, Can you give an example?

Re: Small, native web tricks worth remembering

#12

please don't hide scrollbars :)

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.

Re: Small, native web tricks worth remembering

#13
post #4

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.

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.

Silly question, why not just render the html on the pages? e.g. the popover is something I wanted to see

Re: Small, native web tricks worth remembering

#14
post #11

Earlier quoted context omitted.

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.

>There are a few specific situations where it can be useful re scrollbars, Can you give an example?

An online game for example.

Re: Small, native web tricks worth remembering

#15

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.

Sure, they're not "tricks", but it's also definitely not the same as what you get randomly browsing formal documentation.

Re: Small, native web tricks worth remembering

#16
post #6

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

The code is the example. "Demo" is probably a better word for what you're thinking of.

Re: Small, native web tricks worth remembering

#17
post #11

Earlier quoted context omitted.

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.

>There are a few specific situations where it can be useful re scrollbars, Can you give an example?

Sure. I was thinking of fairly narrow cases, not ordinary page scrolling:

- A swipe/drag carousel with visible arrows or dots, especially a looping carousel where the native scrollbar does not represent a meaningful start and end

- An accordion or expanding panel that animates to reveal all of its content. During the transition, its intermediate height may briefly produce a scrollbar (and a visual flash), even though the fully expanded state does not need one

- Highly visual or experimental interfaces where scrolling is communicated through another control, or where the scrollable area is decorative and scrolling is not required to access the content

Re: Small, native web tricks worth remembering

#20

please don't hide scrollbars :)

Only time I've seen that work is when making a carousel. Once you're using scroll snap it's already not going to behave the way you'd expect a scrollable container to, so having a different indicator doesn't feel so egregious to me.
Post reply on HN