Live data from Hacker News

CSS is powerful, you can do a lot of things without JS

github.com

21–30 of 319 posts

Re: CSS is powerful, you can do a lot of things without JS

#21
post #17
post #5

The problem with relying on anchors means it stays in the browser history, so if you press 'back', you get the modal dialog again! I don't think this is very useful, but it is a fun exercise in CSS.

Well, you can manipulate the browser history to remove those anchor links :)

With CSS?

It's just easier to do this with Javascipt without hacking the history.

Re: CSS is powerful, you can do a lot of things without JS

#24
Still not good enough. For example the popover/tooltip that pops up on hover is fixed right below the target. If for example the viewport/window is smaller than the available space it will "bleed" out of view. You still need javascript to place it properly, and javascript that manipulates :after and :before pseudo elements is not straightforward.. Just saying :)

Re: CSS is powerful, you can do a lot of things without JS

#25
I'm still a huge fan of "If you can do something with CSS, avoid JS", but these days, working with React, everything is JS.

Although IMHO it makes logical sense to put the logic for the modal windows in the JS, not the CSS. And definitely easier for maintaining it.

Re: CSS is powerful, you can do a lot of things without JS

#27

I'm still a huge fan of "If you can do something with CSS, avoid JS", but these days, working with React, everything is JS. Although IMHO it makes logical sense to put the logic for the modal windows in the JS, not the CSS. And definitely easier for maintaining it.

JS is far more predictable than CSS.

Re: CSS is powerful, you can do a lot of things without JS

#28
I've always been told that the best way to learn something is to delve into it. Tried so with CSS but it was such a hassle that I gave up. Now, years later, all those past frustrations of my younger self remain to the point it's like a bête noire of mine. Seeing all this coolness makes me feel kinda bad for missing out. /rant

Re: CSS is powerful, you can do a lot of things without JS

#29
post #27

I'm still a huge fan of "If you can do something with CSS, avoid JS", but these days, working with React, everything is JS. Although IMHO it makes logical sense to put the logic for the modal windows in the JS, not the CSS. And definitely easier for maintaining it.

JS is far more predictable than CSS.

CSS ( properly written ) is easier to debug than JS.

Re: CSS is powerful, you can do a lot of things without JS

#30
post #11

Whenever someone makes a menu with CSS instead of javascript i go crazy as a user. The lack of delay is such a frustration.

Whenever someone makes a menu with js I don't use the site because I browse without js.

That's fine. Nobody forces you to use my applications and websites.
Post reply on HN