|
| 1 | +// stylelint-disable max-nesting-depth, selector-max-specificity |
| 2 | + |
1 | 3 | @mixin focusOutline { |
2 | 4 | position: relative; |
3 | 5 | z-index: 1; |
|
22 | 24 | list-style: none; |
23 | 25 | background-color: transparent; |
24 | 26 | border-radius: $border-radius; |
| 27 | + touch-action: manipulation; |
| 28 | + -webkit-tap-highlight-color: transparent; |
25 | 29 |
|
26 | 30 | &:hover, |
27 | 31 | &:active { |
|
35 | 39 |
|
36 | 40 | // only hover li without list as children |
37 | 41 | &:not(.ActionList-item--hasSubItem) { |
38 | | - &:hover { |
39 | | - cursor: pointer; |
40 | | - background-color: var(--color-action-list-item-default-hover-bg); |
| 42 | + @media (hover: hover) { |
| 43 | + &:hover { |
| 44 | + cursor: pointer; |
| 45 | + background-color: var(--color-action-list-item-default-hover-bg); |
| 46 | + } |
41 | 47 | } |
42 | 48 |
|
43 | 49 | &:active { |
|
49 | 55 |
|
50 | 56 | // stylelint-disable primer/box-shadow |
51 | 57 | @keyframes ActionList-item-active-bg { |
52 | | - // stylelint-disable-next-line max-nesting-depth |
53 | 58 | 50% { |
54 | 59 | box-shadow: inset 0 0 0 rgba(#000, 0.04); |
55 | 60 | transform: scale(1); |
56 | 61 | } |
57 | 62 |
|
58 | | - // stylelint-disable-next-line max-nesting-depth |
59 | 63 | 100% { |
60 | 64 | box-shadow: inset 0 3px 9px rgba(#000, 0.04); |
61 | 65 | transform: scale(0.97); |
|
64 | 68 | // stylelint-enable primer/box-shadow |
65 | 69 | } |
66 | 70 |
|
67 | | - &:hover, |
| 71 | + // hide dividers |
| 72 | + |
| 73 | + @media (hover: hover) { |
| 74 | + &:hover { |
| 75 | + .ActionList-item-label::before, |
| 76 | + + .ActionList-item .ActionList-item-label::before { |
| 77 | + visibility: hidden; |
| 78 | + } |
| 79 | + } |
| 80 | + } |
| 81 | + // stylelint-disable-next-line no-duplicate-selectors |
68 | 82 | &:active { |
69 | | - // hide dividers |
70 | | - // stylelint-disable-next-line selector-max-specificity |
71 | 83 | .ActionList-item-label::before, |
72 | 84 | + .ActionList-item .ActionList-item-label::before { |
73 | 85 | visibility: hidden; |
|
80 | 92 | &.ActionList-item--hasSubItem { |
81 | 93 | // first child |
82 | 94 | > .ActionList-content { |
83 | | - &:hover { |
84 | | - background-color: var(--color-action-list-item-default-hover-bg); |
| 95 | + z-index: 1; |
| 96 | + |
| 97 | + @media (hover: hover) { |
| 98 | + &:hover { |
| 99 | + background-color: var(--color-action-list-item-default-hover-bg); |
| 100 | + } |
| 101 | + } |
| 102 | + |
| 103 | + &:active { |
| 104 | + background-color: var(--color-action-list-item-default-active-bg); |
85 | 105 | } |
86 | 106 | } |
87 | 107 | } |
|
98 | 118 | &:not(.ActionList-item--danger) { |
99 | 119 | background: var(--color-action-list-item-default-selected-bg); |
100 | 120 |
|
101 | | - // stylelint-disable-next-line selector-max-specificity |
| 121 | + @media (hover: hover) { |
| 122 | + &:hover { |
| 123 | + background-color: var(--color-action-list-item-default-hover-bg); |
| 124 | + } |
| 125 | + } |
| 126 | + |
102 | 127 | &::before, |
103 | 128 | + .ActionList-item::before { |
104 | 129 | visibility: hidden; |
|
117 | 142 | // target items inside expanded subgroups |
118 | 143 | &[aria-expanded] { |
119 | 144 | .ActionList--subGroup { |
| 145 | + @media screen and (prefers-reduced-motion: no-preference) { |
| 146 | + transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1); |
| 147 | + } |
| 148 | + |
120 | 149 | .ActionList-content { |
121 | 150 | padding-left: $spacer-4; |
122 | 151 | } |
123 | 152 | } |
124 | 153 |
|
125 | 154 | // has 16px leading visual |
126 | 155 | .ActionList-content--visual16 + .ActionList--subGroup { |
127 | | - // stylelint-disable-next-line selector-max-compound-selectors, selector-max-specificity |
| 156 | + // stylelint-disable-next-line selector-max-compound-selectors |
128 | 157 | .ActionList-content { |
129 | 158 | padding-left: $spacer-5; |
130 | 159 | } |
131 | 160 | } |
132 | 161 |
|
133 | 162 | // has 20px leading visual |
134 | 163 | .ActionList-content--visual20 + .ActionList--subGroup { |
135 | | - // stylelint-disable-next-line selector-max-compound-selectors, selector-max-specificity |
| 164 | + // stylelint-disable-next-line selector-max-compound-selectors |
136 | 165 | .ActionList-content { |
137 | 166 | padding-left: $spacer-2 * 4.5; // 36px |
138 | 167 | } |
139 | 168 | } |
140 | 169 |
|
141 | 170 | // has 24px leading visual |
142 | 171 | .ActionList-content--visual24 + .ActionList--subGroup { |
143 | | - // stylelint-disable-next-line selector-max-compound-selectors, selector-max-specificity |
| 172 | + // stylelint-disable-next-line selector-max-compound-selectors |
144 | 173 | .ActionList-content { |
145 | 174 | padding-left: $spacer-6; |
146 | 175 | } |
|
154 | 183 | } |
155 | 184 |
|
156 | 185 | .ActionList--subGroup { |
157 | | - display: block; |
| 186 | + height: auto; |
| 187 | + overflow: visible; |
| 188 | + visibility: visible; |
| 189 | + opacity: 1; |
| 190 | + transform: translateY(0); |
158 | 191 | } |
159 | 192 |
|
160 | 193 | &.ActionList-item--hasActiveSubItem { |
161 | | - // stylelint-disable-next-line selector-max-specificity |
162 | 194 | > .ActionList-content > .ActionList-item-label { |
163 | 195 | font-weight: $font-weight-bold; |
164 | 196 | } |
|
172 | 204 | } |
173 | 205 |
|
174 | 206 | .ActionList--subGroup { |
175 | | - display: none; |
| 207 | + height: 0; |
| 208 | + overflow: hidden; |
| 209 | + visibility: hidden; |
| 210 | + opacity: 0; |
| 211 | + transform: translateY(-$spacer-3); |
176 | 212 | } |
177 | 213 |
|
178 | 214 | // show active indicator on parent collapse if child is active |
|
183 | 219 | font-weight: $font-weight-bold; |
184 | 220 | } |
185 | 221 |
|
186 | | - // stylelint-disable-next-line selector-max-specificity |
187 | 222 | &::before, |
188 | 223 | + .ActionList-item::before { |
189 | 224 | visibility: hidden; |
|
300 | 335 | color: var(--color-danger-fg); |
301 | 336 | } |
302 | 337 |
|
303 | | - @media (hover: hover) and (pointer: fine) { |
| 338 | + @media (hover: hover) { |
304 | 339 | &:hover { |
305 | 340 | background: var(--color-action-list-item-danger-hover-bg); |
306 | 341 |
|
307 | | - // stylelint-disable-next-line max-nesting-depth |
308 | 342 | .ActionList-item-label { |
309 | 343 | color: var(--color-action-list-item-danger-hover-text); |
310 | 344 | } |
|
327 | 361 | fill: var(--color-primer-fg-disabled); |
328 | 362 | } |
329 | 363 |
|
330 | | - @media (hover: hover) and (pointer: fine) { |
| 364 | + @media (hover: hover) { |
331 | 365 | &:hover { |
332 | 366 | cursor: not-allowed; |
333 | 367 | background-color: transparent; |
|
352 | 386 | font-weight: $font-weight-normal; |
353 | 387 | color: var(--color-fg-default); |
354 | 388 | user-select: none; |
| 389 | + touch-action: manipulation; |
355 | 390 | border-radius: $border-radius; |
356 | 391 | transition: $actionList-item-bg-transition; |
357 | 392 | grid-template-rows: min-content; |
|
0 commit comments