Open
Conversation
…xtSuffix; only add img role when there is an altText passed in
Contributor
|
Do you think we could collapse With that, usage would look something like <!-- Render an indicator without a number -->
<craft-badge-indicator label="Updates available" />
<!-- With a number -->
<craft-badge-indicator number="30" label="deprecation warnings" />I'm just thinking that might make it easier so you don't have to remember "If I have a number, I need to use Other than that, I pushed up a few minor tweaks:
|
Contributor
Author
@brianjhanson I was struggling with that one. I originally coded it that way, but I felt like separating them had the following benefits:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Creates a
<craft-badge-indicator/>component that can be used in navigation contexts to indicate whether there are notifications associated with the item. Includes a numbered and non-numbered variant.When using the dot-only variant, you can attach a label to the dot to communicate its purpose to assistive technology. Example: a notification dot in the global navigation has taken on the
imgrole and uses “Has Notifications” as its alternative text.In cases like this, the link should reference the badge ID via
aria-labelledbyoraria-describedbyif the notification text is not otherwise associated with the link’s accessible name.Related issues
Resolves ACC-28, ACC-9