Skip to content

docs(material/theming): document strong focus indicators #22374

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

Merged
merged 1 commit into from
Apr 9, 2021

Conversation

jelbourn
Copy link
Member

This adds documentation for strong focus indicators as part of the
theming guide. This feature has been "soft launched" inside Google, but
hasn't been documented for widespread adoption. At this stage, I'm
confident enough in the stability of the feature to document it for
public usage.

@jelbourn jelbourn added P2 The issue is important to a large percentage of users, with a workaround docs This issue is related to documentation merge safe target: major This PR is targeted for the next major release labels Mar 30, 2021
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 30, 2021
@jelbourn jelbourn force-pushed the strong-focus-docs branch from 0467e72 to 95ade49 Compare March 30, 2021 23:11
enable these strong focus indicators via two Sass mixins:
`strong-focus-indicators` and `strong-focus-indicators-theme`.

The `strong-focus-indicators` mixin emits structal indicator styles for all components. This mixin
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is "structal" supposed to be "structural" or "strong"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I did intent to say "structural" versus the color styles from strong-focus-indicators-theme. Would it be better to say "base" or something similar here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Structural makes sense, thanks!

Copy link
Collaborator

@zelliott zelliott left a comment

Choose a reason for hiding this comment

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

Just a quick note that I still have #19319 hanging over my head, which I'm hoping to find time to get to (someday). The proposed changes in that PR change the customization API, and we'll need to update these docs.

should be included exactly once in an application, similar to the `core` mixin described above.

The `strong-focus-indicators-theme` mixin emits only the indicator's color styles. This mixin should
be included once per theme, similar to the theme mixins described above.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe that the mixin also needs to be included in cases where the background color is not contrastive against the focus indicator's color. The example that comes to mind is mat-toolbar.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, added a sentence mentioning this.

Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -367,6 +367,83 @@ $my-palette: mat.define-palette(mat.$indigo-palette);
}
```

## Strong focus indicators

By default, most components indicate browser focus by changing their background color as prescribed
Copy link
Member

Choose a reason for hiding this comment

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

Should it be "described" rather than "prescribed"?

Copy link
Member Author

Choose a reason for hiding this comment

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

"Prescribed" is what I intended, for the definition "state authoritatively or as a rule that (an action or procedure) should be carried out." Is it too weird?

Copy link
Member

Choose a reason for hiding this comment

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

As a non-native speaker, I've only heard "prescribed" as something somebody strongly recommends to you (e.g. prescribed medicine), but it might just be me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to "described"

Copy link
Member Author

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

@zelliott I forgot about #19319- what ended up stalling that one? How strongly do you feel about landing those changes any time in the near future? Once we formally "ship" this feature (by documenting it), future changes will be subject to Angular's breaking change policy.

@@ -367,6 +367,83 @@ $my-palette: mat.define-palette(mat.$indigo-palette);
}
```

## Strong focus indicators

By default, most components indicate browser focus by changing their background color as prescribed
Copy link
Member Author

Choose a reason for hiding this comment

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

"Prescribed" is what I intended, for the definition "state authoritatively or as a rule that (an action or procedure) should be carried out." Is it too weird?

enable these strong focus indicators via two Sass mixins:
`strong-focus-indicators` and `strong-focus-indicators-theme`.

The `strong-focus-indicators` mixin emits structal indicator styles for all components. This mixin
Copy link
Member Author

Choose a reason for hiding this comment

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

I did intent to say "structural" versus the color styles from strong-focus-indicators-theme. Would it be better to say "base" or something similar here?

should be included exactly once in an application, similar to the `core` mixin described above.

The `strong-focus-indicators-theme` mixin emits only the indicator's color styles. This mixin should
be included once per theme, similar to the theme mixins described above.
Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, added a sentence mentioning this.

## Strong focus indicators

By default, most components indicate browser focus by changing their background color as prescribed
by the Material Design specification. This behavior, however, can fall short of accessibility
Copy link
Contributor

@twerske twerske Apr 1, 2021

Choose a reason for hiding this comment

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

I'm wondering if we can add when it can fall short, and if it does universally, why wouldn't I just always enable strong focus indication if it's a known shortcoming? When would I require a stronger indication of browser focus? Maybe just a visual example of what this looks like would be helpful

Copy link
Member Author

Choose a reason for hiding this comment

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

IIRC WCAG 2.2 implies that strong focus indicators are necessary but doesn't outright say it. Google'e internal requirements don't require it today, but probably will in the next year or so. We don't do this by default because it's not included in the Material Design spec. I've communicated to MD that it's a priority for us, but haven't seen any movement on it yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, makes sense this is in the main theming guide then and likely should be built in!

@jelbourn jelbourn force-pushed the strong-focus-docs branch from 95ade49 to f9bc34a Compare April 8, 2021 18:28
@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Apr 8, 2021
This adds documentation for strong focus indicators as part of the
theming guide. This feature has been "soft launched" inside Google, but
hasn't been documented for widespread adoption. At this stage, I'm
confident enough in the stability of the feature to document it for
public usage.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement docs This issue is related to documentation P2 The issue is important to a large percentage of users, with a workaround target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants