|
2 | 2 | // PatternFly List |
3 | 3 | // -------------------------------------------------- |
4 | 4 |
|
| 5 | +$list-pf-main-content-width: 70%; // sets the proportional width of the main content vs the additional content |
| 6 | + |
5 | 7 | .list-pf { |
6 | 8 | border-bottom: 1px solid $list-pf-border-color; |
7 | 9 | } |
8 | 10 |
|
9 | 11 | .list-pf-item { |
10 | 12 | border-color: $list-pf-border-color; |
11 | | - border-left-color: #fff; |
12 | | - border-right-color: #fff; |
| 13 | + border-left-color: $color-pf-white; |
| 14 | + border-right-color: $color-pf-white; |
13 | 15 | border-style: solid; |
14 | 16 | border-width: 1px; |
15 | 17 | border-bottom: none; |
|
25 | 27 | } |
26 | 28 |
|
27 | 29 | .list-pf-expansion { |
28 | | - background-color: #fff; |
| 30 | + background-color: $color-pf-white; |
29 | 31 | } |
30 | 32 |
|
31 | 33 | .list-pf-container { |
32 | | - align-items: center; |
| 34 | + align-items: flex-start; |
33 | 35 | display: flex; |
34 | 36 | padding: $list-pf-padding; |
35 | 37 | .list-pf-expansion & { |
36 | 38 | border-top: 1px solid $list-pf-active-border-color; |
37 | 39 | } |
| 40 | + // when wide enough, if the list is not stacked, then center items vertically |
| 41 | + @media (min-width: $screen-md-min) { |
| 42 | + .list-pf:not(.list-pf-stacked) & { |
| 43 | + align-items: center; |
| 44 | + } |
| 45 | + } |
38 | 46 | } |
39 | 47 |
|
40 | | -.list-pf-chevron { |
41 | | - margin-right: 5px; |
| 48 | +.list-pf-chevron, |
| 49 | +.list-pf-select { |
| 50 | + margin-right: 10px; |
| 51 | + //add the divider line if there is a chevron or a select |
42 | 52 | + .list-pf-content { |
43 | | - border-left: 1px solid $list-pf-active-border-color; |
44 | | - padding-left: 15px; |
| 53 | + border-left: 1px solid $color-pf-black-300; |
| 54 | + padding-left: ($grid-gutter-width/2); |
45 | 55 | } |
46 | 56 | .fa { |
47 | 57 | font-size: 22px; |
48 | | - width: 20px; |
49 | 58 | } |
50 | 59 | } |
| 60 | + |
| 61 | +.list-pf-content { |
| 62 | + align-items: flex-start; |
| 63 | + display:flex; |
| 64 | + flex-grow: 1; |
| 65 | + flex-wrap: nowrap; |
| 66 | + justify-content: flex-start; |
| 67 | + min-width: 0; |
| 68 | + // when wide enough, if the list is not stacked, then center items vertically |
| 69 | + @media (min-width: $screen-md-min) { |
| 70 | + .list-pf:not(.list-pf-stacked) & { |
| 71 | + align-items: center; |
| 72 | + } |
| 73 | + } |
| 74 | +} |
| 75 | + |
| 76 | +.list-pf-left { |
| 77 | + flex-grow: 0; |
| 78 | + margin-left: 0; |
| 79 | + margin-right: ($grid-gutter-width/2); |
| 80 | +} |
| 81 | +.list-pf-icon { |
| 82 | + align-items: center; |
| 83 | + display:flex; |
| 84 | + justify-content: center; |
| 85 | +} |
| 86 | +.list-pf-icon-bordered { |
| 87 | + border-radius: 50%; |
| 88 | + border: 2px solid $list-view-accented-border; |
| 89 | +} |
| 90 | +.list-pf-icon-small { |
| 91 | + font-size: 1.4em; |
| 92 | + height: 30px; |
| 93 | + line-height: 30px; |
| 94 | + width: 30px; |
| 95 | +} |
| 96 | + |
| 97 | + |
| 98 | +.list-pf-content-wrapper { |
| 99 | + align-items: center; |
| 100 | + display:flex; |
| 101 | + flex-grow: 1; |
| 102 | + flex-wrap: wrap; |
| 103 | + min-width: 0; |
| 104 | + // when at larger breakpoints, don't stack the contents and add some space between the children |
| 105 | + @media (min-width: $screen-md-min) { |
| 106 | + flex-wrap: nowrap; |
| 107 | + & > * + * { |
| 108 | + margin-left: $grid-gutter-width; |
| 109 | + } |
| 110 | + } |
| 111 | + // if the list is stacked, then align the contents to the top |
| 112 | + .list-pf-stacked & { |
| 113 | + align-items: flex-start; |
| 114 | + } |
| 115 | + |
| 116 | +} |
| 117 | + |
| 118 | +.list-pf-main-content { |
| 119 | + align-items: center; |
| 120 | + display: flex; |
| 121 | + flex-basis: $list-pf-main-content-width; |
| 122 | + flex-grow: 1; |
| 123 | + flex-shrink: 1; |
| 124 | + flex-wrap: wrap; |
| 125 | + min-width: 0; |
| 126 | +} |
| 127 | + |
| 128 | +// at larger breakpoints, if the list is not stacked, then don't wrap the main contents and add some space between them |
| 129 | +.list-pf:not(.list-pf-stacked) .list-pf-main-content { |
| 130 | + @media (min-width: $screen-md-min) { |
| 131 | + flex-wrap: nowrap; |
| 132 | + width: auto; |
| 133 | + & > * + * { |
| 134 | + margin-left: $grid-gutter-width; |
| 135 | + } |
| 136 | + } |
| 137 | +} |
| 138 | + |
| 139 | +// Title and description are break-word wrapped; add .text-overflow-pf to truncate and ellipse instead |
| 140 | +.list-pf-title { |
| 141 | + flex-grow: 1; |
| 142 | + flex-shrink: 1; |
| 143 | + flex-basis: 100%; |
| 144 | + font-weight: bold; |
| 145 | + min-width: 0; |
| 146 | + word-wrap: break-word; |
| 147 | +} |
| 148 | +.list-pf-description { |
| 149 | + flex-grow: 1; |
| 150 | + flex-shrink: 1; |
| 151 | + flex-basis: 100%; |
| 152 | + min-width: 0; |
| 153 | + word-wrap: break-word; |
| 154 | +} |
| 155 | + |
| 156 | +.list-pf-additional-content { |
| 157 | + display: flex; |
| 158 | + flex-basis: ((100% - $list-pf-main-content-width) + 1%); // this adjusts the proportions but adding up to > 100% allows for proper wrapping |
| 159 | + flex-grow: 1; |
| 160 | + flex-shrink: 1; |
| 161 | + flex-wrap: wrap; |
| 162 | + justify-content: space-between; |
| 163 | +} |
| 164 | +.list-pf-actions { |
| 165 | + display: flex; |
| 166 | + align-items: flex-start; |
| 167 | + flex-grow: 0; |
| 168 | + margin-left: $grid-gutter-width; |
| 169 | + //by default, space contents apart |
| 170 | + & > * + * { |
| 171 | + margin-left: ($grid-gutter-width / 4); |
| 172 | + } |
| 173 | + |
| 174 | +} |
0 commit comments