Skip to content

Instantly share code, notes, and snippets.

@luxplanjay
Created September 15, 2021 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luxplanjay/0d97c5a67f23041b72bba061f896cc31 to your computer and use it in GitHub Desktop.
Save luxplanjay/0d97c5a67f23041b72bba061f896cc31 to your computer and use it in GitHub Desktop.
export const StyledListbox = styled(Listbox)`
position: relative;
min-width: 280px;
${props => props.theme.typography('primaryText')}
[data-reach-listbox-button] {
display: flex;
align-items: center;
height: 48px;
width: 100%;
padding: ${props => props.theme.spacing(0, 1.5, 0, 2)};
border-color: ${props => props.theme.palette.gray[600]};
color: ${props => props.theme.palette.common.black};
cursor: pointer;
outline: none;
&[aria-expanded='true'] {
border-color: ${props => props.theme.palette.gray[800]};
}
}
[data-reach-listbox-arrow] {
display: inline-flex;
align-items: center;
color: ${props => props.theme.palette.gray[800]};
transition: ${({ theme: { transition } }) => {
return `transform ${transition.duration.short}ms ${transition.easing.easeInOut}`;
}};
&[data-expanded] {
transform: rotate3d(1, 0, 0, 180deg);
}
}
[data-reach-listbox-popover] {
width: 100%;
padding: ${props => props.theme.spacing(1, 0)};
border-color: transparent;
background-color: ${props => props.theme.palette.common.white};
box-shadow: ${props => props.theme.shadows[2]};
z-index: 9999;
cursor: pointer;
&:focus-within {
outline: none;
}
}
[data-reach-listbox-option] {
padding: ${props => props.theme.spacing(1)};
color: ${props => props.theme.palette.common.black};
&[data-current-nav] {
background-color: ${props => props.theme.palette.gray[150]};
}
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment