Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: use outline shorthand instead of compound prop for consistency",
"packageName": "@fluentui/react-button",
"email": "sarah.higley@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
Comment thread
ling1726 marked this conversation as resolved.
"type": "minor",
"comment": "fix: move `outlineStyle: none` out of createCustomFocusIndicatorStyle and to createFocusOutlineStyle",
"packageName": "@fluentui/react-tabster",
"email": "sarah.higley@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ const useRootBaseClassName = makeResetStyles({
...createCustomFocusIndicatorStyle({
borderColor: tokens.colorTransparentStroke,
borderRadius: tokens.borderRadiusMedium,
outline: `${tokens.strokeWidthThick} solid ${tokens.colorTransparentStroke}`,
boxShadow: `
${tokens.shadow4},
0 0 0 2px ${tokens.colorStrokeFocus2}
`,
...shorthands.outline(tokens.strokeWidthThick, 'solid', tokens.colorTransparentStroke),
zIndex: 1,
}),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,9 @@ export interface CreateCustomFocusIndicatorStyleOptions {
*/
export function createCustomFocusIndicatorStyle<TStyle extends GriffelStyle | GriffelResetStyle>(
style: TStyle,
{
selector = defaultOptions.selector,
enableOutline = false,
}: CreateCustomFocusIndicatorStyleOptions = defaultOptions,
{ selector = defaultOptions.selector }: CreateCustomFocusIndicatorStyleOptions = defaultOptions,
Comment thread
smhigley marked this conversation as resolved.
): TStyle extends GriffelStyle ? GriffelStyle : GriffelResetStyle {
return {
':focus': {
Comment thread
ling1726 marked this conversation as resolved.
outlineStyle: enableOutline ? undefined : 'none',
},
':focus-visible': {
outlineStyle: enableOutline ? undefined : 'none',
},

...(selector === 'focus' && {
[`&[${FOCUS_VISIBLE_ATTR}]`]: style,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,18 @@ const getFocusOutlineStyles = (options: FocusOutlineStyleOptions): GriffelStyle
* @returns focus outline styles object for @see makeStyles
*/
export const createFocusOutlineStyle = ({
enableOutline = false,
Comment thread
smhigley marked this conversation as resolved.
selector = defaultOptions.selector,
style = defaultOptions.style,
}: CreateFocusOutlineStyleOptions = defaultOptions): GriffelStyle =>
createCustomFocusIndicatorStyle(
}: CreateFocusOutlineStyleOptions = defaultOptions): GriffelStyle => ({
':focus': {
outlineStyle: enableOutline ? undefined : 'none',
},
':focus-visible': {
outlineStyle: enableOutline ? undefined : 'none',
},

...createCustomFocusIndicatorStyle(
getFocusOutlineStyles({
outlineColor: tokens.colorStrokeFocus2,
outlineRadius: tokens.borderRadiusMedium,
Expand All @@ -78,4 +86,5 @@ export const createFocusOutlineStyle = ({
...style,
}),
{ selector },
);
),
});