New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use CSS instead of javascript to hide / unhide sensitive content #1464
Comments
Wouldn't it be better to use the |
If you have javascript disabled, mastodon's web interface won't work at all since it's heavily dependent on it to function, so supporting such browsers is far out of scope. I appreciate the effort to implement this using css and checkboxes, but the fact of the matter is the code we already have is much more compact and easier to read when implemented in JS. |
Obviously, ridding mastadon's web interface from dependence on JS can't happen overnight as it needs to happen in many smaller steps. This would be one step. Regardless, the details HTML element could still be used in the mean time for the hidden content, even in conjunction with JS. Then as the element gains more support, that particular bit of JS can become deprecated thus saving on code maintenance. With code less is more. |
The "using a checkbox as as accordion pattern" is a neat example of something you can do without JS and with some clever CSS but it isn't very semantic, or accessible, without ARIA roles to convey that it isn't really acting as a checkbox but more as a toggle button that controls the visibility of another element.
|
I notice that mastodon is blocking some content behind javascripts.
css-toggle-box.txt
Attached is a way to do it with just CSS and no Javascript. I didn't figure out this specific way, it turned up on a forum a month or so ago.
Reducing JS use decreases complexity and maintenance requirements and increases accessibility, performance, and security.
The text was updated successfully, but these errors were encountered: