| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
// FIXME: Remove this custom implementation once a component exists upstream. |
| 3 |
// PF overrides to fake a multiselect widget (as one does not currently exist in PF4). |
| 4 |
// A menu gives us the interaction we want, but the styling is a bit off. |
| 5 |
// Therefore, we're changing the visuals here locally. |
| 6 |
// PF4 upstream request for multi-select @ https://github.com/patternfly/patternfly/issues/4027 |
| 7 |
.ct-menu-select-widget.pf-v6-c-menu { |
| 8 |
/* PF rounds the element, but it doesn't have a borderr or background; |
| 9 |
we don't want to clip it in children elements */ |
| 10 |
border-radius: var(--pf-t--global--border--radius--0); |
| 11 |
|
| 12 |
// Divider is silly between the widgets in this context |
| 13 |
.pf-v6-c-divider { |
| 14 |
display: none; |
| 15 |
|
| 16 |
+ .pf-v6-c-menu__content { |
| 17 |
// There should be minimal space between the widgets (replacing the divider) |
| 18 |
margin-block-start: var(--pf-t--global--spacer--sm); |
| 19 |
} |
| 20 |
} |
| 21 |
|
| 22 |
.pf-v6-c-menu__content { |
| 23 |
// An overflow multi-select widget needs an outline |
| 24 |
border: var(--pf-t--global--border--width--100) solid var(--pf-t--global--border--color--default); |
| 25 |
border-radius: var(--pf-t--global--border--radius--small); |
| 26 |
} |
| 27 |
|
| 28 |
// Search should not be inset when there's no border containing it |
| 29 |
.pf-v6-c-menu__search { |
| 30 |
padding: 0; |
| 31 |
} |
| 32 |
|
| 33 |
// Keep the background on a selected item even when it doesn't have |
| 34 |
// focus, allowing keyboard control to have the only background color |
| 35 |
// when active but also keep the background color when the list loses |
| 36 |
// focus (such as when the keyboard or mouse navigates outside, |
| 37 |
// including initial rendering of the list. |
| 38 |
.pf-v6-c-menu__list:not(:focus-within) .pf-m-selected { |
| 39 |
background-color: var(--pf-v6-c-menu__list-item--hover--BackgroundColor); |
| 40 |
} |
| 41 |
} |