|
1 | 1 | @import '../../styles/common'; |
2 | 2 |
|
3 | 3 | @mixin action-hide { |
4 | | - clip: rect(1px, 1px, 1px, 1px); |
| 4 | + clip: rect(0, 0, 0, 0); |
5 | 5 | overflow: hidden; |
6 | | - height: 1px; |
7 | 6 | } |
8 | 7 |
|
9 | 8 | @mixin action-unhide { |
10 | 9 | clip: auto; |
11 | 10 | overflow: visible; |
12 | | - height: 100%; |
13 | | -} |
14 | | - |
15 | | -.CheckboxWrapper { |
16 | | - display: flex; |
17 | 11 | } |
18 | 12 |
|
19 | 13 | .ResourceItem { |
20 | 14 | --pc-resource-item-min-height: 44px; |
21 | 15 | --pc-resource-item-disclosure-width: 48px; |
22 | | - // Offset equals handle width + handle margin-left + handle margin-right |
23 | | - --pc-resource-item-offset: 40px; |
| 16 | + --pc-resource-item-offset: 38px; |
24 | 17 | --pc-resource-item-clickable-stacking-order: 1; |
25 | 18 | --pc-resource-item-content-stacking-order: 2; |
26 | | - position: relative; |
27 | 19 | outline: none; |
28 | 20 | cursor: pointer; |
29 | 21 |
|
30 | | - &:not(.persistActions) { |
31 | | - .Actions { |
32 | | - right: var(--p-space-4); |
33 | | - } |
34 | | - } |
35 | | - |
36 | 22 | &:hover { |
37 | 23 | background-color: var(--p-surface-hovered); |
38 | 24 |
|
39 | | - &:not(.persistActions) { |
40 | | - // stylelint-disable-next-line selector-max-specificity |
41 | | - .Actions { |
| 25 | + .Actions { |
| 26 | + /* stylelint-disable-next-line selector-max-combinators */ |
| 27 | + > * { |
42 | 28 | @include action-unhide; |
43 | | - |
44 | | - // stylelint-disable-next-line max-nesting-depth |
45 | | - @media #{$p-breakpoints-lg-down} { |
46 | | - display: none; |
47 | | - } |
48 | 29 | } |
49 | 30 | } |
50 | 31 | } |
|
82 | 63 | border: none; |
83 | 64 | } |
84 | 65 |
|
85 | | -// Item inner container |
86 | | -.Container { |
87 | | - position: relative; |
88 | | - z-index: var(--pc-resource-item-content-stacking-order); |
89 | | - padding: var(--p-space-3) var(--p-space-4); |
90 | | - min-height: var(--pc-resource-item-min-height); |
91 | | - display: flex; |
92 | | - align-items: flex-start; |
93 | | - |
94 | | - @media #{$p-breakpoints-sm-up} { |
95 | | - padding: var(--p-space-3) var(--p-space-5); |
96 | | - } |
97 | | -} |
98 | | - |
99 | | -.alignmentLeading { |
100 | | - align-items: flex-start; |
101 | | -} |
102 | | - |
103 | | -.alignmentTrailing { |
104 | | - align-items: flex-end; |
105 | | -} |
106 | | - |
107 | | -.alignmentCenter { |
108 | | - align-items: center; |
109 | | -} |
110 | | - |
111 | | -.alignmentFill { |
112 | | - align-items: stretch; |
113 | | -} |
114 | | - |
115 | | -.alignmentBaseline { |
116 | | - align-items: baseline; |
117 | | -} |
118 | | - |
119 | | -.Owned { |
120 | | - display: flex; |
121 | | -} |
122 | | - |
123 | | -.OwnedNoMedia { |
124 | | - padding-top: var(--p-space-1); |
125 | | -} |
126 | | - |
127 | | -// Item handle |
128 | | -.Handle { |
129 | | - width: 48px; |
130 | | - min-height: var(--pc-resource-item-min-height); |
131 | | - justify-content: center; |
132 | | - align-items: center; |
133 | | - margin: calc(-1 * var(--p-space-3)) var(--p-space-1) |
134 | | - calc(-1 * var(--p-space-3)) calc(-1 * var(--p-space-3)); |
135 | | - display: flex; |
136 | | - |
137 | | - @media #{$p-breakpoints-sm-down} { |
138 | | - visibility: hidden; |
139 | | - |
140 | | - .selectMode & { |
141 | | - visibility: visible; |
142 | | - } |
143 | | - } |
144 | | -} |
145 | | - |
146 | 66 | .selectable { |
147 | 67 | width: calc(100% + var(--pc-resource-item-offset)); |
148 | 68 | transform: translateX(calc(-1 * var(--pc-resource-item-offset))); |
|
160 | 80 | } |
161 | 81 | } |
162 | 82 |
|
163 | | -.Media { |
164 | | - flex: 0 0 auto; |
165 | | - margin-right: var(--p-space-5); |
166 | | - color: inherit; |
167 | | - text-decoration: none; |
168 | | -} |
169 | | - |
170 | | -// Item content |
171 | | -.Content { |
172 | | - @include layout-flex-fix; |
173 | | - flex: 1 1 auto; |
174 | | -} |
175 | | - |
176 | 83 | // Item actions |
177 | 84 | .Actions { |
178 | | - position: absolute; |
179 | | - top: 0; |
180 | | - display: flex; |
181 | | - pointer-events: initial; |
182 | | - height: 100%; |
183 | | - max-height: 56px; |
184 | | - |
185 | | - @include action-hide; |
186 | | - |
187 | | - .focused & { |
188 | | - @include action-unhide; |
| 85 | + > * { |
| 86 | + @include action-hide; |
189 | 87 | } |
190 | 88 |
|
191 | | - @media #{$p-breakpoints-lg-down} { |
192 | | - display: none; |
193 | | - } |
194 | | -} |
195 | | - |
196 | | -.persistActions { |
197 | | - .Actions { |
198 | | - position: relative; |
199 | | - display: flex; |
200 | | - flex: 0 0 auto; |
201 | | - flex-basis: auto; |
202 | | - align-items: center; |
203 | | - margin-top: 0; |
204 | | - margin-left: var(--p-space-4); |
205 | | - pointer-events: initial; |
206 | | - height: 100%; |
207 | | - |
208 | | - @media #{$p-breakpoints-lg-down} { |
209 | | - display: none; |
| 89 | + .focused & { |
| 90 | + // stylelint-disable-next-line selector-max-combinators |
| 91 | + > * { |
| 92 | + @include action-unhide; |
210 | 93 | } |
211 | 94 | } |
212 | 95 | } |
213 | 96 |
|
214 | | -.Disclosure { |
215 | | - position: relative; |
216 | | - top: calc(-1 * var(--p-space-3)); |
217 | | - right: calc(-1 * var(--p-space-4)); |
218 | | - display: none; |
219 | | - width: var(--pc-resource-item-disclosure-width); |
220 | | - min-height: var(--pc-resource-item-min-height); |
221 | | - pointer-events: initial; |
222 | | - |
223 | | - .selectMode & { |
224 | | - display: none; |
225 | | - } |
226 | | - |
227 | | - @media #{$p-breakpoints-lg-down} { |
228 | | - display: flex; |
229 | | - flex: 0 0 var(--pc-resource-item-disclosure-width); |
230 | | - justify-content: center; |
231 | | - align-items: center; |
232 | | - } |
233 | | -} |
234 | | - |
235 | 97 | .selected { |
236 | 98 | background-color: var(--p-surface-selected); |
237 | 99 |
|
|
245 | 107 | } |
246 | 108 |
|
247 | 109 | .ListItem { |
248 | | - position: relative; |
249 | 110 | @include focus-ring($border-width: -1px); |
250 | 111 |
|
251 | 112 | .ListItem + & { |
|
0 commit comments