| 1 |
@use '../../sass-utilities' as *; |
| 2 |
|
| 3 |
// stylelint-disable |
| 4 |
@mixin pf-mobile-layout { |
| 5 |
.pf-m-grid.#{$table} { |
| 6 |
@content; |
| 7 |
} |
| 8 |
|
| 9 |
.pf-m-grid-md.#{$table} { |
| 10 |
@container #{$pf-prefix}contain-table (max-width: #{pf-v6-max-width-bp($pf-v6-global--breakpoint--md)}) { |
| 11 |
@content; |
| 12 |
} |
| 13 |
} |
| 14 |
|
| 15 |
.pf-m-grid-lg.#{$table} { |
| 16 |
@container #{$pf-prefix}contain-table (max-width: #{pf-v6-max-width-bp($pf-v6-global--breakpoint--lg)}) { |
| 17 |
@content; |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
.pf-m-grid-xl.#{$table} { |
| 22 |
@container #{$pf-prefix}contain-table (max-width: #{pf-v6-max-width-bp($pf-v6-global--breakpoint--xl)}) { |
| 23 |
@content; |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
.pf-m-grid-2xl.#{$table} { |
| 28 |
@container #{$pf-prefix}contain-table (max-width: #{pf-v6-max-width-bp($pf-v6-global--breakpoint--2xl)}) { |
| 29 |
@content; |
| 30 |
} |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
// - Table grid |
| 35 |
@include pf-root($table, '[class*="pf-m-grid"]') { |
| 36 |
// ============================================================ // |
| 37 |
// Start non-conformant variables |
| 38 |
// |
| 39 |
// these variables do not conform to guidelines as styling targets individual elements |
| 40 |
// this is purposeful and necessary to avoid adding selectors to each td/th |
| 41 |
// ============================================================ // |
| 42 |
|
| 43 |
// * Table responsive |
| 44 |
--#{$table}--responsive--BorderColor: var(--pf-t--global--border--color--default); |
| 45 |
|
| 46 |
// * Table body |
| 47 |
--#{$table}__tbody--responsive--border-width--base: var(--pf-t--global--border--width--divider--default); |
| 48 |
--#{$table}__tbody--after--border-width--base: var(--pf-t--global--border--width--extra-strong); |
| 49 |
--#{$table}__tbody--after--BorderInlineStartWidth: 0; |
| 50 |
--#{$table}__tbody--after--BorderColor: var(--pf-t--global--border--color--clicked); |
| 51 |
|
| 52 |
// * Table body responsive |
| 53 |
--#{$table}__tbody--responsive--m-expandable--BorderBlockEndWidth: var(--pf-t--global--border--width--divider--default); |
| 54 |
|
| 55 |
// * Table tr responsive |
| 56 |
--#{$table}__tr--responsive--border-width--base: var(--pf-t--global--border--width--divider--default); |
| 57 |
--#{$table}__tr--responsive--last-child--BorderBlockEndWidth: var(--#{$table}__tbody--responsive--border-width--base); |
| 58 |
--#{$table}__tr--responsive--GridColumnGap: var(--pf-t--global--spacer--md); |
| 59 |
--#{$table}__tr--responsive--MarginBlockStart: var(--#{$table}__tbody--responsive--border-width--base); |
| 60 |
--#{$table}__tr--responsive--PaddingBlockStart: var(--pf-t--global--spacer--md); |
| 61 |
--#{$table}__tr--responsive--PaddingInlineEnd: var(--pf-t--global--spacer--inset--page-chrome); |
| 62 |
--#{$table}__tr--responsive--PaddingBlockEnd: var(--pf-t--global--spacer--md); |
| 63 |
--#{$table}__tr--responsive--PaddingInlineStart: var(--pf-t--global--spacer--inset--page-chrome); |
| 64 |
|
| 65 |
// * Table tr responsive nested table |
| 66 |
--#{$table}__tr--responsive--nested-table--PaddingBlockStart: var(--pf-t--global--spacer--xl); |
| 67 |
--#{$table}__tr--responsive--nested-table--PaddingInlineEnd: var(--pf-t--global--spacer--lg); |
| 68 |
--#{$table}__tr--responsive--nested-table--PaddingBlockEnd: var(--pf-t--global--spacer--xl); |
| 69 |
--#{$table}__tr--responsive--nested-table--PaddingInlineStart: var(--pf-t--global--spacer--lg); |
| 70 |
|
| 71 |
// * Table tbody |
| 72 |
--#{$table}__tbody--after__tr--BorderInlineStartWidth: 0; |
| 73 |
--#{$table}__tbody--after__tr--BorderInlineStartColor: transparent; |
| 74 |
--#{$table}__tbody--m-expanded--after__tr--BorderInlineStartWidth: var(--#{$table}__expandable-row--after--border-width--base); |
| 75 |
--#{$table}__tbody--m-expanded--after__tr--BorderInlineStartColor: var(--pf-t--global--border--color--clicked); |
| 76 |
|
| 77 |
// * Table tbody selected |
| 78 |
--#{$table}__tbody--m-selected--after__tr--BorderInlineStartWidth: var(--#{$table}__expandable-row--after--border-width--base); |
| 79 |
--#{$table}__tbody--m-selected--after__tr--BorderInlineStartColor: var(--pf-t--global--border--color--clicked); |
| 80 |
|
| 81 |
// * Table grid cell |
| 82 |
--#{$table}--m-grid--cell--hidden-visible--Display: grid; |
| 83 |
|
| 84 |
// * Table grid cell |
| 85 |
--#{$table}--m-grid--cell--PaddingBlockStart: 0; |
| 86 |
--#{$table}--m-grid--cell--PaddingInlineEnd: 0; |
| 87 |
--#{$table}--m-grid--cell--PaddingBlockEnd: 0; |
| 88 |
--#{$table}--m-grid--cell--PaddingInlineStart: 0; |
| 89 |
|
| 90 |
// * Table td responsive |
| 91 |
--#{$table}-td--responsive--GridColumnGap: var(--pf-t--global--spacer--md); |
| 92 |
--#{$table}--cell--responsive--PaddingBlockStart: var(--pf-t--global--spacer--md); |
| 93 |
--#{$table}--cell--responsive--PaddingBlockEnd: var(--pf-t--global--spacer--sm); |
| 94 |
--#{$table}--cell--first-child--responsive--PaddingBlockStart: var(--pf-t--global--spacer--sm); |
| 95 |
--#{$table}--cell--responsive--PaddingInlineEnd: 0; |
| 96 |
--#{$table}--cell--responsive--PaddingInlineStart: 0; |
| 97 |
--#{$table}--cell--responsive--th--FontWeight: var(--pf-t--global--font--weight--body--bold); |
| 98 |
|
| 99 |
// * Table grid compact table |
| 100 |
--#{$table}--m-compact__tr--responsive--PaddingBlockStart: var(--pf-t--global--spacer--sm); |
| 101 |
--#{$table}--m-compact__tr--responsive--PaddingBlockEnd: var(--pf-t--global--spacer--sm); |
| 102 |
--#{$table}--m-compact__tr__td--responsive--PaddingBlockStart: var(--pf-t--global--spacer--xs); |
| 103 |
--#{$table}--m-compact__tr__td--responsive--PaddingBlockEnd: var(--pf-t--global--spacer--xs); |
| 104 |
--#{$table}--m-compact__check--responsive--MarginBlockStart: #{pf-size-prem(7px)}; |
| 105 |
--#{$table}--m-compact__action--responsive--MarginBlockStart: calc(var(--pf-t--global--spacer--xs) * -1); |
| 106 |
--#{$table}--m-compact__action--responsive--MarginBlockEnd: calc(var(--pf-t--global--spacer--xs) * -1); |
| 107 |
--#{$table}--m-compact__toggle--c-button--responsive--MarginBlockEnd: calc(var(--pf-t--global--spacer--xs) * -1); |
| 108 |
|
| 109 |
// * Table grid expandable row content |
| 110 |
--#{$table}__expandable-row-content--responsive--PaddingInlineEnd: var(--pf-t--global--spacer--inset--page-chrome); |
| 111 |
--#{$table}__expandable-row-content--responsive--PaddingInlineStart: var(--pf-t--global--spacer--inset--page-chrome); |
| 112 |
--#{$table}__expandable-row-content--BackgroundColor: var(--pf-t--global--background--color--primary--default); |
| 113 |
|
| 114 |
// * Table check |
| 115 |
--#{$table}__check--responsive--MarginInlineStart: var(--#{$table}__tbody--responsive--border-width--base); |
| 116 |
--#{$table}__check--responsive--MarginBlockStart: #{pf-size-prem(14px)}; |
| 117 |
|
| 118 |
// * Table grid favorite |
| 119 |
--#{$table}--m-grid__favorite--MarginBlockStart: #{pf-size-prem(8px)}; |
| 120 |
--#{$table}--m-grid__check--favorite--MarginInlineStart: var(--pf-t--global--spacer--xl); |
| 121 |
|
| 122 |
// * Table grid action |
| 123 |
--#{$table}__action--responsive--MarginInlineStart: var(--pf-t--global--spacer--xl); |
| 124 |
--#{$table}--m-grid__favorite--action--MarginInlineStart: var(--pf-t--global--spacer--2xl); |
| 125 |
--#{$table}--m-grid__check--favorite--action--MarginInlineStart: calc(var(--#{$table}--m-grid__check--favorite--MarginInlineStart) + var(--#{$table}--m-grid__favorite--action--MarginInlineStart)); |
| 126 |
|
| 127 |
// * Table grid toggle icon |
| 128 |
--#{$table}__toggle__icon--TransitionDuration: var(--pf-t--global--motion--duration--icon--default); |
| 129 |
--#{$table}__toggle__icon--TransitionTimingFunction: var(--pf-t--global--motion--timing-function--default); |
| 130 |
--#{$table}__toggle__icon--Transition: transform var(--#{$table}__toggle__icon--TransitionDuration) var(--#{$table}__toggle__icon--TransitionTimingFunction); // TODO remove in breaking change along with shorthand property |
| 131 |
--#{$table}__toggle--m-expanded__icon--Rotate: 180deg; |
| 132 |
} |
| 133 |
|
| 134 |
// - Table mobile layout |
| 135 |
@include pf-mobile-layout { |
| 136 |
$pf-mobile-parent: &; |
| 137 |
|
| 138 |
--#{$table}--cell--PaddingBlockStart: var(--#{$table}--m-grid--cell--PaddingBlockStart); |
| 139 |
--#{$table}--cell--PaddingInlineEnd: var(--#{$table}--m-grid--cell--PaddingInlineEnd); |
| 140 |
--#{$table}--cell--PaddingBlockEnd: var(--#{$table}--m-grid--cell--PaddingBlockEnd); |
| 141 |
--#{$table}--cell--PaddingInlineStart: var(--#{$table}--m-grid--cell--PaddingInlineStart); |
| 142 |
--#{$table}--cell--first-last-child--PaddingInline: 0; |
| 143 |
|
| 144 |
// - Table favorite |
| 145 |
--#{$table}__favorite--c-button--MarginBlockStart: auto; |
| 146 |
--#{$table}__favorite--c-button--MarginInlineEnd: auto; |
| 147 |
--#{$table}__favorite--c-button--MarginBlockEnd: auto; |
| 148 |
--#{$table}__favorite--c-button--MarginInlineStart: auto; |
| 149 |
|
| 150 |
display: grid; |
| 151 |
border: none; |
| 152 |
|
| 153 |
// reset cell modifications |
| 154 |
tr:where(.#{$table}__tr) > :where(th, td) { |
| 155 |
width: auto; |
| 156 |
min-width: 0; |
| 157 |
max-width: none; |
| 158 |
overflow: visible; |
| 159 |
text-overflow: clip; |
| 160 |
white-space: normal; |
| 161 |
} |
| 162 |
|
| 163 |
// apply modifications to text |
| 164 |
.#{$table}__text { |
| 165 |
position: relative; |
| 166 |
width: auto; |
| 167 |
min-width: 0; |
| 168 |
max-width: none; |
| 169 |
overflow: var(--#{$table}--cell--Overflow); |
| 170 |
text-overflow: var(--#{$table}--cell--TextOverflow); |
| 171 |
white-space: var(--#{$table}--cell--WhiteSpace); |
| 172 |
} |
| 173 |
|
| 174 |
// - Table thead |
| 175 |
thead:where(.#{$table}__thead) { |
| 176 |
display: none; |
| 177 |
} |
| 178 |
|
| 179 |
// - Table tbody |
| 180 |
tbody:where(.#{$table}__tbody) { |
| 181 |
display: block; |
| 182 |
|
| 183 |
&:first-of-type { |
| 184 |
border-block-start: var(--#{$table}__tbody--responsive--border-width--base) solid var(--#{$table}--responsive--BorderColor); |
| 185 |
} |
| 186 |
} |
| 187 |
|
| 188 |
&.pf-m-animate-expand { |
| 189 |
--#{$table}__expandable-row--Display: block; |
| 190 |
|
| 191 |
> .#{$table}__tbody > .#{$table}__expandable-row { |
| 192 |
&:not(.pf-m-expanded) { |
| 193 |
> :is(.#{$table}__td, .#{$table}__th) { |
| 194 |
&[data-label]::before { |
| 195 |
content: none; // hides column header for non-expanded rows |
| 196 |
} |
| 197 |
} |
| 198 |
} |
| 199 |
} |
| 200 |
} |
| 201 |
|
| 202 |
// Remove border on tr inside non-expanded tbody in of expandable tables |
| 203 |
&.pf-m-expandable { |
| 204 |
--#{$table}__tr--BorderBlockEndWidth: 0; // nested table rows have no border |
| 205 |
|
| 206 |
.#{$table}__tbody, |
| 207 |
.#{$table}__tbody.pf-m-expanded { |
| 208 |
border-block-end: var(--#{$table}__tbody--responsive--m-expandable--BorderBlockEndWidth) solid var(--#{$table}--responsive--BorderColor); |
| 209 |
} |
| 210 |
} |
| 211 |
|
| 212 |
// - Table grid tr selected |
| 213 |
tr:where(.#{$table}__tr).pf-m-selected { |
| 214 |
--#{$table}__expandable-row--after--BorderInlineStartWidth: 0; |
| 215 |
--#{$table}__expandable-row--after--BorderColor: transparent; |
| 216 |
} |
| 217 |
|
| 218 |
// Standard table row (non-expandable) |
| 219 |
// exclude expandable rows |
| 220 |
// - Table grid tr not expandable row |
| 221 |
tr:where(.#{$table}__tr):not(.#{$table}__expandable-row) { |
| 222 |
display: grid; |
| 223 |
grid-template-columns: 1fr; |
| 224 |
height: auto; |
| 225 |
|
| 226 |
// set subsequent auto column width to max-content |
| 227 |
grid-auto-columns: max-content; |
| 228 |
grid-column-gap: var(--#{$table}__tr--responsive--GridColumnGap); |
| 229 |
|
| 230 |
// set base variables to reset later |
| 231 |
padding-block-start: var(--#{$table}__tr--responsive--PaddingBlockStart); |
| 232 |
padding-inline-end: var(--#{$table}__tr--responsive--PaddingInlineEnd); |
| 233 |
padding-block-end: var(--#{$table}__tr--responsive--PaddingBlockEnd); |
| 234 |
padding-inline-start: var(--#{$table}__tr--responsive--PaddingInlineStart); |
| 235 |
|
| 236 |
// Reset td padding |
| 237 |
& > :where(th, td) { |
| 238 |
padding-block-start: var(--#{$table}--cell--responsive--PaddingBlockStart); |
| 239 |
padding-inline-end: var(--#{$table}--cell--responsive--PaddingInlineEnd); |
| 240 |
padding-block-end: var(--#{$table}--cell--responsive--PaddingBlockEnd); |
| 241 |
padding-inline-start: var(--#{$table}--cell--responsive--PaddingInlineStart); |
| 242 |
|
| 243 |
// remove padding from first child to align with kebab |
| 244 |
&:first-child { |
| 245 |
--#{$table}--cell--responsive--PaddingBlockStart: var(--#{$table}--cell--first-child--responsive--PaddingBlockStart); |
| 246 |
} |
| 247 |
} |
| 248 |
} |
| 249 |
|
| 250 |
// - Table grid compact |
| 251 |
&.pf-m-compact { |
| 252 |
--#{$table}__tr--responsive--PaddingBlockStart: var(--#{$table}--m-compact__tr--responsive--PaddingBlockStart); |
| 253 |
--#{$table}__tr--responsive--PaddingBlockEnd: var(--#{$table}--m-compact__tr--responsive--PaddingBlockEnd); |
| 254 |
--#{$table}--cell--responsive--PaddingBlockStart: var(--#{$table}--m-compact__tr__td--responsive--PaddingBlockStart); |
| 255 |
--#{$table}--cell--responsive--PaddingBlockEnd: var(--#{$table}--m-compact__tr__td--responsive--PaddingBlockEnd); |
| 256 |
--#{$table}__check--responsive--MarginBlockStart: var(--#{$table}--m-compact__check--responsive--MarginBlockStart); |
| 257 |
--#{$table}__check--input--MarginBlockStart: 0; |
| 258 |
|
| 259 |
.#{$table}__action { |
| 260 |
margin-block-start: var(--#{$table}--m-compact__action--responsive--MarginBlockStart); |
| 261 |
margin-block-end: var(--#{$table}--m-compact__action--responsive--MarginBlockStart); |
| 262 |
} |
| 263 |
|
| 264 |
.#{$table}__toggle .#{$button} { |
| 265 |
margin-block-end: var(--#{$table}--m-compact__toggle--c-button--responsive--MarginBlockEnd); |
| 266 |
} |
| 267 |
} |
| 268 |
|
| 269 |
.#{$table}__icon > * { |
| 270 |
text-align: start; |
| 271 |
} |
| 272 |
|
| 273 |
// - Table grid th td data label |
| 274 |
:where(.#{$table}__th, .#{$table}__td)[data-label] { |
| 275 |
// default pf-v6-hidden-visible() mixin is called in table.scss. redefining variable here |
| 276 |
--#{$table}--cell--hidden-visible--Display: var(--#{$table}--m-grid--cell--hidden-visible--Display); |
| 277 |
|
| 278 |
grid-column: 1; |
| 279 |
grid-column-gap: var(--#{$table}-td--responsive--GridColumnGap); |
| 280 |
|
| 281 |
// use minmax func to contain possible text modifier width |
| 282 |
grid-template-columns: 1fr minmax(0, 1.5fr); |
| 283 |
align-items: start; |
| 284 |
|
| 285 |
&.pf-m-action { |
| 286 |
align-items: center; |
| 287 |
} |
| 288 |
|
| 289 |
// set contents of td to start at column two of td grid |
| 290 |
> * { |
| 291 |
grid-column: 2; |
| 292 |
} |
| 293 |
|
| 294 |
&::before { |
| 295 |
position: revert; |
| 296 |
font-weight: var(--#{$table}--cell--responsive--th--FontWeight); |
| 297 |
text-align: start; |
| 298 |
content: attr(data-label); |
| 299 |
} |
| 300 |
} |
| 301 |
|
| 302 |
tr:where(.#{$table}__tr) > :where(th, td) { |
| 303 |
// Remove first child padding left |
| 304 |
&:first-child { |
| 305 |
--#{$table}--cell--PaddingInlineStart: 0; |
| 306 |
} |
| 307 |
|
| 308 |
// Remove last child padding right |
| 309 |
&:last-child { |
| 310 |
--#{$table}--cell--PaddingInlineEnd: 0; |
| 311 |
} |
| 312 |
} |
| 313 |
|
| 314 |
// - Table grid table |
| 315 |
.#{$table} { |
| 316 |
--#{$table}__tr--responsive--PaddingBlockStart: var(--#{$table}__tr--responsive--nested-table--PaddingBlockStart); |
| 317 |
--#{$table}__tr--responsive--PaddingInlineEnd: var(--#{$table}__tr--responsive--nested-table--PaddingInlineEnd); |
| 318 |
--#{$table}__tr--responsive--PaddingBlockEnd: var(--#{$table}__tr--responsive--nested-table--PaddingBlockEnd); |
| 319 |
--#{$table}__tr--responsive--PaddingInlineStart: var(--#{$table}__tr--responsive--nested-table--PaddingInlineStart); |
| 320 |
|
| 321 |
border: 0; |
| 322 |
} |
| 323 |
|
| 324 |
// - Table grid compound expansion toggle |
| 325 |
.#{$table}__compound-expansion-toggle { |
| 326 |
--#{$table}__compound-expansion-toggle__button--before--BorderInlineEndWidth: 0; |
| 327 |
--#{$table}__compound-expansion-toggle__button--before--BorderInlineStartWidth: 0; |
| 328 |
--#{$table}__compound-expansion-toggle__button--after--InsetBlockStart: 100%; |
| 329 |
} |
| 330 |
|
| 331 |
// Compound expansion responsive |
| 332 |
// - Table grid tbody |
| 333 |
tbody:where(.#{$table}__tbody) { |
| 334 |
position: relative; |
| 335 |
|
| 336 |
&::after { |
| 337 |
position: absolute; |
| 338 |
inset-block-start: 0; |
| 339 |
inset-block-end: 0; |
| 340 |
inset-inline-start: 0; |
| 341 |
content: ""; |
| 342 |
border: 0; |
| 343 |
border-inline-start: var(--#{$table}__tbody--after--BorderInlineStartWidth) solid var(--#{$table}__tbody--after--BorderColor); |
| 344 |
} |
| 345 |
|
| 346 |
&.pf-m-expanded { |
| 347 |
--#{$table}__tbody--after--BorderInlineStartWidth: var(--#{$table}__tbody--after--border-width--base); |
| 348 |
|
| 349 |
& tbody:where(.#{$table}__tbody) { |
| 350 |
--#{$table}__tbody--after--BorderInlineStartWidth: 0; |
| 351 |
} |
| 352 |
} |
| 353 |
|
| 354 |
> tr:where(.#{$table}__tr) > :first-child:not(.#{$table}__check)::after { |
| 355 |
--#{$table}__expandable-row--after--BorderInlineStartWidth: 0; |
| 356 |
|
| 357 |
position: static; |
| 358 |
width: auto; |
| 359 |
background-color: transparent; |
| 360 |
} |
| 361 |
} |
| 362 |
|
| 363 |
// - Table grid expandable row |
| 364 |
.#{$table}__expandable-row { |
| 365 |
--#{$table}--cell--responsive--PaddingBlockStart: 0; |
| 366 |
--#{$table}--cell--responsive--PaddingInlineEnd: 0; |
| 367 |
--#{$table}--cell--responsive--PaddingBlockEnd: 0; |
| 368 |
--#{$table}--cell--responsive--PaddingInlineStart: 0; |
| 369 |
--#{$table}--cell--PaddingInlineEnd: 0; |
| 370 |
--#{$table}--cell--PaddingInlineStart: 0; |
| 371 |
|
| 372 |
display: block; |
| 373 |
max-height: var(--#{$table}__expandable-row--MaxHeight); // Overflow scroll should only happen on responsive |
| 374 |
overflow-y: auto; |
| 375 |
border-block-end: none; |
| 376 |
|
| 377 |
// cells |
| 378 |
> :where(th, td) { |
| 379 |
position: static; |
| 380 |
display: block; |
| 381 |
} |
| 382 |
|
| 383 |
// Modifier - expanded tr |
| 384 |
&.pf-m-expanded { |
| 385 |
border-block-start-color: var(--#{$table}--BorderColor); |
| 386 |
} |
| 387 |
|
| 388 |
> :first-child:not(.#{$table}__check)::after { |
| 389 |
// Border treatment |
| 390 |
content: none; |
| 391 |
} |
| 392 |
|
| 393 |
th:where(.#{$table}__th), |
| 394 |
td:where(.#{$table}__td) { |
| 395 |
&.pf-m-no-padding { |
| 396 |
.#{$table}__expandable-row-content { |
| 397 |
padding: 0; |
| 398 |
} |
| 399 |
} |
| 400 |
} |
| 401 |
|
| 402 |
&:not(.pf-m-expanded) { |
| 403 |
display: none; |
| 404 |
} |
| 405 |
|
| 406 |
.#{$table}__expandable-row-content { |
| 407 |
padding-inline-end: var(--#{$table}__expandable-row-content--responsive--PaddingInlineEnd); |
| 408 |
padding-inline-start: var(--#{$table}__expandable-row-content--responsive--PaddingInlineStart); |
| 409 |
} |
| 410 |
} |
| 411 |
|
| 412 |
// - Table grid tbody hoverable |
| 413 |
tbody:where(.#{$table}__tbody).pf-m-hoverable { |
| 414 |
--#{$table}__tbody--after--BorderInlineStartWidth: 0; |
| 415 |
--#{$table}__tbody--after--BorderInlineStartColor: transparent; |
| 416 |
|
| 417 |
&, |
| 418 |
> tr:where(.#{$table}__tr) { |
| 419 |
position: relative; |
| 420 |
} |
| 421 |
|
| 422 |
> tr:where(.#{$table}__tr)::after { |
| 423 |
content: ''; |
| 424 |
position: absolute; |
| 425 |
inset-block-start: 0; |
| 426 |
inset-block-end: 0; |
| 427 |
inset-inline-start: 0; |
| 428 |
width: var(--#{$table}__tbody--after__tr--BorderInlineStartWidth); |
| 429 |
background-color: var(--#{$table}__tbody--after__tr--BorderInlineStartColor); |
| 430 |
} |
| 431 |
|
| 432 |
&.pf-m-expanded { |
| 433 |
--#{$table}__tbody--after__tr--BorderInlineStartWidth: var(--#{$table}__tbody--m-expanded--after__tr--BorderInlineStartWidth); |
| 434 |
--#{$table}__tbody--after__tr--BorderInlineStartColor: var(--#{$table}__tbody--m-expanded--after__tr--BorderInlineStartColor); |
| 435 |
} |
| 436 |
|
| 437 |
&.pf-m-selected { |
| 438 |
--#{$table}__tbody--after__tr--BorderInlineStartWidth: var(--#{$table}__tbody--m-selected--after__tr--BorderInlineStartWidth); |
| 439 |
--#{$table}__tbody--after__tr--BorderInlineStartColor: var(--#{$table}__tbody--m-selected--after__tr--BorderInlineStartColor); |
| 440 |
} |
| 441 |
} |
| 442 |
|
| 443 |
|
| 444 |
// - Table grid tr selected |
| 445 |
tr:where(.#{$table}__tr).pf-m-selected { |
| 446 |
&::after { |
| 447 |
content: ''; |
| 448 |
position: absolute; |
| 449 |
inset-block-start: 0; |
| 450 |
inset-block-end: 0; |
| 451 |
inset-inline-start: 0; |
| 452 |
width: var(--#{$table}__tr--m-selected--after--BorderInlineStartWidth); |
| 453 |
background-color: var(--#{$table}__tr--m-selected--after--BorderInlineStartColor); |
| 454 |
} |
| 455 |
} |
| 456 |
|
| 457 |
// Set defaults |
| 458 |
tr:where(.#{$table}__tr):not(.#{$table}__expandable-row) { |
| 459 |
.#{$table}__toggle, |
| 460 |
.#{$table}__check, |
| 461 |
.#{$table}__favorite, |
| 462 |
.#{$table}__action { |
| 463 |
width: auto; |
| 464 |
padding: 0; |
| 465 |
} |
| 466 |
} |
| 467 |
|
| 468 |
// - Table grid toggle |
| 469 |
.#{$table}__toggle { |
| 470 |
grid-row-start: 20; |
| 471 |
grid-column: -1; |
| 472 |
justify-self: end; |
| 473 |
padding-inline-end: 0; |
| 474 |
|
| 475 |
&::after { |
| 476 |
content: none; |
| 477 |
} |
| 478 |
} |
| 479 |
|
| 480 |
// - Table grid button |
| 481 |
.#{$table}__button { |
| 482 |
--#{$table}--cell--PaddingBlockStart: var(--#{$table}--m-grid--cell--PaddingBlockStart); |
| 483 |
--#{$table}--cell--PaddingInlineEnd: var(--#{$table}--m-grid--cell--PaddingInlineEnd); |
| 484 |
--#{$table}--cell--PaddingBlockEnd: var(--#{$table}--m-grid--cell--PaddingBlockEnd); |
| 485 |
--#{$table}--cell--PaddingInlineStart: var(--#{$table}--m-grid--cell--PaddingInlineStart); |
| 486 |
} |
| 487 |
|
| 488 |
// - Table grid check - Table grid favorite - Table grid action |
| 489 |
.#{$table}__check, |
| 490 |
.#{$table}__favorite, |
| 491 |
.#{$table}__action { |
| 492 |
grid-row-start: 1; |
| 493 |
grid-column-start: 2; |
| 494 |
} |
| 495 |
|
| 496 |
// - Table grid check |
| 497 |
.#{$table}__check { |
| 498 |
margin-block-start: var(--#{$table}__check--responsive--MarginBlockStart); |
| 499 |
margin-inline-start: var(--#{$table}__check--responsive--MarginInlineStart); |
| 500 |
line-height: 1; |
| 501 |
|
| 502 |
~ .#{$table}__favorite { |
| 503 |
margin-inline-start: var(--#{$table}--m-grid__check--favorite--MarginInlineStart); |
| 504 |
|
| 505 |
~ .#{$table}__action { |
| 506 |
margin-inline-start: var(--#{$table}--m-grid__check--favorite--action--MarginInlineStart); |
| 507 |
} |
| 508 |
} |
| 509 |
|
| 510 |
~ .#{$table}__action { |
| 511 |
margin-inline-start: var(--#{$table}__action--responsive--MarginInlineStart); |
| 512 |
} |
| 513 |
|
| 514 |
label { |
| 515 |
display: inline-block; |
| 516 |
margin: 0; |
| 517 |
} |
| 518 |
} |
| 519 |
|
| 520 |
// - Table grid favorite |
| 521 |
.#{$table}__favorite { |
| 522 |
margin-block-start: var(--#{$table}--m-grid__favorite--MarginBlockStart); |
| 523 |
|
| 524 |
~ .#{$table}__action { |
| 525 |
margin-inline-start: var(--#{$table}--m-grid__favorite--action--MarginInlineStart); |
| 526 |
} |
| 527 |
} |
| 528 |
|
| 529 |
// - Table grid action |
| 530 |
.#{$table}__action { |
| 531 |
text-align: end; |
| 532 |
|
| 533 |
// @smallest breakpoint |
| 534 |
@media screen and (max-width: $pf-v6-global--breakpoint--sm) { |
| 535 |
grid-row-start: 1; |
| 536 |
grid-column-start: 2; |
| 537 |
margin-inline-start: 0; |
| 538 |
} |
| 539 |
} |
| 540 |
|
| 541 |
// - Table grid inline edit action |
| 542 |
.#{$table}__inline-edit-action { |
| 543 |
grid-column: 2; |
| 544 |
grid-row: 2; |
| 545 |
} |
| 546 |
|
| 547 |
// - Table grid toggle icon |
| 548 |
.#{$table}__toggle-icon { |
| 549 |
transition: var(--#{$table}__toggle__icon--Transition); // TODO remove shorthand in breaking change |
| 550 |
|
| 551 |
.#{$button}.pf-m-expanded > & { |
| 552 |
transform: rotate(var(--#{$table}__toggle--m-expanded__icon--Rotate)); |
| 553 |
} |
| 554 |
} |
| 555 |
|
| 556 |
// - Table grid nowrap - Table grid fit content - Table grid truncate - Table grid width |
| 557 |
:where(.#{$table}, .#{$table}__thead, .#{$table}__tbody, .#{$table}__tr, .#{$table}__th, .#{$table}__td, .#{$table}__text) { |
| 558 |
|
| 559 |
// No wrap |
| 560 |
&.pf-m-nowrap { |
| 561 |
--#{$table}--cell--Overflow: auto; |
| 562 |
} |
| 563 |
|
| 564 |
// Fit content |
| 565 |
&.pf-m-fit-content { |
| 566 |
width: auto; |
| 567 |
white-space: normal; |
| 568 |
} |
| 569 |
|
| 570 |
// Truncate |
| 571 |
&.pf-m-truncate { |
| 572 |
--#{$table}--cell--MaxWidth: 100%; |
| 573 |
} |
| 574 |
} |
| 575 |
|
| 576 |
[class*="pf-m-width"] { |
| 577 |
--#{$table}--cell--Width: auto; |
| 578 |
} |
| 579 |
} |
| 580 |
// stylelint-enable |