Live data from Hacker News

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

github.com

61–70 of 319 posts

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

#61
post #56
post #42

Earlier quoted context omitted.

It's not about bloat, it's about accidentally triggering menus when you move your mouse down the page.

Ah! I read the parent's post as sarcastic. But you are right, a little delay can be good.

There's a lot more to this than just "a little delay" to avoid accidental triggers.

Good menus are complex. In desktop toolkits, there is a lot of logic to ensure they are accessible and don't behave in annoying ways. For example, a high quality menu will have a certain leeway to trigger into and out of submenus so that you don't accidentally drift into the incorrect submenu should you make an error of a couple of pixels while navigating them. They will have various delays and margins in place so that you are able to move your mouse in straight lines rather than make awkward 90 degree turns.

A good menu system will also be navigable with a keyboard-only and will have access keys to quickly jump to items within it.

Everybody who is reinventing the wheel because they see a menu as a mere "styled list of links that shows on hover" is missing out on the decades of learned UX that desktop systems have gone through. I sigh whenever I read, as I have many times in these comments, about making menus in CSS so that it's accessible to the 0.001% that doesn't use JS, while shutting off the much more real percentage of users that can't use a mouse (users that don't generally have a choice in the matter - unlike those turning JS off).

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

#62

The problem with using css this way is that it's not as obvious what's supposed to happen as it is when using js. I'd love for there to be some explanation within the examples of _why_ they work - I've just been reading the first modal example but I can't really understand it

Building web applications with screens that have complex workflows and state is a need that is largely ignored by browsers and web standards. Instead of getting reusable gui components we get indechiperable css hacks that were built for creating art installations on the web rather than getting any actual work done.

Mozilla (including Firefox) had XUL, but nobody cared.

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

#65
post #45
post #4

So in the first modal example, the document contains both dialog windows at the same time. Is that really what you want? Does that properly describe the content of your document?

How else would you do it, even in JavaScript?

Add modal to DOM as and when needed

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

#66
post #63

- "CSS", not "Css"; - "JS" or better yet "JavaScript", not "js", nor "Javascript"; - "don't", not "dont"; - use title case as per the guidelines.

What's the point of this post?

There are HN guidelines, and there's also the English grammar with a plethora of tools to help those with a mother tongue different than English like myself. HN is not a chatroom - it's a news website.

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

#67
post #66

Earlier quoted context omitted.

What's the point of this post?

There are HN guidelines, and there's also the English grammar with a plethora of tools to help those with a mother tongue different than English like myself. HN is not a chatroom - it's a news website.

You're complaining about casing and one missing apostrophe... if you cared this much, how come you didn't notice the title is missing two words to even make sense?

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

#70

Earlier quoted context omitted.

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.

One problem is that you do not have hover with keyboard-only or touch browsers.
Post reply on HN