Live data from Hacker News

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

github.com

31–40 of 319 posts

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

#33

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

Using CSS to create a menu is just fine, because all the technical background needed is already there in HTML.

There is no need to throw some crazy JavaScript stuff at a problem that does not even exist.

Seems like lots of web developers have forgotten to keep it simple.

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

#34

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

Also no hover menu [1], please. In JavaScript hover menu is harder to make, but in CSS it is instant and much prone to abusing. [1] http://uxmovement.com/navigation/why-hover-menus-do-users-mo...

Correctly implemented hover or partial hover menus are fine.

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

#36
I think it would actually be wise to stick to JS style rendering (as is the case with React) as we're only going to see more and more styling being delegated to scripts with the rise of wasm. Only a matter of time before CSS will only really be useful for completely static websites IMO.

Edit: Downvoting me because you disagree isn't really in the spirit of HN.

Please provide a counter argument if you disagree, I'd be interested to hear it.

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

#37

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 :)

More to the point :target can only target one element at most, since fragment is unique.

the other stuff ranges from clever tricks, like the label/checkbox modal, to stuff which would be a nightmare to maintain on a complex page

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

#38
> Css is more powerful today and you can do a lot of thing dont need js

Yes, but the problem is that adding or changing functionality implemented in CSS can easily lead you into a brick wall.

At that point you will either have to rethink your approach completely, or move back to JS.

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

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

Just use JavaScript to clear the browser history. Bingo! Pure CSS modal.

I see what you did there.

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

#40

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 :)

Actually, you just need media queries.
Post reply on HN