Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix select colors #514

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/select/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,72 +90,72 @@
}
}

const getOptionColor = (theme, state) => {
if (state.isDisabled) return theme.colors.placeholder
if (state.isSelected) return theme.colors.bright
if (state.isSelected) return theme.colors.selectedStrong

Check warning on line 95 in src/components/select/index.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 95 in src/components/select/index.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

Check warning on line 95 in src/components/select/index.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
return theme.colors.textDescription
}

Check warning on line 97 in src/components/select/index.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement

const makeCustomStyles = (theme, { minWidth, size, ...providedStyles } = {}) => ({
control: (styles, state) => ({
...styles,
borderColor: state.isFocused ? theme.colors.inputBorderFocus : theme.colors.inputBorder,
boxShadow: "none",
minHeight: 18,
minWidth: minWidth || 160,
":hover": {
borderColor: theme.colors.inputBorderHover,
},
}),
input: (styles, state) => ({
...styles,
color: state.isDisabled ? theme.colors.placeholder : theme.colors.grey140,
...(size === "tiny"
? {
lineHeight: "18px",
paddingBottom: 0,
paddingTop: 0,
}
: {}),
}),
menu: styles => ({ ...styles, zIndex: 100 }),
menuPortal: styles => ({ ...styles, zIndex: 9999 }),
multiValue: styles => ({
...styles,
fontSize: size === "tiny" ? "12px" : "14px",
flexDirection: "row-reverse",
...(size === "tiny" ? { minHeight: 18 } : {}),
}),
multiValueLabel: (styles, state) => ({
...styles,
backgroundColor: theme.colors.grey40,
borderRadius: "0 2px 2px 0",
color: state.isDisabled ? theme.colors.placeholder : theme.colors.grey140,
...(size === "tiny" ? { padding: "1px" } : {}),
paddingRight: state.data.isDisabled ? "8px" : "",
}),
multiValueRemove: (styles, state) => ({
color: state.isDisabled ? theme.colors.placeholder : theme.colors.grey140,
...(state.data.isDisabled
? { ...styles, display: "none" }
: {
...styles,
borderRadius: "2px 0 0 2px",
background: theme.colors.grey40,
":hover": {
background: theme.colors.tabsBorder,
},
}),
}),
option: (styles, state) => ({
...styles,
color: getOptionColor(theme, state),
":hover": {
backgroundColor: theme.colors.dropdown,
color: theme.colors.bright,
color: theme.colors.selectedStrong,
},
...(size === "tiny" ? { fontSize: "12px", minHeight: 28, padding: "4px 8px" } : {}),
}),

Check warning on line 158 in src/components/select/index.js

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
placeholder: styles => ({
...styles,
color: theme.colors.placeholder,
Expand Down
1 change: 1 addition & 0 deletions src/theme/dark/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const appColors = {
separator: rawColors.neutral.grey35,
controlFocused: rawColors.neutral.white,
selected: rawColors.neutral.grey55,
selectedStrong: rawColors.neutral.white,
highlight: rawColors.neutral.grey55,
tooltip: rawColors.neutral.outerSpace,
bright: rawColors.neutral.white,
Expand Down
1 change: 1 addition & 0 deletions src/theme/default/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const appColors = {
separator: rawColors.neutral.grey185,
controlFocused: rawColors.neutral.limedSpruce,
selected: rawColors.neutral.grey180,
selectedStrong: rawColors.neutral.grey50,
highlight: rawColors.neutral.grey180,

tooltip: rawColors.neutral.shark,
Expand Down
Loading