Skip to content

Commit ce33451

Browse files
authored
Make focus outline an inset for slotted stealth button (#110)
Co-authored-by: Frédéric Collonval <[email protected]>
1 parent bbe93e8 commit ce33451

File tree

1 file changed

+9
-0
lines changed
  • packages/components/src/styles/patterns

1 file changed

+9
-0
lines changed

packages/components/src/styles/patterns/button.ts

+9
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,15 @@ export const StealthButtonStyles = css`
552552
:host([appearance='stealth']) .control:${focusVisible} {
553553
outline-color: ${accentFillFocus};
554554
}
555+
556+
/* Make the focus outline displayed within the button if
557+
it is in a start or end slot; e.g. in a tree item
558+
This will make the focus outline bounded within the container.
559+
*/
560+
:host([appearance='stealth'][slot="end"]) .control:${focusVisible},
561+
:host([appearance='stealth'][slot="start"]) .control:${focusVisible} {
562+
outline-offset: -2px;
563+
}
555564
`.withBehaviors(
556565
forcedColorsStylesheetBehavior(css`
557566
:host([appearance='stealth']),

0 commit comments

Comments
 (0)