Skip to content

Conversation

@adolgachev
Copy link
Contributor

Add additional styling when forced colors is active to show an extra outline in the toolbar examples.

@adolgachev adolgachev requested review from tjshiu and removed request for wagnermaciel January 26, 2026 20:11
@adolgachev adolgachev added Accessibility This issue is related to accessibility (a11y) target: patch This PR is targeted for the next patch release dev-app preview When applied, previews of the dev-app are deployed to Firebase action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 26, 2026
@github-actions
Copy link

github-actions bot commented Jan 26, 2026

Deployed dev-app for c0a5bfb to: https://ng-dev-previews-comp--pr-angular-components-32708-dev-juvesjka.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@adolgachev adolgachev changed the title fix(aria/toolbar): show outline on selected items when forced colors active fix(aria/toolbar): show outline on selected items when forced colors active in examples Jan 26, 2026
@adolgachev adolgachev added the action: presubmit The PR is in need of a google3 presubmit label Jan 27, 2026
.example-button[aria-pressed='true'],
.example-button[aria-checked='true'],
.example-option[aria-selected='true'] {
outline: solid 1px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably should use a system color to show it's selected: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/system-color. - SelectedItem?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that first, but there is an issue with the way we use icons here (and other places not SVG) where with active forced-colors the icon has a black opaque background.

Given this is just an example, I didn't want to change more and outline seemed good enough for now. We could also tweak the styling to be closer to material buttons but again, I don't think worth it in this case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But how about the outline be colored/thicker: This just looks kind of faint
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

With 2px, consecutive selections end up with no space between them. Might be okay, but not sure I like the way that looks.

With forced colors, I think it's just black/white and highlighted text with the latter reserved for focus.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have never seen HCM use Highlight Color for focus -
For example: https://benmyers.dev/blog/whcm-outlines/ & https://sarahmhigley.com/writing/whcm-quick-tips/. Even for Google Material Wiz/ACX.

It's hard to find documentation on what is recommended. Personally, I prefer using a system color for select or 2px looks more clear in my opinion. But I will leave it up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can go with the 2px, that seems okay. It's just an example.

We already use the highlight color for hover and focus in these examples.

I couldn't find a system color that shows up as anything other than black/white in the HCM on chrome (other than the highlight).

Given that this is just our examples, I don't think we should spent too much time on revisiting the simple theme we used here, since we're not shipping the styling portions.

@adolgachev adolgachev removed the request for review from andrewseguin January 30, 2026 03:33
@adolgachev adolgachev added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer action: presubmit The PR is in need of a google3 presubmit labels Jan 30, 2026
@adolgachev adolgachev merged commit 06e3d75 into angular:main Jan 30, 2026
27 checks passed
@adolgachev
Copy link
Contributor Author

This PR was merged into the repository. The changes were merged into the following branches:

adolgachev added a commit that referenced this pull request Jan 30, 2026
@adolgachev adolgachev deleted the aria-toolbar-active branch January 30, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Accessibility This issue is related to accessibility (a11y) action: merge The PR is ready for merge by the caretaker dev-app preview When applied, previews of the dev-app are deployed to Firebase target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants