<detail>
<summary>
Title
</summary>
Content
</detail>
tag allows you to do that iirc. I use it on my site and works fine to hide things that you can expand upon when clicked. <label for="spoiler">Toggle spoiler</label>
<input type="checkbox" id="spoiler"/>
<div id="spoilerContent">Spoilery stuff goes here</div>
<style>
#spoiler, #spoilerContent{display: none;}
#spoiler:checked+#spoilerContent{display: block;}
</style>
You can also use a variation of this for tabs - just use radio buttons instead - and accordions.But if it's more accessible depends on the target user. If you're target are IE users or users with very old browser versions, for one reason or another, more accessible would be to use the CSS toggle trick. But if indeed your target user are users using screenreaders and using recent browsers, then details and summary elements would be more accessible.
A bit anal, but important to consider when talking about accessibility, it's very context sensitive.
For example, people who live in South America usually have a lot worse internet connection, and more likely to be on mobile networks, than people in the west. If you're audience is mainly in South America, working on making your application accessible, means making sure your application has low bandwidth usage, can deal with high latency and jitter, and works well for phones.
One only has to look at the definition of the word "Accessibility" to see why you're wrong: "accessibility - the quality of being able to be reached or entered - the quality of being easy to obtain or use - the quality of being easily understood or appreciated".
Not sure where the focus on people with disabilities came from, it's important, but accessibility is much bigger than just that.
You are right, accessibility _can_ take into account degraded environments, but if you don't know why disabilities are focused on, that suggests to me you are philosophizing on the word, and not addressing actual technical standards that have been put in place. Just google it
Your argument was "Accessibility is specifically about making things accessible to those with disabilities" which by no definition of the word, is true. Look it up.
Not sure why I'd have to read the various specifications again when I've already done that. I'm still of the same impression (like most others) that accessibility is much bigger than just making things work for those with disabilities.
Pages also seem to take around 10 seconds to do the initial render. No server problem, just rendering.
So if you do use this, I guess don't overdo it. :) Or at least profile.
I use a 2015 MBP potato laptop. I guess my perf problems aren't really relevant. But it handles all modern sites just fine, so it was surprising.
Definitely spikes something to 100% on each load: https://i.imgur.com/1fqBDEX.png and the CPU graph is a nice timeline of me reloading teddit.
EDIT: Oof. I just did a profiling session to figure out what the heck it was doing:
Purple = rendering time. As you can see, it's 100% pegged at rendering whenever I uncollapse a thread.
So, devs, if you happen to read this, the process is:
1. go to https://teddit.net/r/Bossfight/comments/k6vh5v/bearers_of_th...
2. Collapse the toplevel comment https://imgur.com/vjDhTk2
(which is very fast.)
3. Activate a profiling session: Command-option-I, click performance tab, command-E to start recording
4. Un-collapse the thread
5. Stop recording
Here's the profiling session in case it helps: https://battle.shawwn.com/misc/2020-12-04/Profile-20201204T1... No idea if it gives any insight into what's going on, but there y'go.
I'm not sure how they'd solve this. 98.2% of the time is spent in "Layout": https://i.imgur.com/tSexr0n.png
Is there even anything you can do to address that kind of perf problem? Yuck. I don't envy whoever digs into that one.
I tried profiling with "Enable advanced paint instrumentation (slow)" but it seemed to show exactly the same result:
https://i.imgur.com/V26oOTT.png
"Nodes That Need Layout 3841 of 3987 Layout root#document" seems relevant. So it sounds like the details card is somehow causing a full-page layout for almost every element on the page. Which should be fast, except that every element seems to cause another layout. Or ... something.
Not sure if there's any other details I could give, but let me know if anyone has ideas.
Seems to be a Chrome-only issue?
So far I haven't come up with any solution. The nested .comment styles seemed not be the problem. Although something in the CSS triggers the slow rendering on Chromium based browsers – not sure yet what.
If any of you have an idea, leave a comment here or in Teddit, appreciated!
EDIT: Oh, forgot to say: Works fine in Firefox, no rendering issues.
1. https://css-tricks.com/quick-reminder-that-details-summary-i...
[edit] An example: https://littr.me/moderation
I'm somewhat active on niche programming topics, and people are usually helpful and respectful.
I like that on Reddit I can stay in my bubble and not worry about the world's every single problem when I just want to relax.
On Twitter, that's impossible. No matter how strictly you curate your feed, at least 1 in every 10 tweets will be something that ruins your mood (politics, drama, bullying).
Reddit became a shit show with Trump vs Clinton, but now people attack their own for every little sign of life.
We really need a better social network. Twitter, Reddit, HN, Facebook, ... They add little, but break a lot.
> I think I witness the pandemic's toll on people's capacity for empathy
There's so many widely varying ways that effects of the pandemic can hit someone pretty bad (financially, mentally, of course physically, etc), and I think that part of the problem is that it's hard to see how real those problems are if you happened to not have suffered those particular hardships.
Personally I found this with isolation through lockdown. People who live with family, a partner or even just housemates seem to not quite understand what happens when the isolation creeps up on you (it creeps). Between the waves, when I could see people again, I could easily tell ones that did know, you could see it in their eyes if they talked about the lockdown period.
My new social network is called the woods.
The problem is the voting. It's not inherently linked to the content's value to the discourse or even welfare of the collective. Wrong reward metric meets a brain evolved for social regulation in small groups of humans dependant on each other's survival. Like with all problems of modern humanity, we struggle with a novel abundance we created...
It's a shame I no longer visit Reddit, as most popular subs just fall into the echo chambers. I find IRC still pretty good for the technical conversations, and there are the odd old skool forums that are active.
Perhaps reddits success will be it's downfall?
But I've had friends who insist it's a massive shit show deserving of being blocked at the router (for at least one guy).
Same can be said with Twitter, or any social network. It's all about the company you choose to keep.
This is why I hang around on HN. Only place I know where I can find other people who agree that today's use of Javascript, 9 times out of 10, amounts to a nusiance.
The show/hide design pattern is annoying, IMO. Should be an accessibility violation; cannot tab through it.
I guess thats why I use a text-only browser. Avoids all the Javscript nonsense, not to mention the next CSS trick du jour.
I really don't get this complain and I've only seen it from developers. Certainly not company owners for pay for server/hosting costs (because they have seen how the insane costs of rendering everything server-side with large user bases). Even common people prefer it the way it is currently. The market has decided.
Most normies have no clue what JavaScript is
Hmmh, I don't know how to make it better. It's really challenging to do it without JS in the first place. Do you have any ideas?
Yes, you are correct. This is a hobby project of mine, and one of the goal was to make old.reddit.com like UI without no JS at all. That's what I will do.
>I really don't get the hate for JS these days.
Unnecessary Javascript bloats websites, hogs system resources, enables surveillance, hinders accessibility that’s native to devices and clients, and introduces vulnerabilities. https://nojs.club/
Of course in this case using JS to hide/show comment tree wouldn't really be that bad, but works fairly well without it. Not many have complained.
The information (content) is right there, in the page. I would say there is nothing to fix. It is just the Javascript getting in the way.
Put the two together and you can do interactive elements without JS:
``` <input id="inputId" type="checkbox" /> <label for="inputId"></label> <div class="toggle-content">Some DOM</div> ```
``` label::after{ display: block; content: '[+]'; } #input, .toggle-content { display: none; }
#input:checked + label::after { content: '[-]'; } #input:checked ~ .toggle-content { display: block; } ```
Off the top of my head, so YMMV but principal is all there.
You start getting headaches if you want animate that though (keyframes that animate a max-height from 0 to 9999999px goes some of the way but feels a bit hacky/doesn't give you much control over consistent timing.)
Here is the source code: https://github.com/teddit-net/teddit. Maybe I am mistaken, but there seems to be a lot of JavaScript running this website.
Furthermore, there are easy ways to mitigate the cost of rendering on the server side. For example, on a site like reddit, most of the traffic is probably non-logged-in readers hitting the front page, so... cache the front page. Even for logged-in users, the front page listing only could be cached as rendered, since none of it really needs to be live. If liveness was desirable for only certain elements (e.g. voting buttons), it is possible to sprinkle on client-rendered elements.
Append .compact to any reddit page and enjoy. It's fast and it's not the dimwitted slow loading mobile crap they've been throwing at us for years
I gave up on reddit a couple years back, but this might make me rethink.
With so many things turning to mud, this is a good thing.
What I cannot figure out is how they do the [-] show/hide stuff without javascript?
Even hacker news - which is relatively lightweight - uses javascript for that.
EDIT: ...and I'm back. It's like eating a box of candy for dinner - sugar rush and no nutrition.