Skip to content

Commit

Permalink
mod: use link color as searchable-dropdown's selected color
Browse files Browse the repository at this point in the history
  • Loading branch information
Odaimoko committed Jul 12, 2024
1 parent a1666da commit ade929c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ui/pure-react/style-def.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const getStickyHeaderStyle = (zIndex = 1) => {
background: varBackgroundSecondary,
} as React.CSSProperties;
}
export const dropdownSelectedColor = "rgba(255,99,179,0.74)";
export const dropdownSelectedColor = "var(--dropdown-selected)";
export const varDropdownNonSelected = "var(--dropdown-non-selected)"
export const centerChildren = {display: "flex", alignItems: "center"}
export const centerChildrenVertStyle = {display: "flex", justifyContent: "center"}
Expand Down
5 changes: 3 additions & 2 deletions src/ui/pure-react/view-template/searchable-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ export const SearchableDropdown = (props: {
{filtered.map((option: OptionValueType) => {
const childId = `${dropdownId}_${option.name}`;
// @ts-ignore
const has = !singleSelect ? props.currentOptionValues.includes(option) : false;
const isSelected = !singleSelect ? props.currentOptionValues.includes(option) : false;
return (
<button className="dropdown-button"
style={{background: has ? dropdownSelectedColor : varDropdownNonSelected}} id={childId}
style={{background: isSelected ? dropdownSelectedColor : varDropdownNonSelected}}
id={childId}
onClick={(event) => {
// console.log(event.target) // html element
if (singleSelect) {
Expand Down
1 change: 1 addition & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ If your plugin does not need CSS, delete this file.

.dropdown-button {
--dropdown-non-selected: none;
--dropdown-selected: var(--link-color);
width: 100%;
}

0 comments on commit ade929c

Please sign in to comment.