Skip to content

Commit

Permalink
adds synth styles to single select
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleshike committed Nov 27, 2023
1 parent 17180f0 commit ffcc4c3
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Select/AsyncCreatableSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const AsyncCreatableSelect = ({
aria-label={ariaLabel}
aria-labelledby={ariaLabelledBy}
className={`${className || ''} AsyncSelect`}
classNamePrefix="Select"
components={components}
defaultOptions={defaultOptions}
defaultValue={defaultValue}
Expand Down
1 change: 1 addition & 0 deletions src/Select/AsyncSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const AsyncSelect = ({
aria-label={ariaLabel}
aria-labelledby={ariaLabelledBy}
className={`${className || ''} AsyncSelect`}
classNamePrefix="Select"
components={components}
defaultOptions={defaultOptions}
defaultValue={defaultValue}
Expand Down
1 change: 1 addition & 0 deletions src/Select/CreatableSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const CreatableSelect = ({
ariaLabel={ariaLabel}
ariaLabelledBy={ariaLabelledBy}
className={`${className || ''} CreatableSelect`}
classNamePrefix="Select"
components={components}
defaultValue={defaultValue}
disabled={disabled}
Expand Down
2 changes: 2 additions & 0 deletions src/Select/SingleSelect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Select from 'react-select';
import propTypes from 'prop-types';

import zStack from 'src/Styles/zStack';
import './select.scss';

import { defaultTheme, defaultStyles, SELECT_SIZES } from './styles';

Expand Down Expand Up @@ -38,6 +39,7 @@ const SingleSelect = ({
aria-label={ariaLabel}
aria-labelledby={ariaLabelledBy}
className={classNames('SingleSelect', className)}
classNamePrefix="Select"
closeMenuOnSelect={closeMenuOnSelect}
components={components}
defaultValue={defaultValue}
Expand Down
32 changes: 32 additions & 0 deletions src/Select/select.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@import '../../scss/theme.scss';
// Note: react-select is largely styled via css-in-js, not SCSS.
// However, we need to only provide the styles below when the "Synthesized"
// class is present on the body in rails server

.Synthesized .Select__menu {
.Select__option:hover,
.Select__option--is-focused {
background-color: $synth-hover-state;
}

.Select__option--is-selected,
.Select__option--is-selected:hover {
background-color: $synth-selected-state-green;
}
}

.Select__control {
.Select__multi-value__label,
.Select__multi-value__remove {
color: $synth-success-green-dark;
}

.Select__multi-value__remove:hover {
background-color: $synth-selected-state-green;
color: $synth-success-green-dark;
}

.Select__multi-value {
background-color: $synth-hover-state;
}
}

0 comments on commit ffcc4c3

Please sign in to comment.