It seems we can use aria-details combined with role="term" and role="definition" like this:
<details><summary><spanrole="term"aria-details="bezier">Bezier curve</span></summary></details><divrole="definition"id="bezier"class="content">Bezier cruve is a mathematically
described curve used in computer graphics and animation...</div>
When aria-details is included on an element, assistive technologies inform users of the availability of extended information, enabling the user to navigate to the referenced content.
aria-details allows assistive technology users to visit the associated structured content and provides additional navigation commands, making it easier to understand the structure, or to experience the information in smaller pieces.
When it comes to definition and term roles, the aria-details would be included on the term element with the id of the element with a definition role.
It would be cool! Do you think in-browser search will open details if the words match? scottohara.me/blog/2022/09/12/deta... (Special find-in-page behavior)
That would be really cool. I tried it, but it didn't work by default.
Besides, it looks that the in-browser search does not actually modify the style of the highlighted text. Otherwise, alternatively, I think we could try a solution using the ::selection CSS pseudo-element in a CSS selector like div.content:has(p::selection).
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It seems we can use
aria-detailscombined withrole="term"androle="definition"like this:Link to documentation with example
It would be cool! Do you think in-browser search will open details if the words match?
scottohara.me/blog/2022/09/12/deta... (Special find-in-page behavior)
That would be really cool. I tried it, but it didn't work by default.
Besides, it looks that the in-browser search does not actually modify the style of the highlighted text. Otherwise, alternatively, I think we could try a solution using the
::selectionCSS pseudo-element in a CSS selector likediv.content:has(p::selection).