Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We are talking about how state is stored, not about CSS.

And it makes me think you haven't had as much experience as you think.

How do you deal with form state using CSS? Where does it get stored? In the html as elements? So not on the server?

 help



> How do you deal with form state using CSS? Where does it get stored? In the html as elements? So not on the server?

For really simple stuff you can use CSS sibling selectors: https://jsfiddle.net/Kqscu/4/

For more complicated stuff, it is in the html as elements. With htmx you can often do this by making a request to the server to update a subtree; the server doesn't need to know the state that the user is seeing, just what is happening in the specific request.

Sometimes just updating html subtrees isn't quite enough, and then I use javascript. Transient state that is only concerned with what is presented to the user is probably not best done on the server.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: