Skip to content

Commit 9a0e571

Browse files
changed style for focused VarianSelect element (npm#248)
1 parent 34b4818 commit 9a0e571

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

theme/src/components/variant-select.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@
66

77
import React from 'react';
88
import styled from 'styled-components';
9-
import { Dropdown } from '@primer/components';
9+
import { Dropdown, themeGet } from '@primer/components';
1010
import NavHierarchy from '../nav-hierarchy'
1111

1212
VariantSelect.Menu = styled(Dropdown.Menu)`
1313
width: ${props => props.width ? props.width : '160px'};
1414
`
1515

16+
VariantSelect.Button = styled(Dropdown.Button)`
17+
&:focus {
18+
box-shadow: 0 0 0 3px ${themeGet('colors.blue.5')};
19+
}
20+
`
21+
1622
function VariantSelect(props) {
1723
const path = NavHierarchy.getPath(props.location.pathname);
1824
const vp = NavHierarchy.getVariantAndPage(props.root, path);
@@ -95,7 +101,7 @@ function VariantSelect(props) {
95101
return (
96102
<div ref={wrapper}>
97103
<Dropdown onKeyDown={onDropDownKeyDown} overlay={props.overlay}>
98-
<Dropdown.Button>{selectedItem.variant.title}</Dropdown.Button>
104+
<VariantSelect.Button>{selectedItem.variant.title}</VariantSelect.Button>
99105
<VariantSelect.Menu direction={props.direction} width={props.menuWidth}>
100106
{items}
101107
</VariantSelect.Menu>

0 commit comments

Comments
 (0)