| 1 | // export const Select = styled.select` |
| 2 | // padding: 8px 12px; |
| 3 | // border-radius: ${defaultBorderRadius}; |
| 4 | // border: 1px solid ${vscInputBorder}; |
| 5 | // background-color: ${vscBackground}; |
| 6 | // color: ${vscForeground}; |
| 7 | |
| 8 | import { vscBackground, vscForeground, vscInputBorder } from ".."; |
| 9 | |
| 10 | // appearance: none; |
| 11 | // -webkit-appearance: none; |
| 12 | // -moz-appearance: none; |
| 13 | // padding-right: 30px; |
| 14 | // background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path fill="currentColor" d="M0 0l5 5 5-5Z"/></svg>') |
| 15 | // no-repeat right 10px center; |
| 16 | // background-size: 10px 10px; |
| 17 | // `; |
| 18 | |
| 19 | // // gui/src/components/gui/Select.tsx |
| 20 | // import React from 'react'; |
| 21 | |
| 22 | export const Select: React.FC<React.SelectHTMLAttributes<HTMLSelectElement>> = ( |
| 23 | props, |
| 24 | ) => ( |
| 25 | <div |
| 26 | style={{ |
| 27 | color: vscForeground, |
| 28 | }} |
| 29 | > |
| 30 | <select |
| 31 | {...props} |
| 32 | className="rounded border px-3 py-2" |
| 33 | style={{ |
| 34 | borderColor: vscInputBorder, |
| 35 | backgroundColor: vscBackground, |
| 36 | color: vscForeground, |
| 37 | appearance: "none", |
| 38 | WebkitAppearance: "none", |
| 39 | MozAppearance: "none", |
| 40 | paddingRight: "30px", |
| 41 | background: `url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path fill="${encodeURIComponent(vscForeground)}" d="M0 0l5 5 5-5Z"/></svg>') no-repeat right 10px center`, |
| 42 | backgroundSize: "10px 10px", |
| 43 | }} |
| 44 | > |
| 45 | {props.children} |
| 46 | </select> |
| 47 | </div> |
| 48 | ); |