News for hackers. Stuff that matters.
Re:Templating in HTML by kitsunesoba on Tuesday October 04, 2022 @07:06PM (#33088377)
Front end web is not my forte, but as I understand display:none; can have unintended (usually negative) interactions with screen readers, which I don't believe is a possibility with HTML templates.
Re:Templating in HTML by lelandfe on Tuesday October 04, 2022 @09:44PM (#33089995)
This is not true. I suspect it is a myth, I've heard it for decades now.

WebAIM[0]:

> display:none or visibility: hidden

> The content is removed from the visual flow of the page and is ignored by screen readers

[0] https://webaim.org/techniques/css/invisiblecontent/#techniqu...

Re:Templating in HTML by ataylor32 on Tuesday October 04, 2022 @09:02PM (#33089609)
Are you sure? It's my understanding that screen readers know to ignore elements with display:none;
Re:Templating in HTML by grimgrin on Tuesday October 04, 2022 @07:11PM (#33088424)
There’s a way to hide from screen readers too if the OP was so inclined:

https://developer.mozilla.org/en-US/docs/Web/Accessibility/A...

Re:Templating in HTML by cantSpellSober on Tuesday October 04, 2022 @09:06PM (#33089661)
display: none hides the content from screen readers, as it is not rendered.

aria-hidden is for elements that were rendered but are hidden (it's redundant on elements with a display value of `none`)

Re:Templating in HTML by grimgrin on Friday October 07, 2022 @05:59AM (#33119293)
oh yes yes. what was i thinking! ty for correction