-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Conversation
0467e72
to
95ade49
Compare
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 |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Structural makes sense, thanks!
There was a problem hiding this 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.
guides/theming.md
Outdated
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. |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
guides/theming.md
Outdated
@@ -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 |
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to "described"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
guides/theming.md
Outdated
@@ -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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
guides/theming.md
Outdated
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. |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
95ade49
to
f9bc34a
Compare
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.
f9bc34a
to
b166363
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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.