Live data from Hacker News

HTML Can Do That

chrisburnell.com

171–180 of 249 posts

Re: HTML Can Do That

#171
post #64

>popover Why are we cool with popups again? Anything that interrupts and blocks content is annoying, and is nearly guaranteed to make me leave immediately. It can be used responsibly, but it almost never is.

Very handy for nav bars with expandable drop-downs for more links - can now be done with zero JS. Requires much less CSS boilerplate now, and you don’t have to use z-index at all (which eliminates a whole bunch of tricky issues). They also handle all the tricky aria/keyboard/focus mgmt bits for you, too. It works really, really well.

Supposed to be real handy for tooltips too, but haven’t used that myself yet.

Edit to avoid potential confusion: these are separate from modal dialogs, think more like very small popups anchored to one point on the page that still allow you to interact with everything else. Theoretically you can make them modal, but it would be silly to - you’d be better off using and the invoker api

Re: HTML Can Do That

#172
Can we start having a label for aislop content?

Maybe it is useful, but I am not reading it. I could barely read 2-3 lines before I closed the tab. Next.

Re: HTML Can Do That

#174
post #136

Earlier quoted context omitted.

>single, simple JS file It's all fine and dandy until marketing bros decide to shove all kinds of shady modals into that JS file. The JS side is not exclusive to trivial interactivity.

What "marketing bros?" It's open source software. You can see what it does, and you just put it on your server. We're talking about pre NPM javascript here, no continuous deployment, everything is vendored and local and no one is going to change that file without your knowledge and permission. And if someone does, you have much bigger problems on your hands. What you can't own and control is the browser vendors and h…

My point was, people block js of websites by default. Why? Cause website devs abuse js and don't exclusively use it for basic interactivity of stuff like sorting table columns.

There is an incentive to use HTML for common interactivity purposes.

Re: HTML Can Do That

#175

also supports "srcset" which can make the image component responsive. Hope they add a placeholder to it which can account for loading state.

I find using with and is more flexible, particularly with multiple image formats (AVIF and JPG in my case).

One more thing thats nice with and and over with srcset is the former can responsively change images, while some browsers (Chromium based IIRC) will assume srcset corresponds to the “same looking” image.

IIRC Chromium based srcset will never “downsize” to a smaller image, whereas ’s media is like a real media query.

Use if you want jumpscares at specific sizes lol

Re: HTML Can Do That

#176
post #97

once again, i will ask: why do people care so much about only having one element open at a time? let me see what i want to see!

Skimming/scanning. For a couple of items, it is not an issue, but say for a long list of FAQ, being able to scroll past fast is nice.

Re: HTML Can Do That

#177
post #97

once again, i will ask: why do people care so much about only having one element open at a time? let me see what i want to see!

Skimming/scanning. For a couple of items, it is not an issue, but say for a long list of FAQ, being able to scroll past fast is nice.

but then just close the elements yourself if you need that? don't force one behavior onto everyone

Re: HTML Can Do That

#178
post #177

Earlier quoted context omitted.

Skimming/scanning. For a couple of items, it is not an issue, but say for a long list of FAQ, being able to scroll past fast is nice.

but then just close the elements yourself if you need that? don't force one behavior onto everyone

Most people are lazy, so it is designed for most, including myself.

Re: HTML Can Do That

#179
post #5

I'm that minutia in your statistics that is still rocking NoScript in 2026, enabling JavaScript on a site-by-site basis, but this is increasingly difficult with the modern web. Hopefully these and others modern HTML features gain adoption, along with realizing perhaps a Single Page Application isn't necessary in most instances. I don't often have to write frontend code, but when I do, there is very little in terms of…

> I don't often have to write frontend code, but when I do, there is very little in terms of interactivity you cannot do with HTML these days, worst case a little sprinkle of something like HTMX.

And for some front-end form field validation in the spirit of htmx, ParsleyJS[0] is quite nice. Below is one way to enable the former to support the latter:

  htmx.defineExtension (
      'parsley-validation',
      {
          onEvent : function (name, evt) {
              var allow = true;
  
              if (name === 'htmx:load')
                  $(evt.target).parsley ();
              else if (name === 'htmx:confirm') {
                  var theForm = $(evt.target).parsley ();
  
                  theForm.validationResult = allow = theForm.isValid ();
  
                  if (!allow)
                      evt.preventDefault ();
              }
  
              return allow;
          }
      }
  )
0 - https://parsleyjs.org/
Post reply on HN