Skip to content

Commit 4f41af1

Browse files
authored
feature-upgrade/button - Focus state color can be controled (#1183)
added a focus color property to control the focus state color for further use and more customizability
1 parent 6718d47 commit 4f41af1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/uui-button/lib/uui-button.element.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export type UUIButtonType = 'submit' | 'button' | 'reset';
5050
* @cssprop --uui-button-contrast-disabled - overwrite the text color for disabled state
5151
* @cssprop --uui-button-content-align - Overwrite justify-content alignment. Possible values: 'left', 'right', 'center'.
5252
* @cssprop --uui-button-transition - Add transition to the button. Default is none.
53+
* @cssprop --uui-focus-outline-color - overwrite the focus outline color
5354
*/
5455
@defineElement('uui-button')
5556
export class UUIButtonElement extends UUIFormControlMixin(
@@ -358,7 +359,7 @@ export class UUIButtonElement extends UUIFormControlMixin(
358359
}
359360
360361
#button:focus-visible {
361-
outline: 2px solid var(--color-emphasis);
362+
outline: 2px solid var(--uui-focus-outline-color, var(--color-emphasis));
362363
}
363364
364365
button[disabled]:active,

packages/uui-button/lib/uui-button.story.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const meta: Meta = {
4646
options: ['left', 'center', 'right'],
4747
},
4848
'--uui-button-transition': { control: { type: 'text' } },
49+
'--uui-focus-outline-color': { control: { type: 'color' } },
4950
},
5051
render: args => {
5152
return html`<uui-button ${spread(args)}>${renderSlots(args)}</uui-button>`;

0 commit comments

Comments
 (0)