From 071f3d517324627baecb1bb6bd8645e845b796c1 Mon Sep 17 00:00:00 2001 From: Gavin Barron Date: Mon, 22 May 2023 03:46:07 -0700 Subject: [PATCH 1/5] fix: suggested people aria labels (#2335) --- .../src/components/mgt-people-picker/mgt-people-picker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.ts b/packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.ts index cff730fca6..83dd8fbd68 100644 --- a/packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.ts +++ b/packages/mgt-components/src/components/mgt-people-picker/mgt-people-picker.ts @@ -956,7 +956,7 @@ export class MgtPeoplePicker extends MgtTemplatedComponent { person => person.id, person => { const lineTwo = person.jobTitle || (person as User).mail; - const ariaLabel = `${this.strings.suggestedContact} ${person.displayName} ${lineTwo ?? ''}`; + const ariaLabel = `${person.displayName} ${lineTwo ?? ''}`; return html`
  • Date: Fri, 26 May 2023 02:32:05 -0700 Subject: [PATCH 2/5] feat: add custom focus ring color (#2334) adds the ability for developers to define the color used for the focus ring requires the developer to set the --focus-ring-style for application in Firefox uses the General > Theme story as a working example --- .../src/components/mgt-login/mgt-login.scss | 6 +----- .../mgt-components/src/styles/shared-styles.scss | 12 +++++++++++- stories/samples/general.stories.js | 8 ++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/packages/mgt-components/src/components/mgt-login/mgt-login.scss b/packages/mgt-components/src/components/mgt-login/mgt-login.scss index f245ca8929..a22644ae2a 100644 --- a/packages/mgt-components/src/components/mgt-login/mgt-login.scss +++ b/packages/mgt-components/src/components/mgt-login/mgt-login.scss @@ -60,10 +60,6 @@ mgt-login .login-button { border-radius: 4px; } - &:focus { - outline: 0; - } - &:disabled { opacity: 0.4; pointer-events: none; @@ -74,7 +70,7 @@ mgt-login .login-button { } &:focus-visible { - outline: auto; + outline-style: $focus-ring-style; } } diff --git a/packages/mgt-components/src/styles/shared-styles.scss b/packages/mgt-components/src/styles/shared-styles.scss index 6d69e9b7bc..2d1262736b 100644 --- a/packages/mgt-components/src/styles/shared-styles.scss +++ b/packages/mgt-components/src/styles/shared-styles.scss @@ -5,6 +5,8 @@ * ------------------------------------------------------------------------------------------- */ +$focus-ring-style: var(--focus-ring-style, auto); + :host([hidden]) { display: none; } @@ -17,7 +19,15 @@ --theme-primary-color: #0078d7; --theme-dark-color: #005a9e; } - +:focus-visible { + // ensure default is correctly set for Firefox + outline-color: var(--focus-ring-color, Highlight); + // ensure default is set for other browsers + outline-color: var(--focus-ring-color, -webkit-focus-ring-color); + // set the style of the focus ring + // this needs to be something other than auto in Firefox to use the custom color + outline-style: $focus-ring-style; +} .ms-Icon { display: inline-block; font-family: 'FabricMDL2Icons'; diff --git a/stories/samples/general.stories.js b/stories/samples/general.stories.js index 09ceee60a7..7063d41840 100644 --- a/stories/samples/general.stories.js +++ b/stories/samples/general.stories.js @@ -166,10 +166,10 @@ export const cache = () => html` `; export const theme = () => html` -
    +

    I should be dark, regional class

    - +

    I should be light, second level regional class

    @@ -187,6 +187,10 @@ export const theme = () => html`