|
1 |
| -// stylelint-disable max-nesting-depth, selector-max-specificity |
| 1 | +// stylelint-disable max-nesting-depth, selector-max-specificity, selector-max-compound-selectors |
2 | 2 |
|
3 | 3 | @mixin focusOutline {
|
4 | 4 | position: relative;
|
|
38 | 38 | }
|
39 | 39 |
|
40 | 40 | // only hover li without list as children
|
41 |
| - &:not(.ActionList-item--hasSubItem) { |
| 41 | + &:not(.ActionList-item--hasSubItem), |
| 42 | + // target contents of first child li if sub-item (li wraps item label + nested ul) |
| 43 | + &.ActionList-item--hasSubItem > .ActionList-content { |
42 | 44 | @media (hover: hover) {
|
43 | 45 | &:hover {
|
44 | 46 | cursor: pointer;
|
45 | 47 | background-color: var(--color-action-list-item-default-hover-bg);
|
| 48 | + |
| 49 | + &:not(.ActionList-item--navActive) { |
| 50 | + // Support for "Windows high contrast mode" |
| 51 | + outline: $border-style $border-width transparent; |
| 52 | + outline-offset: -$border-width; |
| 53 | + // stylelint-disable-next-line primer/box-shadow |
| 54 | + box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border); |
| 55 | + } |
46 | 56 | }
|
47 | 57 | }
|
48 | 58 |
|
49 | 59 | &:active {
|
50 | 60 | background: var(--color-action-list-item-default-active-bg);
|
51 | 61 |
|
| 62 | + &:not(.ActionList-item--navActive) { |
| 63 | + // Support for "Windows high contrast mode" https://sarahmhigley.com/writing/whcm-quick-tips/ |
| 64 | + outline: $border-style $border-width transparent; |
| 65 | + outline-offset: -$border-width; |
| 66 | + // stylelint-disable-next-line primer/box-shadow |
| 67 | + box-shadow: inset 0 0 0 2px var(--color-action-list-item-default-active-border); |
| 68 | + } |
| 69 | + |
52 | 70 | @media screen and (prefers-reduced-motion: no-preference) {
|
53 | 71 | animation: ActionList-item-active-bg 4s forwards cubic-bezier(0.33, 1, 0.68, 1);
|
54 | 72 | }
|
55 | 73 |
|
56 |
| - // stylelint-disable primer/box-shadow |
57 | 74 | @keyframes ActionList-item-active-bg {
|
58 | 75 | 50% {
|
59 |
| - box-shadow: inset 0 0 0 rgba(#000, 0.04); |
| 76 | + // stylelint-disable-next-line primer/box-shadow |
| 77 | + box-shadow: inset 0 2px 12px 6px rgba(var(--color-canvas-default), 0.4); |
60 | 78 | transform: scale(1);
|
61 | 79 | }
|
62 | 80 |
|
63 | 81 | 100% {
|
64 |
| - box-shadow: inset 0 3px 9px rgba(#000, 0.04); |
65 | 82 | transform: scale(0.97);
|
66 | 83 | }
|
67 | 84 | }
|
68 |
| - // stylelint-enable primer/box-shadow |
69 | 85 | }
|
70 | 86 |
|
71 | 87 | // hide dividers
|
|
153 | 169 |
|
154 | 170 | // has 16px leading visual
|
155 | 171 | .ActionList-content--visual16 + .ActionList--subGroup {
|
156 |
| - // stylelint-disable-next-line selector-max-compound-selectors |
157 | 172 | .ActionList-content {
|
158 | 173 | padding-left: $spacer-5;
|
159 | 174 | }
|
160 | 175 | }
|
161 | 176 |
|
162 | 177 | // has 20px leading visual
|
163 | 178 | .ActionList-content--visual20 + .ActionList--subGroup {
|
164 |
| - // stylelint-disable-next-line selector-max-compound-selectors |
165 | 179 | .ActionList-content {
|
166 | 180 | padding-left: $spacer-2 * 4.5; // 36px
|
167 | 181 | }
|
168 | 182 | }
|
169 | 183 |
|
170 | 184 | // has 24px leading visual
|
171 | 185 | .ActionList-content--visual24 + .ActionList--subGroup {
|
172 |
| - // stylelint-disable-next-line selector-max-compound-selectors |
173 | 186 | .ActionList-content {
|
174 | 187 | padding-left: $spacer-6;
|
175 | 188 | }
|
|
0 commit comments