@patternfly/patternfly 4.197.0 → 4.198.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -84,6 +84,8 @@
84
84
  --pf-c-card__header--m-toggle-right--toggle--MarginRight: calc(var(--pf-global--spacer--form-element) * -1);
85
85
  --pf-c-card__header--m-toggle-right--toggle--MarginLeft: var(--pf-global--spacer--xs);
86
86
  --pf-c-card__header--m-toggle-right--actions--MarginRight: 0;
87
+ --pf-c-card__input--focus--BorderWidth: var(--pf-global--BorderWidth--md);
88
+ --pf-c-card__input--focus--BorderColor: var(--pf-global--primary-color--100);
87
89
  display: flex;
88
90
  flex-direction: column;
89
91
  background-color: var(--pf-c-card--BackgroundColor);
@@ -310,6 +312,24 @@
310
312
  font-size: var(--pf-c-card__footer--FontSize);
311
313
  }
312
314
 
315
+ .pf-c-card__sr-input:focus + .pf-c-card::after {
316
+ position: absolute;
317
+ top: 0;
318
+ right: 0;
319
+ bottom: 0;
320
+ left: 0;
321
+ content: "";
322
+ border: var(--pf-c-card__input--focus--BorderWidth) solid var(--pf-c-card__input--focus--BorderColor);
323
+ }
324
+
313
325
  .pf-m-overpass-font .pf-c-card .pf-c-card__title {
314
326
  font-weight: var(--pf-global--FontWeight--normal);
327
+ }
328
+
329
+ :where(.pf-theme-dark) .pf-c-card {
330
+ --pf-c-card--BoxShadow: var(--pf-global--BoxShadow--md);
331
+ --pf-c-card--m-hoverable-raised--hover--BoxShadow: var(--pf-global--BoxShadow--lg);
332
+ --pf-c-card--m-selectable-raised--hover--BoxShadow: var(--pf-global--BoxShadow--lg);
333
+ --pf-c-card--m-selectable-raised--focus--BoxShadow: var(--pf-global--BoxShadow--lg);
334
+ --pf-c-card--m-selectable-raised--active--BoxShadow: var(--pf-global--BoxShadow--lg);
315
335
  }
@@ -105,6 +105,10 @@
105
105
  --pf-c-card__header--m-toggle-right--toggle--MarginLeft: var(--pf-global--spacer--xs);
106
106
  --pf-c-card__header--m-toggle-right--actions--MarginRight: 0;
107
107
 
108
+ // Card input
109
+ --pf-c-card__input--focus--BorderWidth: var(--pf-global--BorderWidth--md);
110
+ --pf-c-card__input--focus--BorderColor: var(--pf-global--primary-color--100);
111
+
108
112
  display: flex;
109
113
  flex-direction: column;
110
114
  background-color: var(--pf-c-card--BackgroundColor);
@@ -380,9 +384,26 @@
380
384
  font-size: var(--pf-c-card__footer--FontSize);
381
385
  }
382
386
 
387
+ .pf-c-card__sr-input:focus + .pf-c-card::after {
388
+ position: absolute;
389
+ top: 0;
390
+ right: 0;
391
+ bottom: 0;
392
+ left: 0;
393
+ content: "";
394
+ border: var(--pf-c-card__input--focus--BorderWidth) solid var(--pf-c-card__input--focus--BorderColor);
395
+ }
396
+
383
397
  // RedHat Font overrides
384
398
  @include pf-m-overpass-font {
385
399
  .pf-c-card .pf-c-card__title {
386
400
  font-weight: var(--pf-global--FontWeight--normal);
387
401
  }
388
402
  }
403
+
404
+ // stylelint-disable no-invalid-position-at-import-rule
405
+ @import "themes/dark/card";
406
+
407
+ @include pf-theme-dark {
408
+ @include pf-theme-dark-card;
409
+ }
@@ -0,0 +1,13 @@
1
+ @import "../../../../sass-utilities/themes/dark/all";
2
+
3
+ @mixin pf-theme-dark-card() {
4
+ .pf-c-card {
5
+ --pf-c-card--BoxShadow: var(--pf-global--BoxShadow--md);
6
+
7
+ // Hoverable/selectable raised
8
+ --pf-c-card--m-hoverable-raised--hover--BoxShadow: var(--pf-global--BoxShadow--lg);
9
+ --pf-c-card--m-selectable-raised--hover--BoxShadow: var(--pf-global--BoxShadow--lg);
10
+ --pf-c-card--m-selectable-raised--focus--BoxShadow: var(--pf-global--BoxShadow--lg);
11
+ --pf-c-card--m-selectable-raised--active--BoxShadow: var(--pf-global--BoxShadow--lg);
12
+ }
13
+ }
@@ -304,12 +304,14 @@
304
304
  border-bottom: 0;
305
305
  }
306
306
  .pf-c-table.pf-m-sticky-header > thead > tr > * {
307
+ z-index: var(--pf-global--ZIndex--xs);
308
+ }
309
+ .pf-c-table.pf-m-sticky-header > thead:not(.pf-m-nested-column-header) > tr > * {
307
310
  position: sticky;
308
311
  top: 0;
309
- z-index: var(--pf-global--ZIndex--xs);
310
312
  background: var(--pf-c-table--BackgroundColor);
311
313
  }
312
- .pf-c-table.pf-m-sticky-header > thead > tr > *::after {
314
+ .pf-c-table.pf-m-sticky-header > thead:not(.pf-m-nested-column-header) > tr > *::after {
313
315
  position: absolute;
314
316
  right: 0;
315
317
  bottom: 0;
@@ -317,6 +319,27 @@
317
319
  content: "";
318
320
  border-bottom: var(--pf-c-table--border-width--base) solid var(--pf-c-table--BorderColor);
319
321
  }
322
+ .pf-c-table.pf-m-sticky-header > .pf-m-nested-column-header {
323
+ position: sticky;
324
+ top: 0;
325
+ z-index: var(--pf-global--ZIndex--xs);
326
+ background: var(--pf-c-table--BackgroundColor);
327
+ }
328
+ .pf-c-table.pf-m-sticky-header > .pf-m-nested-column-header > .pf-m-border-row {
329
+ height: var(--pf-c-table--border-width--base);
330
+ background-color: var(--pf-c-table--BorderColor);
331
+ }
332
+ .pf-c-table.pf-m-sticky-header > .pf-m-nested-column-header tr:not(:nth-last-child(2)) th:not([rowspan]),
333
+ .pf-c-table.pf-m-sticky-header > .pf-m-nested-column-header tr:not(:nth-last-child(2)) td:not([rowspan]) {
334
+ --pf-c-table--cell--PaddingBottom: var(--pf-c-table--thead--m-nested-column-header--tr--PaddingBottom);
335
+ }
336
+ .pf-c-table:not(.pf-m-sticky-header) > .pf-m-nested-column-header tr:not(:last-child) {
337
+ border-bottom: 0;
338
+ }
339
+ .pf-c-table:not(.pf-m-sticky-header) > .pf-m-nested-column-header tr:not(:last-child) th:not([rowspan]),
340
+ .pf-c-table:not(.pf-m-sticky-header) > .pf-m-nested-column-header tr:not(:last-child) td:not([rowspan]) {
341
+ --pf-c-table--cell--PaddingBottom: var(--pf-c-table--thead--m-nested-column-header--tr--PaddingBottom);
342
+ }
320
343
  .pf-c-table.pf-m-striped:not(.pf-m-expandable) > tbody > tr:nth-child(odd), .pf-c-table.pf-m-striped.pf-m-expandable > tbody:nth-of-type(odd) > tr:not(.pf-c-table__expandable-row),
321
344
  .pf-c-table > .pf-m-striped > tr:nth-child(odd),
322
345
  .pf-c-table > .pf-m-striped-even > tr:nth-child(even),
@@ -414,13 +437,6 @@
414
437
  .pf-c-table thead.pf-m-nested-column-header tr:not(:first-child) td:not([rowspan]) {
415
438
  --pf-c-table--cell--PaddingTop: var(--pf-c-table--thead--m-nested-column-header--tr--PaddingTop);
416
439
  }
417
- .pf-c-table thead.pf-m-nested-column-header tr:not(:last-child) {
418
- --pf-c-table--border-width--base: 0;
419
- }
420
- .pf-c-table thead.pf-m-nested-column-header tr:not(:last-child) th:not([rowspan]),
421
- .pf-c-table thead.pf-m-nested-column-header tr:not(:last-child) td:not([rowspan]) {
422
- --pf-c-table--cell--PaddingBottom: var(--pf-c-table--thead--m-nested-column-header--tr--PaddingBottom);
423
- }
424
440
  .pf-c-table thead .pf-c-table__subhead {
425
441
  --pf-c-table__sort__button__text--Color: var(--pf-c-table__subhead--Color);
426
442
  color: var(--pf-c-table__subhead--Color);
@@ -330,9 +330,15 @@
330
330
  border-bottom: 0;
331
331
 
332
332
  > * {
333
+ z-index: var(--pf-global--ZIndex--xs); // set z-index here to allow sticky column to override
334
+ }
335
+ }
336
+
337
+ // standard sticky headers
338
+ > thead:not(.pf-m-nested-column-header) {
339
+ > tr > * {
333
340
  position: sticky;
334
341
  top: 0;
335
- z-index: var(--pf-global--ZIndex--xs);
336
342
  background: var(--pf-c-table--BackgroundColor);
337
343
 
338
344
  // stylelint-disable-next-line
@@ -346,6 +352,45 @@
346
352
  }
347
353
  }
348
354
  }
355
+
356
+ // nested column header
357
+ > .pf-m-nested-column-header {
358
+ position: sticky;
359
+ top: 0;
360
+ z-index: var(--pf-global--ZIndex--xs);
361
+ background: var(--pf-c-table--BackgroundColor);
362
+
363
+ > .pf-m-border-row {
364
+ height: var(--pf-c-table--border-width--base);
365
+ background-color: var(--pf-c-table--BorderColor);
366
+ }
367
+
368
+ tr:not(:nth-last-child(2)) {
369
+ // stylelint-disable max-nesting-depth
370
+ th,
371
+ td {
372
+ &:not([rowspan]) {
373
+ --pf-c-table--cell--PaddingBottom: var(--pf-c-table--thead--m-nested-column-header--tr--PaddingBottom);
374
+ }
375
+ }
376
+ // stylelint-enable
377
+ }
378
+ }
379
+ }
380
+
381
+ &:not(.pf-m-sticky-header) > .pf-m-nested-column-header {
382
+ tr:not(:last-child) {
383
+ border-bottom: 0; // hard reset tr borders in nested headers
384
+
385
+ // stylelint-disable max-nesting-depth
386
+ th,
387
+ td {
388
+ &:not([rowspan]) {
389
+ --pf-c-table--cell--PaddingBottom: var(--pf-c-table--thead--m-nested-column-header--tr--PaddingBottom);
390
+ }
391
+ }
392
+ // stylelint-enable
393
+ }
349
394
  }
350
395
 
351
396
  // For regular and expandable tables
@@ -488,16 +533,6 @@
488
533
  }
489
534
  }
490
535
 
491
- tr:not(:last-child) {
492
- --pf-c-table--border-width--base: 0; // hard reset tr borders in nested headers
493
-
494
- th,
495
- td {
496
- &:not([rowspan]) {
497
- --pf-c-table--cell--PaddingBottom: var(--pf-c-table--thead--m-nested-column-header--tr--PaddingBottom);
498
- }
499
- }
500
- }
501
536
  }
502
537
  // stylelint-enable
503
538
 
@@ -375,6 +375,27 @@ cssPrefix: pf-c-card
375
375
 
376
376
  ```
377
377
 
378
+ ### Selectable with a hidden input for improved screen reader accessibility
379
+
380
+ ```html
381
+ <input
382
+ class="pf-c-card__sr-input pf-screen-reader"
383
+ type="checkbox"
384
+ tabindex="-1"
385
+ aria-label="Checkbox to improve screen reader accessibility of a selectable card"
386
+ />
387
+ <div
388
+ class="pf-c-card pf-m-selectable-raised"
389
+ tabindex="0"
390
+ id="card-selectable-with-input-example"
391
+ >
392
+ <div class="pf-c-card__title">Title</div>
393
+ <div class="pf-c-card__body">Body</div>
394
+ <div class="pf-c-card__footer">Footer</div>
395
+ </div>
396
+
397
+ ```
398
+
378
399
  ### Non selectable
379
400
 
380
401
  ```html
@@ -886,6 +907,7 @@ A card is a generic rectangular container that can be used to build other compon
886
907
  | `.pf-c-card__actions` | `<div>` | Creates an actions element to be used in the card header. |
887
908
  | `.pf-c-card__header-main` | `<div>` | Creates a wrapper element to be used in the card header when using an image, logo, or text. |
888
909
  | `.pf-c-card__expandable-content` | `<div>` | Creates the expandable card's expandable content. |
910
+ | `.pf-c-card__sr-input` | `<input>` | Creates an input which, when focused, makes a following `.pf-c-card` appear focused. |
889
911
  | `.pf-m-compact` | `.pf-c-card` | Creates a compact variation of the card component that involves smaller font sizes and spacing. This variation is for use on dashboards and where a smaller card is preferred. |
890
912
  | `.pf-m-display-lg` | `.pf-c-card` | Creates a large variation of the card component that involves larger font sizes and spacing. This variation is for marketing use cases. |
891
913
  | `.pf-m-no-fill` | `.pf-c-card__body` | Sets a `.pf-c-card__body` to not fill the available space in `.pf-c-card`. `.pf-m-no-fill` can be added to multiple card bodies. |