File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @primer/react ' : patch
3+ ---
4+
5+ Updates styles for the Select component so that the focus outline is even all the way around.
Original file line number Diff line number Diff line change @@ -7,8 +7,11 @@ export type SelectProps = Omit<
77 'multiple' | 'hasLeadingVisual' | 'hasTrailingVisual' | 'as'
88>
99
10+ const arrowRightOffset = '4px'
11+
1012const StyledSelect = styled . select `
1113 appearance: none;
14+ border-radius: inherit;
1215 border: 0;
1316 color: currentColor;
1417 font-size: inherit;
@@ -20,8 +23,13 @@ const StyledSelect = styled.select`
2023
2124 background-color should be 'transparent', but Firefox uses the background-color on
2225 <select> to determine the background color used for the dropdown menu.
26+
27+ 2. Adds 1px margins to the <select> so the background color doesn't hide the focus outline created with an inset box-shadow.
2328 */
2429 background-color: inherit;
30+ margin-top: 1px;
31+ margin-left: 1px;
32+ margin-bottom: 1px;
2533
2634 /* 2. Prevents visible overlap of partially transparent background colors.
2735
@@ -50,7 +58,7 @@ const ArrowIndicatorSVG: React.FC<{className?: string}> = ({className}) => (
5058const ArrowIndicator = styled ( ArrowIndicatorSVG ) `
5159 pointer-events: none;
5260 position: absolute;
53- right: 4px ;
61+ right: ${ arrowRightOffset } ;
5462 top: 50%;
5563 transform: translateY(-50%);
5664`
You can’t perform that action at this time.
0 commit comments