r/programming • • Mar 09 '25

Introducing command And commandfor In HTML

https://developer.chrome.com/blog/command-and-commandfor
92 Upvotes

33 comments sorted by

View all comments

Show parent comment

13

u/transfire Mar 09 '25 edited Mar 10 '25

That’s a fair point.

I see the appeal of command and commandfor, but I’ve thought for a while now the same and more can be achieved if we could retarget CSS effects and add some additional pseudo-selectors.

#mybtn:click |> #mymodal { display:block; }
#mymodal:clickaway { display:hidden; }

Where |> would mean retarget. But to your point you could use a relative selector like > too.