-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Update PeoplePicker focus styles for the close button - Add borderRadius to getFocusStyle #24596
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "chore: Fix people picker focused styles", | ||
| "packageName": "@fluentui/react", | ||
| "email": "mgodbolt@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "chore: Add radius option to getFocusStyles", | ||
| "packageName": "@fluentui/style-utilities", | ||
| "email": "mgodbolt@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ export function getFocusStyle(theme: ITheme, options?: IGetFocusStylesOptions): | |
| * @param borderColor - Color of the border. | ||
| * @param outlineColor - Color of the outline. | ||
| * @param isFocusedOnly - If the styles should apply on focus or not. | ||
| * @param borderRadius - If the style should include a rounded border. | ||
| * @returns The style object. | ||
| * @deprecated Use the object parameter version instead. | ||
| */ | ||
|
|
@@ -34,6 +35,7 @@ export function getFocusStyle( | |
| borderColor?: string, | ||
| outlineColor?: string, | ||
| isFocusedOnly?: boolean, | ||
| borderRadius?: string | number | undefined, | ||
| ): IRawStyle; | ||
| export function getFocusStyle( | ||
| theme: ITheme, | ||
|
|
@@ -43,6 +45,7 @@ export function getFocusStyle( | |
| borderColor?: string, | ||
| outlineColor?: string, | ||
| isFocusedOnly?: boolean, | ||
| borderRadius?: string | number | undefined, | ||
| ): IRawStyle { | ||
| if (typeof insetOrOptions === 'number' || !insetOrOptions) { | ||
| return _getFocusStyleInternal(theme, { | ||
|
|
@@ -52,6 +55,7 @@ export function getFocusStyle( | |
| borderColor, | ||
| outlineColor, | ||
| isFocusedOnly, | ||
| borderRadius, | ||
| }); | ||
| } else { | ||
| return _getFocusStyleInternal(theme, insetOrOptions); | ||
|
|
@@ -60,6 +64,7 @@ export function getFocusStyle( | |
|
|
||
| function _getFocusStyleInternal(theme: ITheme, options: IGetFocusStylesOptions = {}): IRawStyle { | ||
| const { | ||
| borderRadius, | ||
| inset = 0, | ||
| width = 1, | ||
| position = 'relative', | ||
|
|
@@ -94,6 +99,7 @@ function _getFocusStyleInternal(theme: ITheme, options: IGetFocusStylesOptions = | |
| border: `${width}px solid ${borderColor}`, | ||
| outline: `${width}px solid ${outlineColor}`, | ||
| zIndex: ZIndexes.FocusStyle, | ||
| borderRadius: borderRadius, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this also allow the shorthand, e.g.:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it allows string or number
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| selectors: { | ||
| [HighContrastSelector]: highContrastStyle, | ||
| }, | ||
|
|
||

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.
very minor nit: since we use
insetabove, it might be nice to useinset: 1here tooThere 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.
done