News for hackers. Stuff that matters.
Re:Show HN: Mimicking the Bloomberg menu widget without Java... by daylightsavings on Tuesday June 26, 2018 @10:09AM (#17400690)
Firstly, job well done. Secondly, what is the motivation of going pure CSS aside from the challenge of it?

I once prefered Pure CSS stuff until I learned Javascript myself. Now I've come to loathe that approach on complex menus and widgets.

Mainly I dislike using them because I have to refactor them to use Javascript so they can be stateful (reacting to an active category or something indicated by the url or querystrings, etc.

Again, good job though if it's just for the lulz.

Re:Show HN: Mimicking the Bloomberg menu widget without Java... by Grumbledour on Tuesday June 26, 2018 @10:35AM (#17400867)
It seems to me, many web developers today don't even realize, that creating features without js and enriching the experience from that baseline, not only enhances performance and accessibility, but in the end is often not more work and might even lead to cleaner, leaner code. I guess in the end it just comes down to which tools one learned first and based on that which approach one takes to solve the problem at hand.

I can only encourage everyone that thinks js is the catch-all solution to dive a bit deeper into html&css and try out alternate solutions. It's worth it for the knowledge gain in itself but offers many other benefits.

Re:Show HN: Mimicking the Bloomberg menu widget without Java... by nebulous1 on Tuesday June 26, 2018 @10:40AM (#17400913)
css is often the slowest part of a webapp. complex css like this is not necessarily better accessibility-wise than javascipt
Re:Show HN: Mimicking the Bloomberg menu widget without Java... by Grumbledour on Tuesday June 26, 2018 @10:56AM (#17401049)
Why complex? Sure, this example is somewhat complex, but it does not need to be. Structure the menu in nested ul's, add simple hover css and don't use "display: none;" but rather "position: absolute; left: -999em;" and you get simple css and a good html structure that a screen reader for example can read easily and which also is clear to read if you turn css off entirely.

Of course, small hover menus offer their own accessibility challenges, but they don't depend on the way they are implemented but rather the choice of UX. And no reason why you could not improve this simple css menu with some js to make it more user friendly (like turning hover into clicks etc.)

Re:Show HN: Mimicking the Bloomberg menu widget without Java... by jensvdh on Tuesday June 26, 2018 @11:33AM (#17401388)
Do you have some proof to back this? CSS matching is incredibly fast.
Re:Show HN: Mimicking the Bloomberg menu widget without Java... by mavidser on Tuesday June 26, 2018 @10:21AM (#17400778)
For one, many people prefer to browse websites with javascript turned off. Aside from performance benefits, you turn off user tracking, flashy ads, autoplay videos, annoying popovers, etc.
Re:Show HN: Mimicking the Bloomberg menu widget without Java... by jrochkind1 on Tuesday June 26, 2018 @03:41PM (#17403447)
MANY people? Source?
Re:Show HN: Mimicking the Bloomberg menu widget without Java... by sincerely on Tuesday June 26, 2018 @05:08PM (#17404001)
zero people block JS: false

only one person blocks JS: false

therefore many block JS

Re:Show HN: Mimicking the Bloomberg menu widget without Java... by robbrown451 on Tuesday June 26, 2018 @06:06PM (#17404343)
"Many" is not synonymous with "multiple".

I would expect that the percentage of people who browse without javascript on is incredibly small. The absolute number might be largish, and I guess in that context is could be considered "many."

Still, the vast majority use javascript.

Re:Show HN: Mimicking the Bloomberg menu widget without Java... by basica on Tuesday June 26, 2018 @09:34PM (#17405188)
Haven't you studied cardinality? You don't have One to Multiple relationships, you have One to Many /s
Re:Show HN: Mimicking the Bloomberg menu widget without Java... by rodorgas on Tuesday June 26, 2018 @07:27PM (#17404737)
Between zero or all, could be many or some.
Re:Show HN: Mimicking the Bloomberg menu widget without Java... by jrochkind1 on Tuesday June 26, 2018 @09:26PM (#17405174)
Or perhaps "few".
Re:Show HN: Mimicking the Bloomberg menu widget without Java... by ohitsdom on Tuesday June 26, 2018 @10:23AM (#17400794)
Most "stateful" functionality (including all you mentioned) can still be done with a CSS driven drop down menu.
Re:Show HN: Mimicking the Bloomberg menu widget without Java... by ThirdFoundation on Tuesday June 26, 2018 @03:49PM (#17403493)
Could this be handled by a templating engine like handlebars?
Re:Show HN: Mimicking the Bloomberg menu widget without Java... by lucideer on Tuesday June 26, 2018 @11:37AM (#17401426)
> Mainly I dislike using them because I have to refactor them to use Javascript so they can be stateful

You shouldn't need to refactor anything done in HTML or CSS to add JS-driven statefulness. This is what's great about using JS: it's power allows it to wrap/augment existing functionality quite flexibly.