Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/resources/scripts/components/elements/Select.tsx
7461 views
1
import styled, { css } from 'styled-components/macro';
2
import tw from 'twin.macro';
3
4
interface Props {
5
hideDropdownArrow?: boolean;
6
}
7
8
const Select = styled.select<Props>`
9
${tw`shadow-none block p-3 pr-8 rounded border w-full text-sm transition-colors duration-150 ease-linear`};
10
11
&,
12
&:hover:not(:disabled),
13
&:focus {
14
${tw`outline-none`};
15
}
16
17
-webkit-appearance: none;
18
-moz-appearance: none;
19
background-size: 1rem;
20
background-repeat: no-repeat;
21
background-position-x: calc(100% - 0.75rem);
22
background-position-y: center;
23
24
&::-ms-expand {
25
display: none;
26
}
27
28
${(props) =>
29
!props.hideDropdownArrow &&
30
css`
31
${tw`bg-neutral-600 border-neutral-500 text-neutral-200`};
32
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='%23C3D1DF' d='M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z'/%3e%3c/svg%3e ");
33
34
&:hover:not(:disabled),
35
&:focus {
36
${tw`border-neutral-400`};
37
}
38
`};
39
`;
40
41
export default Select;
42
43