Last active
November 18, 2019 15:22
-
-
Save trplfr/7bc5d48a5e4e664c500408c6ed4d871b to your computer and use it in GitHub Desktop.
styled-components snippet for react-select
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // styled: | |
| import Select from 'react-select' | |
| export const Select = css` | |
| & .gideon__control { | |
| background-color: #FFF; | |
| border-color: #E7E7E7; | |
| } | |
| & .gideon__value-container { | |
| padding: 2px 12px; | |
| } | |
| & .gideon__placeholder { | |
| font-size: 14px; | |
| line-height: 17px; | |
| color: #969696; | |
| } | |
| & .gideon__indicator-separator { | |
| display: none; | |
| } | |
| & .gideon__dropdown-indicator { | |
| svg { | |
| path { | |
| fill: #2310FA; | |
| } | |
| } | |
| } | |
| & .gideon__single-value { | |
| font-size: 14px; | |
| line-height: 17px; | |
| } | |
| // etc from api doc | |
| /* <div class="react-select-container"> | |
| <div class="react-select__control"> | |
| <div class="react-select__value-container">...</div> | |
| <div class="react-select__indicators">...</div> | |
| </div> | |
| <div class="react-select__menu"> | |
| <div class="react-select__menu-list"> | |
| <div class="react-select__option">...</div> | |
| </div> | |
| </div> | |
| </div> */ | |
| ` | |
| export const Boots = styled(Select)` | |
| width: 100%; | |
| margin: 0 0 10px; | |
| ${Select}; | |
| ` | |
| // JSX: | |
| <Boots | |
| classNamePrefix='gideon' | |
| noOptionsMessage={() => 'Не найдено!'} | |
| /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment