Skip to content

Commit

Permalink
web: Overrides few rules for PF/Table headers (#1153)
Browse files Browse the repository at this point in the history
## Problem

Sometimes table headers with an space in their content are cut and uses
the `text-overflow` value of CSS property, even when looking at it
_seems_ that there is enough space. Actually, there isn't because of
`margin`s `padding`s and so.

## Solution

To overrides the PF/Table styles for setting the `white-space` CSS
property from `nowrap` to `normal`.

Forcing a size per column it's not a solution because 

* it does not warrant that it's the right size for the same content in
different languages, and
* it is preferred to let the browser laying out the table according to
the available space (among others)
  • Loading branch information
dgdavid authored Apr 26, 2024
2 parents bd3018b + a061d45 commit 493706b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 0 additions & 7 deletions web/src/assets/styles/blocks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -449,16 +449,9 @@ ul[data-type="agama/list"][role="grid"] {

table[data-type="agama/tree-table"] {
th:first-child {
block-size: fit-content;
padding-inline-end: var(--spacer-normal);
}

th.fit-content {
block-size: fit-content;
overflow: visible;
text-overflow: unset;
}

/**
* Temporary PF/Table overrides for small devices
**/
Expand Down
5 changes: 5 additions & 0 deletions web/src/assets/styles/patternfly-overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ ul {
border-block-end: 0;
}

.pf-v5-c-table tr:where(.pf-v5-c-table__tr) > th {
white-space: normal;
vertical-align: middle;
}

@media screen and (width <= 768px) {
.pf-m-grid-md.pf-v5-c-table tr:where(.pf-v5-c-table__tr):not(.pf-v5-c-table__expandable-row) {
padding-inline: 0;
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/storage/ProposalResultSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const DevicesTreeTable = ({ devicesManager }) => {
<TreeTable
columns={[
{ title: _("Device"), content: renderDeviceName },
{ title: _("Mount Point"), content: renderMountPoint, classNames: "fit-content" },
{ title: _("Mount Point"), content: renderMountPoint },
{ title: _("Details"), content: renderDetails, classNames: "details-column" },
{ title: _("Size"), content: renderSize, classNames: "sizes-column" }
]}
Expand Down

0 comments on commit 493706b

Please sign in to comment.