Re:Building a front end with no JavaScript
by humblebee on Thursday April 11, 2019 @09:51AM
(#19634484)
Seems like it could be done with a checkbox and some cash. I'm sure someone could figure it out.
[ Parent
| on HN ]
The article has exactly this scenario as an example of where pure CSS can replace JS.
Re:Building a front end with no JavaScript
by pawelk on Thursday April 11, 2019 @11:05AM
(#19635198)
It could be done using `input:checked + sibling` selector e.g. like this: https://jsfiddle.net/6bgemn0s/
For something fancier it would be possible to style a label with appropriate for="" attribute and hide the checkbox completely, then even apply some transitions: https://jsfiddle.net/6bgemn0s/1/