Live data from Hacker News

How to write a JavaScript-free todo app using just HTML and CSS

mattzeunert.com

31–40 of 49 posts

Re: How to write a JavaScript-free todo app using just HTML and CSS

#31

> What doesn’t work: > Persistence after page reload That's not an app. TL;DR: Use styled checkboxes in a form.

A common misconception is that adding JS to HTML (e.g. in forms) _hurts_ accessibility. In fact, foregoing JS in favour of "pure" CSS+HTML can actually be much worse.

Yes, you can create certain interactions with CSS alone but doing so purely for the sake of not using JS is pointless and at worst harmful.

Re: How to write a JavaScript-free todo app using just HTML and CSS

#32
That's super cool! The `:checked` and `:valid` and `:invalid` selectors are really powerful tools when it comes to CSS. This is a real fun use of clever CSS selectors.

I was doing something similar the other day with toying around trying to come up with an HTML/CSS only game. I ended up with this: https://codepen.io/billnreed/full/boXrVr

Re: How to write a JavaScript-free todo app using just HTML and CSS

#35
post #19
post #13

In doing this, you break HTML semantic relationships. Each to-do is a child of the previous to-do. That hurts. I applaud the work in making something sans JS for the kicks of it, but if your going to do it, at least don't break HTML.

The semantic Web is, unfortunately, quite dead. Hopefully a JavaScript-free Web can still happen.

"Hopefully a JavaScript-free Web can still happen."

The phone you're reading this post on has nearly as many CPU cycles available to run code as the web server that generated the html. Why on earth would you not want to distribute the overall application load.

Re: How to write a JavaScript-free todo app using just HTML and CSS

#36
post #35
post #19

Earlier quoted context omitted.

The semantic Web is, unfortunately, quite dead. Hopefully a JavaScript-free Web can still happen.

"Hopefully a JavaScript-free Web can still happen." The phone you're reading this post on has nearly as many CPU cycles available to run code as the web server that generated the html. Why on earth would you not want to distribute the overall application load.

> Why on earth would you not want to distribute the overall application load.

Maybe because I want my phone battery to last a long time, but I don't care how much electricity the web server uses. Maybe also because the JavaScript is probably proprietary software [0], which I don't want to run on my computer.

[0] https://www.gnu.org/philosophy/javascript-trap.html

Re: How to write a JavaScript-free todo app using just HTML and CSS

#37

Earlier quoted context omitted.

Oh like pure academic exercises..

Javascript-free golf. How complex of a web app can you make without using javascript.

That sounds like a lot of fun and good exercise! The css would be terrifying though.

Re: How to write a JavaScript-free todo app using just HTML and CSS

#38

These exercises will be a lot more fruitful to read through if the author can acknowledge the contrived nature of these attempts and provide a real-world advantageous use case of the techniques outlined

Using inputs and pure css imo is a superior method to deliver content tabs and other similar UI. Minimal markup for a fully functional non js bound interface

Re: How to write a JavaScript-free todo app using just HTML and CSS

#40
post #35

Earlier quoted context omitted.

"Hopefully a JavaScript-free Web can still happen." The phone you're reading this post on has nearly as many CPU cycles available to run code as the web server that generated the html. Why on earth would you not want to distribute the overall application load.

> Why on earth would you not want to distribute the overall application load. Maybe because I want my phone battery to last a long time, but I don't care how much electricity the web server uses. Maybe also because the JavaScript is probably proprietary software [0], which I don't want to run on my computer. [0] https://www.gnu.org/philosophy/javascript-trap.html

FWIW, the HTML + CSS approach of the author is just as copyrightable and potentially non-free as the JS in question. There's really no difference. Sure his 'code' is practically pointless, but that's no obstacle to being non-free.

Uglified/minified HTML+CSS is almost as difficult to parse by humans as JS.

I'm all for free software and very supportive of the arguments, but the pro-HTML, anti-JS rhetoric never made a lot of sense to me, consistency-wise, at least in these days of CSS3.

Post reply on HN