|
1 |
| -// stylelint-disable max-nesting-depth, selector-max-compound-selectors, selector-max-specificity, no-duplicate-selectors, selector-max-type |
| 1 | +// stylelint-disable max-nesting-depth, selector-max-compound-selectors, selector-max-specificity, selector-max-type, primer/spacing |
2 | 2 | // tree-view variant
|
3 | 3 | // renders ActionList with default styling for tree-view
|
4 | 4 | // collapse/expand icons presents as leadingActions, rotate 90deg
|
|
40 | 40 | }
|
41 | 41 | }
|
42 | 42 |
|
43 |
| - // start: copy from ActionList proper- backwards compatible for treeview with different markup structure |
44 |
| - &[aria-expanded] { |
45 |
| - .ActionList--subGroup { |
46 |
| - @media screen and (prefers-reduced-motion: no-preference) { |
47 |
| - transition: opacity 160ms cubic-bezier(0.25, 1, 0.5, 1), transform 160ms cubic-bezier(0.25, 1, 0.5, 1); |
48 |
| - } |
49 |
| - |
50 |
| - .ActionList-content { |
51 |
| - padding-left: $spacer-4; |
52 |
| - } |
53 |
| - } |
54 |
| - |
55 |
| - // has 16px leading visual |
56 |
| - .ActionList-content--visual16 + .ActionList--subGroup { |
57 |
| - .ActionList-content { |
58 |
| - padding-left: $spacer-5; |
59 |
| - } |
60 |
| - } |
61 |
| - |
62 |
| - // has 20px leading visual |
63 |
| - .ActionList-content--visual20 + .ActionList--subGroup { |
64 |
| - .ActionList-content { |
65 |
| - padding-left: $spacer-2 * 4.5; // 36px |
66 |
| - } |
67 |
| - } |
68 |
| - |
69 |
| - // has 24px leading visual |
70 |
| - .ActionList-content--visual24 + .ActionList--subGroup { |
71 |
| - .ActionList-content { |
72 |
| - padding-left: $spacer-6; |
| 43 | + // normal font-weight for any active item |
| 44 | + &.ActionList-item--navActive { |
| 45 | + &:not(.ActionList-item--subItem) { |
| 46 | + .ActionList-item-label { |
| 47 | + font-weight: $font-weight-normal; |
73 | 48 | }
|
74 | 49 | }
|
75 | 50 | }
|
76 | 51 |
|
77 |
| - &[aria-expanded='true'] { |
78 |
| - .ActionList-item-collapseIcon { |
79 |
| - transition: transform 120ms linear; |
80 |
| - transform: scaleY(-1); |
81 |
| - } |
82 |
| - |
83 |
| - .ActionList--subGroup { |
84 |
| - height: auto; |
85 |
| - overflow: visible; |
86 |
| - visibility: visible; |
87 |
| - opacity: 1; |
88 |
| - transform: translateY(0); |
89 |
| - } |
90 |
| - } |
91 |
| - |
92 |
| - &[aria-expanded='false'] { |
93 |
| - .ActionList-item-collapseIcon { |
94 |
| - transition: transform 120ms linear; |
95 |
| - transform: scaleY(1); |
96 |
| - } |
97 |
| - |
98 |
| - .ActionList--subGroup { |
99 |
| - height: 0; |
100 |
| - overflow: hidden; |
101 |
| - visibility: hidden; |
102 |
| - opacity: 0; |
103 |
| - transform: translateY(-$spacer-3); |
104 |
| - } |
105 |
| - |
106 |
| - // show active indicator on parent collapse if child is active |
107 |
| - // this class changed in ActionList proper |
108 |
| - &.ActionList-item--hasActiveSubItem { |
109 |
| - background: var(--color-action-list-item-default-selected-bg); |
110 |
| - |
111 |
| - &::before, |
112 |
| - + .ActionList-item::before { |
113 |
| - visibility: hidden; |
114 |
| - } |
115 |
| - |
116 |
| - // blue accent line |
117 |
| - &::after { |
118 |
| - @include activeIndicatorLine; |
119 |
| - } |
120 |
| - } |
121 |
| - } |
122 |
| - // end copy |
123 |
| - |
124 | 52 | // nesting (infinite levels)
|
125 | 53 | // target items inside expanded subgroup
|
126 | 54 | &[aria-expanded] {
|
|
129 | 57 |
|
130 | 58 | // --ActionList-tree-depth is defined as an inline style referencing the aria-level of each item ie: aria-level="2"
|
131 | 59 | .ActionList-content {
|
132 |
| - // stylelint-disable-next-line primer/spacing |
133 | 60 | padding-left: calc(#{$spacer-2} * var(--ActionList-tree-depth));
|
134 | 61 | }
|
135 | 62 | }
|
|
141 | 68 | transition: transform 120ms linear;
|
142 | 69 | transform: rotate(0deg);
|
143 | 70 | }
|
| 71 | + |
| 72 | + // normal weight for parent folder containing active child |
| 73 | + .ActionList-content--hasActiveSubItem { |
| 74 | + >.ActionList-item-label { |
| 75 | + font-weight: $font-weight-normal; |
| 76 | + } |
| 77 | + } |
144 | 78 | }
|
145 | 79 |
|
146 | 80 | &[aria-expanded='false'] {
|
|
0 commit comments