I myself was "inspired" by css-tricks back in 2019 to make a CSS-only page that can still show and hide elements. I don't want to self-promote, as that is against the rules, but here's the relevant CSS that I'm pretty sure this was "inspired" from css-tricks--but I can't remember, and I don't have a link to the appropriate page.
.css-toggle-switch { display: none; } .css-toggle-switch + label:before { content: "Hide "; } .css-toggle-switch:checked + label:before { content: "Show "; } .css-toggle-switch:checked ~ .css-toggle-content { display: none; }
.css-toggle-switch + label { cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; }
.btn { padding: 5px 10px; background: white; border: 1px solid grey; border-radius: 3px; width: 130px; display: inline-block; text-align: center; }
.btn:hover { background: #e6e6e6; -webkit-box-shadow: inset 0 -1px 0 #dddddd; -moz-box-shadow: inset 0 -1px 0 #dddddd; box-shadow: inset 0 -1px 0 #dddddd; }
I suspect something like this can be used to collapse and expand comments on news.ycombinator.com. And it is /the only thing/ I find missing and needed from news.ycombinator.com with Javascript turned off. If Geoff or anyone else wants to post some CSS here that can do the job, maybe we can get HN to incorporate it. If not, maybe the rest of us can at least use it with a browser extension that can add custom CSS.