| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
@use "global-variables" as *; |
| 3 |
|
| 4 |
.ct-table { |
| 5 |
&-header { |
| 6 |
display: flex; |
| 7 |
align-items: center; |
| 8 |
flex-wrap: wrap; |
| 9 |
|
| 10 |
> :only-child { |
| 11 |
flex: auto; |
| 12 |
} |
| 13 |
} |
| 14 |
|
| 15 |
&-heading { |
| 16 |
// Push buttons to the right by stretching the heading |
| 17 |
flex: auto; |
| 18 |
// Add a bit of minimum margin to the right of the heading |
| 19 |
margin-inline-end: var(--pf-t--global--spacer--md); |
| 20 |
// Set a minimum height of 3rem, so when buttons wrap, there's spacing |
| 21 |
min-block-size: var(--pf-t--global--spacer--2xl); |
| 22 |
// Make sure textual content is aligned to the center |
| 23 |
display: flex; |
| 24 |
align-items: center; |
| 25 |
} |
| 26 |
|
| 27 |
&-actions { |
| 28 |
> * { |
| 29 |
margin-block: var(--pf-t--global--spacer--xs); |
| 30 |
margin-inline: var(--pf-t--global--spacer--sm) 0; |
| 31 |
} |
| 32 |
|
| 33 |
> :first-child { |
| 34 |
margin-inline-start: 0; |
| 35 |
} |
| 36 |
} |
| 37 |
|
| 38 |
// https://github.com/patternfly/patternfly-react/issues/5379 |
| 39 |
&-empty { |
| 40 |
[data-label] { |
| 41 |
display: revert; |
| 42 |
} |
| 43 |
|
| 44 |
[data-label]::before { |
| 45 |
display: none; |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
// Don't wrap labels |
| 50 |
[data-label]::before { |
| 51 |
white-space: nowrap; |
| 52 |
} |
| 53 |
|
| 54 |
// Fix toggle button alignment |
| 55 |
.pf-v6-c-table__toggle { |
| 56 |
// Workaround: Chrome sometimes oddly expands the table, |
| 57 |
// unless a width is set. (This affects panels the most, but not only.) |
| 58 |
// As the width is smaller than the contents, and this is a table, |
| 59 |
// the cell will stay at the correct width. |
| 60 |
inline-size: 1px; |
| 61 |
} |
| 62 |
|
| 63 |
// Properly align actions on the end |
| 64 |
> tbody > tr > td:last-child > .btn-group { |
| 65 |
display: flex; |
| 66 |
justify-content: flex-end; |
| 67 |
align-items: center; |
| 68 |
} |
| 69 |
|
| 70 |
// Use PF4 style headings |
| 71 |
> thead th { |
| 72 |
font-size: var(--pf-t--global--font--size--sm); |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
// Special handling for rows with errors |
| 77 |
.pf-v6-c-table tbody tr:first-child.error { |
| 78 |
&, tbody.pf-m-expanded > & { |
| 79 |
background-color: var(--ct-color-list-critical-bg) !important; /* keep red background when expanded */ |
| 80 |
border-block-start: 1px solid var(--ct-color-list-critical-border); |
| 81 |
border-block-end: 1px solid var(--ct-color-list-critical-border); |
| 82 |
} |
| 83 |
} |