-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
<callout>
element for callouts/alerts/admonitions
#10100
Comments
A new element would require some parser changes (to make it close ARIA has a |
I think it's a good idea to pave a cowpath like this. However, can you say more about how the proposed element would be an accessibility improvement? /cc @whatwg/a11y It sounds like you're suggesting it be a sectioning element. Concretely, do you mean that like a |
If I am reading a text that contains callouts I may read a sentence or two and decide it does not apply to me and skip down to continue reading the main text. Later, I may realize I should have read it and scan up looking at the callouts for the one I skipped. I imagine the equivalent actions for screen readers would be a key combo to exit the current callout to the main text and some means to navigate by callouts. |
I find that imagining how screen readers behave can be counterproductive. |
Another accessibility benefit of standardised callouts/alerts/admonitions could be (the potential of) personalisation, for cognitive disabilities, and more useful rendering in reader modes. |
i'll admit i'm not quite sure how a proposed |
I will let the a11y experts comment on the specifics of the semantics (@matatk ? @alice?), my understanding is merely that divs are insufficient and blockquotes are flat out wrong, yet these are what is most frequently used right now. Authors are much more willing to use HTML elements than ARIA as it also provides DX benefits. The default UA styling is merely further motivation (if done well). It seems very clear from the current state of things that asking authors to hand roll it doesn't work well. It's also entirely possible the underlying AT doesn't provide great primitives for callouts — that’s another reason to have an element: the element can be associated with the current state of the art in and once the underlying technology improves, the element semantics can be upgraded transparently, upgrading the web for AT users in one fell swoop, rather than having to painfully educate authors once more. |
good to know that I don't count as an a11y expert... ;) |
Settle down Patrick ;) I pinged two specific a11y experts because they are or have been on the TAG, as I wanted to capture that particular perspective in the thread (especially since the proposal came out of a convo with one of them). In case it's not obvious, I was not implying that the parentheses in my comment were an exhaustive list of all a11y experts in the world (they’re not even an exhaustive list of the ones I know personally!). |
Generally agree that this would be nice, but I'd modify the proposal a bit, as currently the proposed use cases for this single element could actually touch on a few different potential roles / potential elements. for instance, if done "right" now, a warning/alert could be (for example) a if it's a note/example, like what is used in the WHATWG/W3C specs, then role=note would be appropriate (i've actually wanted a 'note' element for awhile now.) I know it was referenced as one of the 'wrong' things (and likely is misused in a lot of cases) but a "callout" could potentially even be a correctly used blockquote, if it actually represents a quote from another source. In my opinion, it would be good to have a distinction here (and thus maybe this could be a proposal for 2 elements), rather than considering all the mentioned use cases a single 'callout'. For instance, if there was a If And then people use the existing elements, styled as they wish, for the remaining use cases that 'could' be 'callouts'. |
@scottaohara Wouldn't |
Yes, potentially. That is if using the
If by 'generic' you mean one type of potential role that could be used to apply to all of these / all of these non-note types... eh? That seems like it'd be a miss if that was the desired route and could overlap with existing elements like article or section then. I did mention some roles that these sorts of callouts could be marked up as in my previous comment. but the callouts that are more 'important' (warnings, errors/alerts, potentially dynamic info messages) could be exposed as status and alert roles (ideally with a way to indicate if they should be treated as an auto-live region, or not). They could potentially repurpose the region or complementary landmark roles (which are already handled by section and aside)... but I personally think it makes more sense for someone to be very mindful about when they use landmarks... the more landmarks that are added to page, the less useful they end up being... The 'tips, examples and notes' could all arguably be under the But, going any further down those rabbit holes probably need to have the original question answered, if it's desired for |
@scottaohara
Agreed. Is there any way to prioritize landmarks? If not, should there be?
Agreed. Though I still think the distinction could be useful for AT users from a UX perspective: I imagine an AT user may choose to e.g. skip tips or examples in a document but may still want to read notes. A sighted user can easily do that as they're styled differently. So perhaps all three could still be using a For custom callouts, I was envisioning things that are too purpose/domain-specific to be standardized. E.g. in my book I had callouts called "Future" which described future web standards developments: Is there value in these types of callouts using a separate element? Presumably the benefit of AT users being able to skip that kind of content easily still applies? |
@LeaVerou i had a much longer response to specifically answer/dig into some of your previous comment, but I think maybe that makes more sense to discuss separately, if you want. Rather, I will respond by saying that, I do appreciate/want this proposal to progress. If type can be used to allow users to determine the semantics, then great. we can work out what each type could be, though there would likely be overlap in the underlying ARIA semantics, and there would need to be clear author guidance as to what would be appropriate for each callout type. But I think to hopefully address your question about a generic/custom callout - this is where there is exact overlap with popup I mentioned. If there's no known/defined purpose for such content, but it is important to emphasize, is this not just a section or article element that is styled to look like a callout? Potentially even a div with a heading. If roles are based on the type, and then there's a ? for what a generic/custom version looks like - to me that says it's up to the developer to figure that out and potentially reach for the correct element instead and apply styling to that. I mean, the styles that consistently apply to these elements are largely variations of background colors and maybe a border or icon. Not a big LOE to create using the appropriate element. |
To make @scottaohara's point a bit more concrete, from my perspective this proposal is blocked on explaining the exact accessibility benefits, in the form of ARIA mappings for each potential state of the element. Especially if (as some have suggested) this involves new roles, or modifying AT behavior in a way that goes beyond roles, then that would be a significant lift which we've rarely succeeded with in the past. The best ARIA mappings I can see right now are just the same as that which section has, so, if people believe a dedicated element is a good idea here, please suggest something better. |
That sounds like you're reducing accessibility to ARIA mappings? Even if those are non existent, distinctions can be helpful beyond AT, including for personalisation, COGA and reader modes, which can all improve accessibility for specific users (sorry for almost |
The benefits have to be concrete, not speculative, and cannot depend on as-of-yet unrealized downstream inventions. If your new markup idea requires implementation work beyond browsers it will have to be enormously compelling (and likely it isn't). |
This was opened with assertions conveyed from an IRL conversation, but not everyone in that conversation has weighed in with all the potential scenarios / benefits they discussed. That might be useful. Seeing this construct in print as a sighted reader is often confusing to me because sometimes it is redundant with the content (a visual flair to repeat a particular statement), sometimes a parenthetical thought, sometimes a de facto footnote, and so on. IMO, To @hidde's question, if we want to expose these in any meaningful way to SR users then ARIA mappings are where to start. COGA SR users would be included in that. Otherwise, can you identify how you think a new element / type might help other users (that are not strictly visual affordances an author could do or undo on their own)? |
Anne said:
ok Adrian said:
Helpfulness that I was thinking of would be in that software/plugins could make visual affordances that could be consistent across websites, rather than different everywhere. But to @annevk's point that is very much not concrete and would require implementation work beyond browsers (except maybe for browser reader mode use case, that's in a browser). Maybe a comparable case is WCAG's 1.3.5; some also cited personalisation/COGA as the main reason for including it (see John Foliot's reply in this thread. But that too is (arguably) speculative. If speculative is outside of scope here, please do ignore my comment above. |
I’ve already pinged @matatk to weigh in, though not sure what his availability is. Re: concrete benefits (beyond what @hidde mentioned, which I agree with):
|
Hello everyone :-). Thanks @LeaVerou for the ping, and starting this discussion. Regarding calling out the callout to assistive technology, I think it's important to demarcate the bounds of the note, so some sort of I wasn't able to find any current info on how well I'm wondering if we'd want to do anything to indicate the relative importance of the note—e.g. do we want to distinguish between warnings and notes, for example? I imagine that the ARIA WG has discussed this, when they created the I also think we should carefully consider @patrickhlauke's point, that there are a lot of ways notes etc. are used, and we should be able to demonstrate that we're making an improvement in a large number of those use cases, particularly for AT users. Maybe we can do some querying of the HTTP Archive to check on common patterns? tl;dr of my thoughts for now...
HTH! |
I did some spec archeology for https://www.w3.org/TR/2008/WD-wai-aria-20080806/#note Before that, it was in the first version of XHTML Role Attribute Module FPWD from 2006: https://www.w3.org/TR/2006/WD-xhtml-role-20060725/#s_role_module_attributes Before that, it was in XHTML 2 from 2005 (but not in 2004): https://www.w3.org/TR/2005/WD-xhtml2-20050527/xhtml2.html#col_Role I found https://annevankesteren.nl/2005/04/role-attribute which links to https://lists.w3.org/Archives/Public/w3c-wai-ig/2005AprJun/0127 which might be the first public discussion preceding the I also found this email which is W3C Member-only: https://lists.w3.org/Archives/Member/w3c-html-wg/2005JanMar/0012.html which says that the The only discussion in GitHub w3c/aria I could find is w3c/aria#1629 and PR w3c/aria#1639 |
Appreciate you commenting @matatk. As an FYI, I've requested this be discussed during the next ARIA wg call to gather other thoughts/feedback so I can succinctly report on that. I've been saving further comments to this thread until after that discussion. |
I very quickly tested Desktop Firefox 122:
with NVDA 2023.3:
Chrome 121:
with JAWS 2024:
Edge 121:
with Narrator Win11 23H2:
Safari 17.3:
with VoiceOver / macOS 14.3:
Mobile: Chrome 120 with TalkBack 14.1:
Firefox 121 with TalkBack 14.1:
Safari / iPadOS 17.3 with VoiceOver:
|
Thanks @aardrian! So if I understand correctly, only JAWS does something interesting for unlabelled
Is this useful? What is ideal? OP says it's important for SR users to know where the callout ends. Would it be good for other kinds of callouts (e.g. tips, warnings, cautions) to be announced as "Note", or should those be separate (new) |
We only briefly discussed this in the ARIA wg yesterday. Ran out of time. Only going to comment at this point that all the mentioned types are not appropriate for |
Does something, yes. Whether or not users consider that helpful or interesting is a different story.
No idea. Depends on context.
I don't agree with that as a blanket statement, since context is critical. Maybe start this conversation with how regions are exposed (using accNames) so there is some parity.
IMO, probably not. Partly because those are so broad that I think they may map to existing roles -- depending on context. Scott answered while I was typing. I would like the ARIA WG to have a chance to mull this. |
Sounds like you are talking about a pullquote, not a callout |
Is there room to include something like what I called As a largely-able-body user of TUI browser & browser reader modes, allowing a user agent to give me a nice user experience help in these environments as well where existing (Also, are there any avenues for public discussion that don’t involve proprietary Microsoft GitHub software? I would like to participate as I’ve been called out under “Prior art”, but I don’t enjoy the lack of freedom/privacy on this platform) |
Mostly I was acknowledging that OP cited her book for analogous patterns. Since I have not read that book and therefore lack that context, I spoke about more generalized patterns I have seen in print instead (one of which would indeed be a pull quote). |
Fair enough, I just updated the comment to include a picture. |
@toastal wrt
|
Ah, it was the term ‘slot’ that threw me off. When I was pitching ideas, I wasn’t sure how locked-in certain elements/attributes were to their current context ( |
Thanks! Cited image: A book open to pages 56 and 57, in chapter 2 "Backgrounds & Borders." The two pages broadly discuss and demonstrate CSS to make tiling background patterns. One of the pages is mostly taken up by a white-on-black block that discusses future support and code for conic gradients in CSS. IMO, that is an |
Thanks! Updated the comment with that much better alt text 😄
Fair enough, I will try to unearth some of the other custom callouts I have seen over the years. It is also entirely possible we find that the cost-benefit of supporting custom callouts is not worth it, and we decide to focus on the predefined ones (in which case it may be preferable to spec these as separate elements, e.g. |
so "A Brief Aside" / sidebars would use the W3C documents have examples of notes - they're not strictly asides, they fall within the logical flow of their parent content, but are intended to catch the reader's attention / indicate importance
Similarly, Bootstrap uses coloured blocks/notes to draw attention to something in most cases, rather than mentioning something in passing/as an aside.
As the semantic distinction between a "note" and a "warning" or similar seems fairly difficult to pin down, I'd be in favour of at least exploring the possibility of a |
MkDocs (not an endorsement) <https://squidfunk.github.io/mkdocs-material/reference/admonitions/> has some atypical additions `question`, `success`, `failure`, `example`, `bug`. I think `abstract` & `quote` are more obviously ill-suited, but the rest I could see arguments for & against whether these semantically are callout or more emphasis is on visual harmony than semantics. Is there still value in allowing this *visual* representation—especially when one has access to say `role=complementary`. Related: is it inevitable that folks will start using the element ‘incorrectly’ or ‘unsemantically’ (as many have seen already with <aside> & <blockquote>) as user agent support would give you *a nice-looking titled box* & is there a way to prevent and/or accommodate for such usage even if usage is unsemantic (e.g. custom types are not `role=note`, etc.)
--
toastal ไข่ดาว | https://toast.al
PGP: 7944 74b7 d236 dab9 c9ef e7f9 5cce 6f14 66d4 7c9e
|
At this time the ARIA wg thinks the scope of this proposal is too broad. Though these types of callouts are all similarly styled, it does not mean they are semantically equivalent. For those diverging semantics, many of the proposed types could be handled just fine by current HTML elements (e.g., a named section, or aside) or by using a It was understood that a Here are the minutes from the aria call. Not everything said was captured in the minutes, hence my general summary in this comment. We acknowledge the issue that this proposal was trying to take care of (people styling divs rather than providing meaningful semantics for their content), but it seems more of an issue that authors are not using the tools already available to them. |
Could you please expand on that? As mentioned by Lea Verou, it seems that there is no consensus on the best way to catch the reader's attention / indicate importance using existing tools. Are you suggesting that https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/note_role is enough? <div role="note" aria-labelledby="note-label">
<strong id="note-label">Important</strong>
<p>While werewolves are hardy community members, keep in mind the following dietary concerns:</p>
<ol>
<li>They are allergic to cinnamon.</li>
<li>More than two glasses of orange juice in 24 hours makes them howl in harmony with alarms and sirens.</li>
<li>Celery makes them sad.</li>
</ol>
</div> |
Would be nice if a unique ID for the whole document wasn’t required for every callout title. These can be a pain to generate & I don’t think you can reference relatively, no?
|
That is a general problem with ARIA. I have a few ideas on how it could be solved, but not sure there's desire to evolve that part of the web platform. |
@ggrossetie it's been mentioned multiple times in this thread that the different types proposed fall into different existing semantics (either HTML elements or ARIA roles). Per your assumption that i was saying role=note was enough, i specifically mentioned that was not the case. @toastal, that's assuming every callout needs to be named, and particularly for notes, that may not be the case. For instance, unless there is a specific visible heading/label, a note wouldn't benefit from a name. And generically naming it as a note would result in its name and role being duplicative of each other. For other cases, like exposing important notifications (alerts, warnings, other important info) then yah, you could name a section and thus get it to expose the region landmark. If IDs are a bother, then you could always just use As an FYI, there are some other efforts in ARIA to retrieve name from encapsulation, rather than needing specific IDs for certain roles. But it's easier said than done (and also off topic for this thread). @LeaVerou you can always bring those ideas to ARIA so they can be discussed. |
@scottaohara I understand that, but the WG ARIA seems to suggest that there are already tools to manage the different types of callouts. I wanted to have concrete examples. For a note, an example, or a tip, is the structure I proposed semantically correct/recommended? And what is the semantic difference between a note and an important callout? In both cases, the author emphasizes a specific point. The qualifier important might be "subjective"; it's a note that the author considers important or more important than a classic note.
In my opinion, a notification and a callout are not the same. A notification is a short-lived, contextual information generally in response to a user action. It's also not closely related to the content since notification are often displayed as a popover on a corner of the screen. I guess |
@ggrossetie He provided at least 5 concrete methods. It's impossible to know what maps to the ideas in your head unless you have examples and their surrounding context.
A This issue is, IMO, slowly turning into tech support for existing HTML and ARIA. If you can pull together a series of concrete examples then perhaps this is a discussion (not issue) to raise with the ARIA WG. If nothing else, it could be useful for others struggling with how to map what already exists. |
We're getting to the usual problem of the vagueness and overlap of language and terminology here, I fear (and yes, for dynamic notifications, we're probably thinking more along the lines of |
I can provide a series of concrete examples. In fact, there are many examples in the wild: Wikipedia, MDN, specifications (WebGL, WHATWG, AsciiDoc...), books written with DocBook (when admonitions are used)... What is the recommended channel? |
@ggrossetie ARIA WG discussion (not issue): |
I started writing this as an ARIA proposal, then ended up posting it here, as the problem applies more generally to HTML and I don't think it would be a good path to come up with an ARIA-specific solution: #10143
That’s …the wrong attitude. 😕 From a UI design point of view, if users keep struggling to use an interface properly, the fault lies with the interface, not the users. If nearly everyone on the web is getting callouts wrong, the solution is not to wiggle a finger at them telling them to get it right dammit, it's to simplify the syntax so they can get it right without too much knowledge/effort. |
I was responding to the request for an explanation of the differences in semantics. Which is why I redirected to an ARIA WG discussion because, counter to your earlier suggestion, there is indeed "desire to evolve that part of the web platform." It just needs participation and a willingness to understand how it is already exposed and what that means for users.
Authors. If authors are struggling to fit their mental model into something that will make sense for users (the people consuming the web content authors create), then yes, better documentation, revised specs, and so on can help. Part of why I suggested moving the convo for those specific cases they cited.
I don't think I did that? I was trying to keep this thread from being an ARIA / AAPI explainer is all. But if that is the perception then I am happy to step back. I have no interest in wasting anyone's time. |
I meant "users" as in the users of the interfaces (syntax) we are designing here (i.e. authors). But making it easier for authors to use the right semantics benefits end-users too. Documentation helps, but it's a last resort when improving the UI itself is not tenable.
I was reacting to the comment that "tech support for existing HTML and ARIA" is not relevant to the discussion. Seeing what users struggle with is incredibly useful in figuring out what needs improvement. And to the conclusion that we don't need a new element because callouts could be created with the existing primitives. |
@LeaVerou my response of opening an ARIA issue was regarding your response to toatal, where you seemed to be implying you had ideas about not needing IDs to reference things. If you have thoughts on that, we'd be happy to hear them. |
Anecdotally, I find myself looking for ARIA-team-published examples for trying to get accessible markup. Currently there is no examples for callouts--and most of markup in the wild is currently lacking in both semantics & accessibility. At a minimum, it would be nice to come together on that example if a new element is not seen as a viable solution to the pattern problem. |
What problem are you trying to solve?
Callouts (aka admonitions or alerts) like notes, tips, warnings, etc. are very common in documents. However, there is no clear way to mark them up correctly, and the ways authors devise often suffer from poor accessibility (talking about it with @matatk, it’s important that they are marked up with a sectioning element, so that screen reader users know where the callout ends, but plain divs are used more often than not).
What solutions exist today?
Every design system invents their own, and the vast majority use divs. A few examples:
<blockquote>
::before
for the labelHow would you solve it?
An MVP could simply be a new
<callout>
element with proper semantics and some light base styling by default.Ideally, you want this to provide more value to authors than semantics, to motivate them to use it. One wya to do that is to support a slot for labels, and an optional
type
attribute, with predefined values (note
,tip
,warning
,example
etc.) orcustom
(which would be the default), and alabel
attribute. The predefined callout types would produce an automatically localized label and slightly different styling. For things that require formatting, where an attribute is not sufficient, authors can use thelabel
slot directly.Later, we could increase the value proposition further, via an
icon
slot and anicon
attribute, which can take either a string (for emojis), a URL, or certain keywords.Anything else?
Prior art:
The text was updated successfully, but these errors were encountered: