Skip to content

Commit

Permalink
storage: Use a custom property to control indentation in tables
Browse files Browse the repository at this point in the history
So that levels 11 and above have the same indentation as level 10,
instead of having no indentation.
  • Loading branch information
mvollmer committed Mar 8, 2024
1 parent 94540d6 commit 8b28677
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pkg/storaged/pages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ export const PageTable = ({ emptyCaption, aria_label, pages, crossrefs, sorted,
} else {
const cols = [
<Td key="1" onClick={onClick}>
<div className={"content-level-" + level}>
<div className="indent" style={ { "--level": level } }>
<Truncate content={name} />
{info}
</div>
Expand Down
13 changes: 2 additions & 11 deletions pkg/storaged/storage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,11 @@ td.job-action {
}

// FIXME: This is visual only; it needs to be fixed for a11y reasons, likely at the JSX level
div[class*="content-level-"] {
--multiplier: 0;
--offset: calc(var(--pf-v5-global--spacer--md) * var(--multiplier));

padding-inline-start: var(--offset);
.indent {
padding-inline-start: calc(var(--pf-v5-global--spacer--md) * min(var(--level, 0), 10));
white-space: nowrap;
}

@for $i from 1 through 10 {
div.content-level-#{$i} {
--multiplier: #{$i};
}
}

// FIXME: Is this used?
a.disabled {
color: var(--pf-v5-global--palette--light-blue-200);
Expand Down

0 comments on commit 8b28677

Please sign in to comment.